Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp917675pxb; Wed, 1 Sep 2021 12:38:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzmfk9PCL9HW8QQgnMyPu183cfhc22WpnCmMjj7Y1exiTwfcJDz69t7qyBNS4LVHftnVZQ X-Received: by 2002:a05:6e02:156a:: with SMTP id k10mr848250ilu.24.1630525112927; Wed, 01 Sep 2021 12:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630525112; cv=none; d=google.com; s=arc-20160816; b=c3wNOU3jkG8TraIaI8xT8HrPvFCx1boIRXu9ShcoXJ8FyOSBuPNIkcmcrRXqzTT3ha eJfq1TW2FcRFU9F/kR1na0Jl7b4/efc/SoClKKHeB/l1YbMEAEzFihymNjRT4kmDyh9o gNdyzqWeAk3ZwRZpkFcrRS6ZaqSZwHO8WZ/l3dckHHyUcu3Qi6cDVPtZslXU+BKvk4kY 6cTABaB3UQV/ZCtsJA+gzwMyC6h9RikagXFsKx1vLbCpKIAURUzE5SgZQN/jwFa9SOvi 5fZwJFAVjCJcUFSGyeW9NXpMlcRYxO3jq0p2HB/tg0hMrl3GGk0t+buoVCKcYHJ5gUj0 JIxg== 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=chi1J2nwhoZYVUYfFlePx3P3HXLF/Kq3giHM/shEn9w=; b=C+A8M3NwTEK8qjBrocwxZ9MqhuNp/KpRt+zgm+7SFrTIveS8U8LSkZmUQyVr0degyu VLa5k+gOt1kkelsK7qEXawz5sZZTJr/69JDZ9RG9sKSgKaEPRCKbaR+8NzaFmDm6xhSP X8OYGBnfN3Es1nymIEIZfeZtxdpmft2JCRI9zbk538VYKI+vcg2R6c5xrsgb+i1bw0Uc X8kcQVG6dumG+4JHxzjEUir5shouDz+XioR+sznk5pRbBtUE5Sgiq/ohtPAjbMDFzdtE wZSB9+wb6spK3RTToP0pZdJyYuK8PTiR4lRlJfyv9chkRrXzT4Hv1cqIpBD+WNhUA7TU IM6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vwWRlvUh; 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 q14si535129ilo.128.2021.09.01.12.38.19; Wed, 01 Sep 2021 12:38:32 -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=vwWRlvUh; 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 S1344365AbhIAMpg (ORCPT + 99 others); Wed, 1 Sep 2021 08:45:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:42970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345095AbhIAMko (ORCPT ); Wed, 1 Sep 2021 08:40:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9BE2561100; Wed, 1 Sep 2021 12:36:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630499820; bh=vnPqbr+xlZk1FuW1/mSsJ3hRghBhnkIStU/5Cl7ncv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vwWRlvUhYyW7O9r0/0hylMW9WoZRMFhbFFF6s6LvwCj0a+buOM+PyZ+iJlWtty9lP X6VDPGTayruFEqPo5pXl5hf7y/NkYmydLmKdpr81+9xYFdBgEurYTVz1vzOy1T8oYu G9+/i9PZPwmCuGmBiTxbi482plw3bcK7sDrUPNvg= 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.10 068/103] drm/nouveau/disp: power down unused DP links during init Date: Wed, 1 Sep 2021 14:28:18 +0200 Message-Id: <20210901122302.859384711@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210901122300.503008474@linuxfoundation.org> References: <20210901122300.503008474@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 3800aeb507d0..2a7b8bc3ec4d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c @@ -419,7 +419,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