All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau/devinit/gf100-: fix POST being skipped on GPUs without display
@ 2026-11-24 21:34 ` Francesco Magazzu
  0 siblings, 0 replies; 4+ messages in thread
From: Francesco Magazzu @ 2026-11-24 21:34 UTC (permalink / raw)
  To: Lyude Paul, Danilo Krummrich
  Cc: David Airlie, Simona Vetter, Ilia Mirkin, dri-devel, nouveau,
	linux-kernel, regressions, stable

Commit 2139cb633d48 ("drm/nouveau/devinit/gf100-: try to avoid
double-running vbios scripts") skips devinit if VGA CRTC register 0x00
or 0x1a is non-zero, unless the display engine is disabled.  It detects
the latter from the return value of nvkm_devinit_disable(), which is
always 0: the strapped-off engines are removed with
nvkm_subdev_disable() instead.  So the VGA registers are always read.

On a GM108 (GeForce 940MX: no display engine, not POSTed by the
firmware) those reads fault and return 0x13.  devinit is skipped, the
GPU is used uninitialised and the machine panics at boot:

  nouveau 0000:01:00.0: fifo: fault 01 [WRITE] at 00000000001a1000 engine 05 [BAR2] client 08 [HUB/HOST_CPU_NB] reason 04 [UNBOUND_INST_BLOCK] on channel -1
  mce: CPUs not responding to MCE broadcast (may include false positives): 1,3
  Kernel panic - not syncing: Timeout: Not all CPUs entered broadcast exception handler

Check device->disp instead, once nvkm_devinit_disable() has removed the
disabled engines, like nv50_devinit_preinit() does.

Fixes: 2139cb633d48 ("drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Francesco Magazzu <postadelmaga@gmail.com>
---

Notes:
    v7.3.4 boots on this machine; v7.3.5, which has the stable backport
    (992f7f5f34f8), panics.  Tested on v7.3.5: with this patch the GM108 is
    POSTed again at probe and on runtime resume.  Not tested on a board
    that has a display engine.
    
    Read at preinit on this board: 0x2240c = 0x00000000, CR00 = CR1A = 0x13,
    0x021c04 = 0x00000001 (display strapped off).
    
    The regression was analysed and the patch drafted with an AI coding
    assistant (Claude Code); I tested it on the hardware above.

 drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
index 186e09ea0c..b256404c24 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
@@ -107,12 +107,12 @@ gf100_devinit_preinit(struct nvkm_devinit *base)
 	 * VBIOS multiple times may have detrimental effects.
 	 */
 	if (base->post) {
-		u64 disable = nvkm_devinit_disable(base);
+		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 (device->disp) {
 			if (nvkm_rdvgac(device, 0, 0x00) ||
 			    nvkm_rdvgac(device, 0, 0x1a)) {
 				base->post = false;

base-commit: 8d7fe9885c62fc9a95bf55d9db244d9672a8aadc
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] drm/nouveau/devinit/gf100-: fix POST being skipped on GPUs without display
@ 2026-11-24 21:34 ` Francesco Magazzu
  0 siblings, 0 replies; 4+ messages in thread
From: Francesco Magazzu @ 2026-11-24 21:34 UTC (permalink / raw)
  To: Lyude Paul, Danilo Krummrich
  Cc: Simona Vetter, dri-devel, nouveau, linux-kernel, regressions,
	stable

