From patchwork Fri May 3 12:29:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163311 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp546740ill; Fri, 3 May 2019 05:31:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqziDEf4l+4q5a9WQ4c+9wJfC9GKZNa91l9P0FuYOC0Vu0006Mt0VG6hKKsqI+3s7MtmiSzL X-Received: by 2002:a63:2943:: with SMTP id p64mr9925486pgp.151.1556886675615; Fri, 03 May 2019 05:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556886675; cv=none; d=google.com; s=arc-20160816; b=G/BRmkKhGi1Glp5AzK0hHASU7P1SStGHUQc470Bg4gbETMUSmHNuRYlOO5K4ExRpLE coQ/KuDykvBL9Y7Gw4FfaDF5DVQDX3+x/diENgNwAfwWH6MJ1O6X6I2Cb6pRelnpSRUi NpzdbHRQ0e9IXkptfq6arIebKc5sCxEH63/MeqI2L3YzI57JmBa+/f/cWIoE26Ssb9ty oKW/DJoKSijIpGWNVMNrgmcSMEXWinN+TsB3tZK75a914DUR7JtVxkYLJroawoGk7ZpY kVzqMTOsRthxdlH2+OYV5vLcmC+ufcq3lTeMXPpkmhcTbyUCmlMVSplJsqr03F94ctAT REJQ== 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=E4of25t8I32pv3e2ahibLWI829aExP5/W2myEPSfPn8=; b=hF3d1wVvznDG4J+t6UM1zSKdtp+JQxfPF+vtknVYHfK0uRuig7GfeMBMo+VxcPDfvy m7L0cC5t2qWDO7DLrKsJz7X6Gho6OmDafS0TXJh+YtSoAUKsVyoEJfCFQNklonzeqckK uiuulvDTAijOSFraTJdRHPYsAj7zEARj/Id/OpfLPzVWG/4DaPpsAd7QBHrIb1HyT6H7 rfrTfxmw0YKeFs6Q1AnLV7+YiRlQVKXSs36eqvpFPfOWeMix/Q7wBxTxkGd7YzK+LWib rLDOqoe+Ul3o3DVCbOVV21RKQfBoCxVJdYGQkhK96b9MzDzCIAjdaBOqanW9syjRz7hz Acug== 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 p1si2148528pls.64.2019.05.03.05.31.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 05:31:15 -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 4EA5B89ED6; Fri, 3 May 2019 12:31:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0FCB989ED6 for ; Fri, 3 May 2019 12:31:13 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x43CVAvg032403; Fri, 3 May 2019 07:31:10 -0500 Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x43CVAlk049342 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 May 2019 07:31:10 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 3 May 2019 07:31:08 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE106.ent.ti.com (10.64.6.27) 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; Fri, 3 May 2019 07:31:08 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x43CUYtu002029; Fri, 3 May 2019 07:31:05 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Peter Ujfalusi , Jyri Sarha , Benoit Parrot , Subject: [PATCHv3 12/23] drm/bridge: tc358767: ensure DP is disabled before LT Date: Fri, 3 May 2019 15:29:38 +0300 Message-ID: <20190503122949.12266-13-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190503122949.12266-1-tomi.valkeinen@ti.com> References: <20190503122949.12266-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=1556886670; bh=Efk1Ycnio9/QwgjEM+QHlSLQM9m/K9+niYYOJwjq81k=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=wAHzrFARiRE6cXiloPGTSzCYCytliDw7juNO6DDObS0VThAyfbi0dkFYEzMqBYfLh rb1CMSBjVxPdkKq5dxXbs8ktlhmlQD8eCfrENUGocl3/lRWlYvby12LK2oe9OG5B1/ A6PBJ0I+a5900xaMOk2RC3xW66lLXUjI8V3ZEmhI= 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" Link training will sometimes fail if the DP link is enabled when tc_main_link_enable() is called. The driver makes sure the DP link is disabled when the DP output is disabled, and we never enable the DP without first disabling it, so this should never happen. However, as the HW behavior seems to be somewhat random if DP link has erroneously been left enabled, let's add a WARN_ON() for the case and set DP0CTL to 0. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/tc358767.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 86e2e16c5a90..cec825600158 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -839,6 +839,10 @@ static int tc_main_link_enable(struct tc_data *tc) dev_dbg(tc->dev, "link enable\n"); + tc_read(DP0CTL, &value); + if (WARN_ON(value != 0)) + tc_write(DP0CTL, 0); + tc_write(DP0_SRCCTRL, tc_srcctrl(tc)); /* SSCG and BW27 on DP1 must be set to the same as on DP0 */ tc_write(DP1_SRCCTRL,