Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1010430pxb; Wed, 1 Sep 2021 15:12:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW9x13rKgcWkolafSK6AzvRuf8+TIlwAgjOv4wdvj3/+TkZXLF+IouQsB/ECAWQ34PKFMV X-Received: by 2002:a17:906:4f97:: with SMTP id o23mr71541eju.418.1630534362270; Wed, 01 Sep 2021 15:12:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630534362; cv=none; d=google.com; s=arc-20160816; b=EqEz2LWdvJbLp/0GYPk6wFg7k0dA21260EctwOrNDbv9GkQc7+bQqW735pVyMvvicm AODLqL1TFYFRmjj0t5TiNSZy5At7xpQvynIbsZZK8lX/HtJP2vJSwT2i2sQruIXfaP2Z fr/1bQwmt5oCuoLRJEI1MJVssiPy/iHZbvw+m245o19As/wIkw5y/W3BWJEh8l6RvT6p LKu+B4ktRA+NUW8JwIx/Jq4anDYPooqEXbv7A4V20365AZZgpY5m2MJx6SeATqgTe2tu z4drGceWjMjRQNELVU0bhkIPE0KOuIq4OJgAXd8H3OkY4nD/5Y1UYJHDCyDYRDy0giq0 A+Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zeWElzQDXYZpDxH0rg5q9SKElMSTs59IqI83ZF+lnCY=; b=fy2IBLIdY/nFzLx7e/wytKGSbE7n3TC3J0mLONEBtrhGvl/+X6CyXC4BHU5y5bD8DG bB6cYJ316CAmz298FuQlKkB4LS4dRCNWqP/f20WflEMaKRARmfd3LRn4K8PeyRorpSxu cPO6LWJmh6R/4WhmV58IqRk99OsamKvVQgWmPAbHD2LwCK+Jxrx/tHlsWeYK5Ppn0Xty Hme7nd6uy5eEzGIO42EqPinuGDTAnpcF7LbLk8T2LV4LuBeoqKrwO7mLJh0cQB2AJ5ni lPrwHrTGno5CTNPEYKmMMWm8ardZjHjNAKZ1mEAvrZDNoqi+SEBhVuthdjK6CTbve01Q cydA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qs4TTuht; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h7si999258ejo.323.2021.09.01.15.12.13; Wed, 01 Sep 2021 15:12:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qs4TTuht; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344240AbhIAMxh (ORCPT + 99 others); Wed, 1 Sep 2021 08:53:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:54242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346280AbhIAMtl (ORCPT ); Wed, 1 Sep 2021 08:49:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E1466120D; Wed, 1 Sep 2021 12:41:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630500079; bh=pdzR9bAcvlOI9LJRvaU3alz4Kke8fRSlkhih6w2qr9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qs4TTuhtJvi3r5EvFb++AvfXUIrhqvBQPyyyGDEGnVKai3k0g3ANRp/WioLs8nUWs Q1wSUAhiR7K9cA0uUyFg2R4urUiHrRYELSwyuvByBbcmXCxx2q5LOfmJ2f950pIv/a t/4EGLA7o/OY/ZQG3oyz16mTUrBT/dq7Ff3OK2ps= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Skeggs , Lyude Paul , Sasha Levin Subject: [PATCH 5.13 093/113] drm/nouveau/disp: power down unused DP links during init Date: Wed, 1 Sep 2021 14:28:48 +0200 Message-Id: <20210901122305.067632064@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210901122301.984263453@linuxfoundation.org> References: <20210901122301.984263453@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ben Skeggs [ Upstream commit 6eaa1f3c59a707332e921e32782ffcad49915c5e ] When booted with multiple displays attached, the EFI GOP driver on (at least) Ampere, can leave DP links powered up that aren't being used to display anything. This confuses our tracking of SOR routing, with the likely result being a failed modeset and display engine hang. Fix this by (ab?)using the DisableLT IED script to power-down the link, restoring HW to a state the driver expects. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h | 1 + drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c index 55fbfe28c6dc..9669472a2749 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c @@ -440,7 +440,7 @@ nvkm_dp_train(struct nvkm_dp *dp, u32 dataKBps) return ret; } -static void +void nvkm_dp_disable(struct nvkm_outp *outp, struct nvkm_ior *ior) { struct nvkm_dp *dp = nvkm_dp(outp); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h index 428b3f488f03..e484d0c3b0d4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h @@ -32,6 +32,7 @@ struct nvkm_dp { int nvkm_dp_new(struct nvkm_disp *, int index, struct dcb_output *, struct nvkm_outp **); +void nvkm_dp_disable(struct nvkm_outp *, struct nvkm_ior *); /* DPCD Receiver Capabilities */ #define DPCD_RC00_DPCD_REV 0x00000 diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c index dffcac249211..129982fef7ef 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c @@ -22,6 +22,7 @@ * Authors: Ben Skeggs */ #include "outp.h" +#include "dp.h" #include "ior.h" #include @@ -257,6 +258,14 @@ nvkm_outp_init_route(struct nvkm_outp *outp) if (!ior->arm.head || ior->arm.proto != proto) { OUTP_DBG(outp, "no heads (%x %d %d)", ior->arm.head, ior->arm.proto, proto); + + /* The EFI GOP driver on Ampere can leave unused DP links routed, + * which we don't expect. The DisableLT IED script *should* get + * us back to where we need to be. + */ + if (ior->func->route.get && !ior->arm.head && outp->info.type == DCB_OUTPUT_DP) + nvkm_dp_disable(outp, ior); + return; } -- 2.30.2