Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp875335pxb; Wed, 1 Sep 2021 11:52:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPQibZ0bcFkq8k/GR5XbuFpoZ76Xx6w9csHh0ttb2gAylIsP0DOsYiWQT+VyexJvqcIEWr X-Received: by 2002:a02:708f:: with SMTP id f137mr912076jac.68.1630522322497; Wed, 01 Sep 2021 11:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630522322; cv=none; d=google.com; s=arc-20160816; b=gZ71ONZ9jctnK2nyNp6CdZexk8gtcIOJ6QJF0nYhb93C5y89iGnqXSYsqjQDXZ3V6l k9KOi+Cui7SJlkdjInOcFcoBD/uwCckGXOaLRsjqsuNb2t8jp4ErkflOQPjvNsJYzMDs bH52uIGiud8keD5R8eGUx+JP9Mot0y8OY7VbUIyoMUTVHZQoSlVXEaa6nyiN21EbDYgG JkpFYVkPlD8PR/UxNybCTBGFu45EWhzO09x2KpEYPPMXlUdhdyhzDkmvLPcpPEw9RihJ MhZgaSAoNNrg14eI4sgnBVIbxc/JCYQlEZ6t1rwvH9B36UJARTBo98QfCFeqZKoAtNhk JnIQ== 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=b7vKipdj8QCJ5ansHWgc2D9j33xBeLsQn4Cb9IgR2FE=; b=k8BG46lSFN3fUyj8WyPshFw+hKucjhBN6GK3WtGnuDcLGT3UGskShVRyCeqkqkEwD6 h5RpuLBusWz/IdRXFL7sxDhoejgQxXUTzVksCBPvN4UnwQkuuB3+LvyBYOZlFmRPqaig WVc9UYQII6hP/JRjSqyO56D2XYSth0gLSc0kFlg0pI5rrjOMjBEcrqPcG2wvMWmH8LjB ugqOkc5+O+8G5StRpzSIbfmWVvxojMqfuEJs9/kKCE3Koeke0cwv9VWLGmQeKJWa22rU C2LYSaCCbih6STQzyCH77R3ykFeXoGGzvgdD3T5qNcoQmInIwyVrlAkkp0nBr1tc4GJZ ZyiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jdil7Yg6; 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 l18si325699ilc.72.2021.09.01.11.51.51; Wed, 01 Sep 2021 11:52:02 -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=jdil7Yg6; 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 S244164AbhIAM35 (ORCPT + 99 others); Wed, 1 Sep 2021 08:29:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:59208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244412AbhIAM3b (ORCPT ); Wed, 1 Sep 2021 08:29:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 697C661057; Wed, 1 Sep 2021 12:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630499308; bh=GUAhKHCFaP+aUwqjJMd+rS4ZuoF5FhrPsWfD1Rd+h8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jdil7Yg6b+qg+B32ipuT7OfKmhu0X5QuuUKDu3b7UQ520pgFggOFZtmQMpu1O3kOh 03ZzU9DZB6KOznRx3mJCVihWIXMwgmm1RmfkadyDUwGP1zHjqFG/4TTGrHXt2WPNoZ 2ckfKVCWYZw6d0gcXJ1EQGwLABzAopvZNVhVvuYM= 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 4.14 17/23] drm/nouveau/disp: power down unused DP links during init Date: Wed, 1 Sep 2021 14:27:02 +0200 Message-Id: <20210901122250.343151140@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210901122249.786673285@linuxfoundation.org> References: <20210901122249.786673285@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 5e51a5c1eb01..d11cb1f887f7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c @@ -418,7 +418,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 495f665a0ee6..12d6ff4cfa95 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 bbba77ff9385..81c0f0513c74 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 @@ -207,6 +208,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