From patchwork Tue Mar 26 10:31:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 161190 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp5039018jan; Tue, 26 Mar 2019 03:33:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyouRRnQv0ctxGPlZkOhrRDupnw4Vrc0chufS9avVTi3GnJAM06NHNhQ8I0hqSpwLBszrud X-Received: by 2002:a63:5460:: with SMTP id e32mr28479020pgm.401.1553596395695; Tue, 26 Mar 2019 03:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553596395; cv=none; d=google.com; s=arc-20160816; b=v63GAGedtE0g3Twi9yhoPwpw8auogatzkOu7CfM8bRbqBkh20lRyFD8vj3yH8NqlMw dIhCP2Yn3zwdvowrDzJarb2+PVwom3RVHAWIFffvojDUcPlmKBmrWV1To4MJxwig7NwK z/ptQz/exuTtTEHsBU9KcoU7E2dx/RFR+BTPPfyfUOKcHMWjzB98PhoZJG2d1uY0DfrG KtKdRFiEkJDVDZ8Iy8pQpj8226J82P4FTMXMDz+0NaxbIi48deglQUgIV0D8XwtJpaOE i212TKjV+w4YCK4Pk+o28+tAdgGBCYKuE6wAFoB8MqEifuuHnYF0tL3axHeFbCYaPQje wdXw== 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=hSvoXmIEU8YBGHLMadoLRg0Yz7o5rq2lXhM2spBzDJcR/ujL65K8JECiB+IP/uOQgu ILWLsc87DFa7k9X0uV/3CgXbhBebCaB/YrTs8vaDX4tcorkNzBvu9b4mmRvidVKxHYqY PEuB2eoB57dBWvRZ9d07sm2j6T7Vo5UHMFZUozRdzL476U8qc7OdonkF/n1STvObRcuz 3F0SmnP9/VqwF9K71S0yhSWuVHsh25164vj7mHfy8om3OIojsEB9DlI2Ql+3A1Xf5TLC Z5isd9mqSWT42Q44zGDzRnolSQJP7gaMgQebiui9UUMji8GBGNQkSD8roIZuPrWPSuVH 3eIQ== 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 2610:10:20:722:a800:ff:fe36:1795 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. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id m24si15864354pgh.485.2019.03.26.03.33.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2019 03:33:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 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 4D07A6E7EE; Tue, 26 Mar 2019 10:33:12 +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 B9AD66E7EB for ; Tue, 26 Mar 2019 10:33:04 +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 x2QAX0ad086499; Tue, 26 Mar 2019 05:33:00 -0500 Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2QAX0Kx044625 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 26 Mar 2019 05:33:00 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 26 Mar 2019 05:33:00 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 26 Mar 2019 05:33:00 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x2QAWN2F071249; Tue, 26 Mar 2019 05:32:58 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCHv2 13/22] drm/bridge: tc358767: use more reliable seq when finishing LT Date: Tue, 26 Mar 2019 12:31:37 +0200 Message-ID: <20190326103146.24795-14-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190326103146.24795-1-tomi.valkeinen@ti.com> References: <20190326103146.24795-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=1553596380; bh=AguGsa/I/UDqeQ96kBs0q7R11wd1LweJn55lxYYq3YU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ogJXcH7nwBYsSRZHqJYhlpBjkgbNOJ4vcBpB0pShYzojfeNXJFzyX/yvwfSO84cxb Wv2qz71UYufry1S2i+cu3x9jzeIMDbnXEsmYUZW2VGswMMSUAv3sqcC0ULD5I95y3Z TLmOIpzirGoqlunP35WzbD7p8LwEonoDGNoE+uqE= 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 Reviewed-by: Andrzej Hajda --- 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 {