From patchwork Tue Mar 19 10:41:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160552 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711963jad; Tue, 19 Mar 2019 03:42:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkdwWtQZT/kVYYXZp3IU74P384K6c6cOc3Lk8BaV+Bos+cV3EJcz7t4THJffaPGEZIZ0iZ X-Received: by 2002:a17:902:9a98:: with SMTP id w24mr1605190plp.247.1552992166270; Tue, 19 Mar 2019 03:42:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992166; cv=none; d=google.com; s=arc-20160816; b=H2V473cnrzraE+zHoIbdlInOLij6XdDFACFUkFYKl71UM253rFvYdJICet3URSlbPt ttrTfnPAPM+3B1NUeTfrVBeBMlSIjpblrh6YZlkaSXbjuFO9MFReWyX48fLEWEk8smW3 l1RBDlcwzKXYRN4UZ9dy2kj0JpI7yVtViiCFKNCxCv4sPI5XPaKPCO3aObxMUqgg4wJC Lhv1vF4HnQiCh1ZSCguNQ8PTGriqGy7G3BykYxu8RDmTHhNZ4cciKY2w3+LCYnce1W7w Xb3IKEjQcK0b1cqHYXjQJavyvCmYS7uJK/5ZD1hlfQ7I60EPLLUlHNBPBRE33kPeDQek m/bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=XARWfW1ePXknZYiu+drpkyMmC8Xb7ludIzaKrF5XcKU=; b=AJxbfR7QmY2N7qT2XipWWsTljRPl204x9OHGFMOYBW/rvat5KrDyNHk/ThskPZ0ctv Y0R1T81lFweeqlk86Mx57r+E9Pw5/JB1h0PtvErRmTHpNHqvP26osNyL98N6vKuUvee1 uDt8eTzk71dAPxUKkMdLMIVxUVfZVADorr9spvSVhpN4oIpil4km6t6vjjqFg+sczR4Z 8czQLrqrZ8asSsqzRPiLY6UJlSGg4GJdD4T1x0IlcfIlGKRc5w6/n52dhS6qefFjngps 7i2G2rWizNiLvqn5MRreATxxjnkVIVCuC9H+50Wgvq8yDrd91sx85Eru2KafYSOq3h7/ 8I8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 133si3614271pfb.253.2019.03.19.03.42.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 90C7789AB2; Tue, 19 Mar 2019 10:42:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8AE1A89A9F for ; Tue, 19 Mar 2019 10:42:38 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgYWb051408; Tue, 19 Mar 2019 05:42:34 -0500 Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgYHh105798 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:34 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 19 Mar 2019 05:42:32 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1713.5 via Frontend Transport; Tue, 19 Mar 2019 05:42:32 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x2JAfxlW019091; Tue, 19 Mar 2019 05:42:30 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 13/21] drm/bridge: tc358767: use more reliable seq when finishing LT Date: Tue, 19 Mar 2019 12:41:06 +0200 Message-ID: <20190319104114.12077-14-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190319104114.12077-1-tomi.valkeinen@ti.com> References: <20190319104114.12077-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1552992154; bh=AguGsa/I/UDqeQ96kBs0q7R11wd1LweJn55lxYYq3YU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ElCyKqBMUwoJILRrJN5p5qP0Usz7tcdtKRsFAlx7QT/06ZFDvxp/kYqwRSMnuLFJb FnteIbiEw03KkIBdEZvsDNSfdgN4pwOPWGISfPviKzaEU6UubSZSnXoACWlhM+x5cp 3a54DSCgdT6++A4PBCcXRbeZpifbu+xLUsgIWdp8= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" At the end of the link training, two steps have to be taken: 1) tc358767's LT mode is disabled by a write to DP0_SRCCTRL, and 2) Remove LT flag in DPCD 0x102. Toshiba's documentation tells to first write the DPCD, then modify DP0_SRCCTRL. In my testing this often causes issues, and the link disconnects right after those steps. If I reverse the steps, it works every time. There's a chance that this is DP sink specific, though, but as my testing shows this sequence to be much more reliable, let's change it. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/bridge/tc358767.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 2a6c0c0d47a6..700e161015af 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -958,6 +958,9 @@ static int tc_main_link_enable(struct tc_data *tc) if (ret) goto err; + /* Clear Training Pattern, set AutoCorrect Mode = 1 */ + tc_write(DP0_SRCCTRL, tc_srcctrl(tc) | DP0_SRCCTRL_AUTOCORRECT); + /* Clear DPCD 0x102 */ /* Note: Can Not use DP0_SNKLTCTRL (0x06E4) short cut */ tmp[0] = tc->link.scrambler_dis ? DP_LINK_SCRAMBLING_DISABLE : 0x00; @@ -965,9 +968,6 @@ static int tc_main_link_enable(struct tc_data *tc) if (ret < 0) goto err_dpcd_write; - /* Clear Training Pattern, set AutoCorrect Mode = 1 */ - tc_write(DP0_SRCCTRL, tc_srcctrl(tc) | DP0_SRCCTRL_AUTOCORRECT); - /* Wait */ timeout = 100; do {