From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795053413; b=5teMFR7r1ZsnnbuxhFIWZVqnyOPWVyDPctKuffM+yvI4jWDnFtI3qE0t+xyOsbyu8BgF IAU8pbfRhJQ8HRpzBValmkfJ2lNAUOOxO7TmYiUDbwsmAk3YmhdZfglJvsPG24E7ArkEb Fx/I5ximC1PP70kQ+NQpnSOC4zJ2w5UY4EvQcAUEUGRNu/sJDqxq3cxFWXCGZ9LYlwfyf 8WxFL4IjKmnXwxHdo9iQzktm8u4RxMKL+h2B6JmwP6vMxaOK20Ovc8XtPwLUi1gs8Lk6J t1U35uEcF2hmpysY1xH3MQLujg7sI/qRaJSadpXEM9gbjzipCzgn3Zi33YS0e3M4AnQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795053413; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=reW0Pbmt6XP+/Sqq3vVNJXGTKPLruXUnE9OGBHOc7lE=; b=O/wTbIUqU4xBr9RCD4C9cTNSQbW9jK2MElj+eD7fKT63C5rH0FsOpdLEgCg+DjHhgOar nJNpp/eCjk0N8zNSCFzho9A0XbJ866EQ2/qzhX6ZQWN0bOX+wn2+5XKJUDxuHAPvC4K2J 6ax/XXXU8qTI5p/9O8FjLTNPg/8K8fmNIZ+VgWoLaypp+nSDJMuHpKy/4vGKy5WhiN+P5 N5fDwTJfaNVaXugPM2TMf6FzjqYh01ogTbQOOZrXH6dqIj3/mEU7y/p7doxTqAN4luxRV XekBgJGwCVrD087EDW29BcTM8SvjsLXNdXwr+y8u4zUj86GmqvDp2fzJ/ev+UJPqRcA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=vQyrULPD; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 357C3606A320; Thu, 19 Nov 2026 01:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=vQyrULPD Received: by smtp.kernel.org (Postfix) with ESMTPSA id 863CB1F000C4; Thu, 19 Nov 2026 01:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795053413; bh=reW0Pbmt6XP+/Sqq3vVNJXGTKPLruXUnE9OGBHOc7lE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vQyrULPD4AZJj7x6QL1TjrzE4cGMcu4anw4WHpPH67Senu2bySEKmK78NQS9FqI+m W/kqLSoRe4G7VTHsYd6+D/M4Yj6pEpx82akYkQqO59FhmiEzpjSzOrztiYjj2xFuQ7 QsLby8ViAxzFlpUXOMt+4i93x2ue8YZQiiUc5p/w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ilia Mirkin , Dave Airlie , Sasha Levin Subject: [PATCH 5.15 0911/2214] drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts Date: Wed, 18 Nov 2026 15:43:07 +0100 Message-ID: <20261118150048.772160149@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150009.797899913@linuxfoundation.org> References: <20261118150009.797899913@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ilia Mirkin [ Upstream commit 2139cb633d48ebbbaec88d2e5a8ebe8e774df4fb ] Turns out some VBIOSes don't actually set the bit in question in 2240c. Use the nv50-style detection to try avoiding running the vbios twice. Fixes: a6a0f67ca7aa ("drm/nouveau/devinit/gf100-: detect if BIOS invoked devinit") Link: https://bugs.freedesktop.org/show_bug.cgi?id=97620 Cc: # v4.6+ Signed-off-by: Ilia Mirkin Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie Link: https://patch.msgid.link/20170128205347.17453-1-imirkin@alum.mit.edu Signed-off-by: Sasha Levin --- .../drm/nouveau/nvkm/subdev/devinit/gf100.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c index 051cfd6a5caf5..f06556412c7bb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c @@ -27,6 +27,7 @@ #include #include #include +#include int gf100_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq) @@ -102,6 +103,25 @@ gf100_devinit_preinit(struct nvkm_devinit *base) * can use it as a reliable way to know whether we should run devinit. */ base->post = ((nvkm_rd32(device, 0x2240c) & BIT(1)) == 0); + + /* + * However some VBIOS init sequences miss this bit. So fall back to + * the nv50 method of checking if the bit is not set. Running the + * VBIOS multiple times may have detrimental effects. + */ + if (base->post) { + u64 disable = nvkm_devinit_disable(base); + /* magic to detect whether or not x86 vbios code has + * executed the devinit scripts to initialise the + * board. only works if there's a display engine. + */ + if (!(disable & (1ULL << NVKM_ENGINE_DISP))) { + if (nvkm_rdvgac(device, 0, 0x00) || + nvkm_rdvgac(device, 0, 0x1a)) { + base->post = false; + } + } + } } static const struct nvkm_devinit_func -- 2.53.0