Commit 2139cb633d48 ("drm/nouveau/devinit/gf100-: try to avoid
double-running vbios scripts") skips devinit if VGA CRTC register 0x00
or 0x1a is non-zero, unless the display engine is disabled.  It detects
the latter from the return value of nvkm_devinit_disable(), which is
always 0: the strapped-off engines are removed with
nvkm_subdev_disable() instead.  So the VGA registers are always read.

On a GM108 (GeForce 940MX: no display engine, not POSTed by the
firmware) those reads fault and return 0x13.  devinit is skipped, the
GPU is used uninitialised and the machine panics at boot:

  nouveau 0000:01:00.0: fifo: fault 01 [WRITE] at 00000000001a1000 engine 05 [BAR2] client 08 [HUB/HOST_CPU_NB] reason 04 [UNBOUND_INST_BLOCK] on channel -1
  mce: CPUs not responding to MCE broadcast (may include false positives): 1,3
  Kernel panic - not syncing: Timeout: Not all CPUs entered broadcast exception handler

Check device->disp instead, once nvkm_devinit_disable() has removed the
disabled engines, like nv50_devinit_preinit() does.

Fixes: 2139cb633d48 ("drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Francesco Magazzu <postadelmaga@gmail.com>
---

Notes:
    v7.3.4 boots on this machine; v7.3.5, which has the stable backport
    (992f7f5f34f8), panics.  Tested on v7.3.5: with this patch the GM108 is
    POSTed again at probe and on runtime resume.  Not tested on a board
    that has a display engine.
    
    Read at preinit on this board: 0x2240c = 0x00000000, CR00 = CR1A = 0x13,
    0x021c04 = 0x00000001 (display strapped off).
    
    The regression was analysed and the patch drafted with an AI coding
    assistant (Claude Code); I tested it on the hardware above.

 drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
index 186e09ea0c..b256404c24 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
@@ -107,12 +107,12 @@ gf100_devinit_preinit(struct nvkm_devinit *base)
 	 * VBIOS multiple times may have detrimental effects.
 	 */
 	if (base->post) {
-		u64 disable = nvkm_devinit_disable(base);
+		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 (device->disp) {
 			if (nvkm_rdvgac(device, 0, 0x00) ||
 			    nvkm_rdvgac(device, 0, 0x1a)) {
 				base->post = false;

base-commit: 8d7fe9885c62fc9a95bf55d9db244d9672a8aadc
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/nouveau/devinit/gf100-: fix POST being skipped on GPUs without display
  2026-11-24 21:34 ` Francesco Magazzu
@ 2026-11-25  6:18   ` Thorsten Leemhuis
  -1 siblings, 0 replies; 4+ messages in thread
From: Thorsten Leemhuis @ 2026-11-25  6:18 UTC (permalink / raw)
  To: Francesco Magazzu, Lyude Paul, Danilo Krummrich
  Cc: David Airlie, Simona Vetter, Ilia Mirkin, dri-devel, nouveau,
	linux-kernel, regressions, stable

On 11/24/26 22:34, Francesco Magazzu wrote:
> Commit 2139cb633d48 ("drm/nouveau/devinit/gf100-: try to avoid
> double-running vbios scripts") skips devinit if VGA CRTC register 0x00
> or 0x1a is non-zero, unless the display engine is disabled.  It detects
> the latter from the return value of nvkm_devinit_disable(), which is
> always 0: the strapped-off engines are removed with
> nvkm_subdev_disable() instead.  So the VGA registers are always read.

thx; Dave, who applied the culprit, two days ago sent a patch that from
a quick looks does exactly the same:

https://lore.kernel.org/all/20261123-nouveau-fix-disp-v1-1-ebdc525287ce@redhat.com/

Ciao, Thorsten
> On a GM108 (GeForce 940MX: no display engine, not POSTed by the
> firmware) those reads fault and return 0x13.  devinit is skipped, the
> GPU is used uninitialised and the machine panics at boot:
> 
>   nouveau 0000:01:00.0: fifo: fault 01 [WRITE] at 00000000001a1000 engine 05 [BAR2] client 08 [HUB/HOST_CPU_NB] reason 04 [UNBOUND_INST_BLOCK] on channel -1
>   mce: CPUs not responding to MCE broadcast (may include false positives): 1,3
>   Kernel panic - not syncing: Timeout: Not all CPUs entered broadcast exception handler
> 
> Check device->disp instead, once nvkm_devinit_disable() has removed the
> disabled engines, like nv50_devinit_preinit() does.
> 
> Fixes: 2139cb633d48 ("drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts")
> Cc: stable@vger.kernel.org
> Assisted-by: Claude:claude-fable-5-2
> Signed-off-by: Francesco Magazzu <postadelmaga@gmail.com>
> ---
> 
> Notes:
>     v7.3.4 boots on this machine; v7.3.5, which has the stable backport
>     (992f7f5f34f8), panics.  Tested on v7.3.5: with this patch the GM108 is
>     POSTed again at probe and on runtime resume.  Not tested on a board
>     that has a display engine.
>     
>     Read at preinit on this board: 0x2240c = 0x00000000, CR00 = CR1A = 0x13,
>     0x021c04 = 0x00000001 (display strapped off).
>     
>     The regression was analysed and the patch drafted with an AI coding
>     assistant (Claude Code); I tested it on the hardware above.
> 
>  drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
> index 186e09ea0c..b256404c24 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
> @@ -107,12 +107,12 @@ gf100_devinit_preinit(struct nvkm_devinit *base)
>  	 * VBIOS multiple times may have detrimental effects.
>  	 */
>  	if (base->post) {
> -		u64 disable = nvkm_devinit_disable(base);
> +		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 (device->disp) {
>  			if (nvkm_rdvgac(device, 0, 0x00) ||
>  			    nvkm_rdvgac(device, 0, 0x1a)) {
>  				base->post = false;
> 
> base-commit: 8d7fe9885c62fc9a95bf55d9db244d9672a8aadc


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/nouveau/devinit/gf100-: fix POST being skipped on GPUs without display
@ 2026-11-25  6:18   ` Thorsten Leemhuis
  0 siblings, 0 replies; 4+ messages in thread
From: Thorsten Leemhuis @ 2026-11-25  6:18 UTC (permalink / raw)
  To: Francesco Magazzu, Lyude Paul, Danilo Krummrich
  Cc: Simona Vetter, dri-devel, nouveau, linux-kernel, regressions,
	stable

On 11/24/26 22:34, Francesco Magazzu wrote:
> Commit 2139cb633d48 ("drm/nouveau/devinit/gf100-: try to avoid
> double-running vbios scripts") skips devinit if VGA CRTC register 0x00
> or 0x1a is non-zero, unless the display engine is disabled.  It detects
> the latter from the return value of nvkm_devinit_disable(), which is
> always 0: the strapped-off engines are removed with
> nvkm_subdev_disable() instead.  So the VGA registers are always read.

thx; Dave, who applied the culprit, two days ago sent a patch that from
a quick looks does exactly the same:

https://lore.kernel.org/all/20261123-nouveau-fix-disp-v1-1-ebdc525287ce@redhat.com/

Ciao, Thorsten
> On a GM108 (GeForce 940MX: no display engine, not POSTed by the
> firmware) those reads fault and return 0x13.  devinit is skipped, the
> GPU is used uninitialised and the machine panics at boot:
> 
>   nouveau 0000:01:00.0: fifo: fault 01 [WRITE] at 00000000001a1000 engine 05 [BAR2] client 08 [HUB/HOST_CPU_NB] reason 04 [UNBOUND_INST_BLOCK] on channel -1
>   mce: CPUs not responding to MCE broadcast (may include false positives): 1,3
>   Kernel panic - not syncing: Timeout: Not all CPUs entered broadcast exception handler
> 
> Check device->disp instead, once nvkm_devinit_disable() has removed the
> disabled engines, like nv50_devinit_preinit() does.
> 
> Fixes: 2139cb633d48 ("drm/nouveau/devinit/gf100-: try to avoid double-running vbios scripts")
> Cc: stable@vger.kernel.org
> Assisted-by: Claude:claude-fable-5-2
> Signed-off-by: Francesco Magazzu <postadelmaga@gmail.com>
> ---
> 
> Notes:
>     v7.3.4 boots on this machine; v7.3.5, which has the stable backport
>     (992f7f5f34f8), panics.  Tested on v7.3.5: with this patch the GM108 is
>     POSTed again at probe and on runtime resume.  Not tested on a board
>     that has a display engine.
>     
>     Read at preinit on this board: 0x2240c = 0x00000000, CR00 = CR1A = 0x13,
>     0x021c04 = 0x00000001 (display strapped off).
>     
>     The regression was analysed and the patch drafted with an AI coding
>     assistant (Claude Code); I tested it on the hardware above.
> 
>  drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
> index 186e09ea0c..b256404c24 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
> @@ -107,12 +107,12 @@ gf100_devinit_preinit(struct nvkm_devinit *base)
>  	 * VBIOS multiple times may have detrimental effects.
>  	 */
>  	if (base->post) {
> -		u64 disable = nvkm_devinit_disable(base);
> +		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 (device->disp) {
>  			if (nvkm_rdvgac(device, 0, 0x00) ||
>  			    nvkm_rdvgac(device, 0, 0x1a)) {
>  				base->post = false;
> 
> base-commit: 8d7fe9885c62fc9a95bf55d9db244d9672a8aadc


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-25  6:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 21:34 [PATCH] drm/nouveau/devinit/gf100-: fix POST being skipped on GPUs without display Francesco Magazzu
2026-11-24 21:34 ` Francesco Magazzu
2026-11-25  6:18 ` Thorsten Leemhuis
2026-11-25  6:18   ` Thorsten Leemhuis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.