DISCLOSURE: this report is AI-written and the investigation was done with
the help of AI, I understand some aspects of this but I'm not an expert in
the field, I only have a CS degree. Sorry if this comes out as slop, I'm
trying to help.

Hi,

after a Debian 13 (LMDE 7) laptop updated from kernel 6.12.117 to
6.12.118, it no longer boots: black screen, recovery mode included.
Booting with modprobe.blacklist=nouveau works, and 6.12.117 works.

Hardware:
- Lenovo laptop (PCI subsystem 3f19)
- Intel UHD 620 (WhiskeyLake-U, i915), which drives the panel
- NVIDIA GeForce MX110 at 01:00.0, PCI class "3D controller"
  (no outputs, no legacy VGA)
- nouveau: NVIDIA GM108 (1180e0a2), VBIOS 82.08.77.00.c0, 2048 MiB GDDR5

Kernels (Debian builds of upstream stable):
- good: 6.12.117+deb13-amd64
- bad:  6.12.118+deb13-amd64
- v6.12.119 has the same devinit code (not tested)

Suspected commit:
  3bc8829ce429 ("drm/nouveau/devinit/gf100-: try to avoid double-running
vbios scripts")
  upstream commit 2139cb633d48ebbbaec88d2e5a8ebe8e774df4fb

Reproduction on 6.12.118, booted with nouveau blacklisted, then
loading nouveau by hand:

1) sudo modprobe nouveau modeset=1 runpm=0 config=NvForcePost=1
debug=devinit=debug
   Loads fine:

    nouveau 0000:01:00.0: NVIDIA GM108 (1180e0a2)
    nouveau 0000:01:00.0: bios: version 82.08.77.00.c0
    nouveau 0000:01:00.0: devinit: running init tables
    nouveau 0000:01:00.0: fb: 2048 MiB GDDR5
    nouveau 0000:01:00.0: bus: MMIO read of 00000000 FAULT at 6013d4 [
PRIVRING ]
    nouveau 0000:01:00.0: drm: VRAM: 2048 MiB
    [drm] Initialized nouveau 1.4.0 for 0000:01:00.0 on minor 1
    nouveau 0000:01:00.0: bus: MMIO read of 00000000 FAULT at 619444 [
PRIVRING ]

2) After a reboot:
   sudo modprobe nouveau modeset=1 runpm=0 debug=devinit=debug
   No "running init tables", then the whole machine freezes:

    nouveau 0000:01:00.0: NVIDIA GM108 (1180e0a2)
    nouveau 0000:01:00.0: bios: version 82.08.77.00.c0
    nouveau 0000:01:00.0: fb: -1159778304 MiB GDDR5
    nouveau 0000:01:00.0: bus: MMIO read of 00000000 FAULT at 6013d4 [
PRIVRING ]
    nouveau 0000:01:00.0: bus: MMIO read of 00000000 FAULT at 10f65c [
PRIVRING ]
    nouveau 0000:01:00.0: bus: MMIO read of 00000000 FAULT at 17e280 [
PRIVRING ]
    nouveau 0000:01:00.0: bus: MMIO read of 00000000 FAULT at 17e338 [
PRIVRING ]

   (-1159778304 MiB is 0xbadf3000 as a 32-bit value.)

On 6.12.117 and older kernels, "MMIO read of 00000000 FAULT at 6013d4
[ PRIVRING ]" was already logged regularly, so the VGA CRTC registers
(PRMCIO, e.g. the read in nvkm_lockvgac()) are not accessible on this
GPU.

Analysis (from reading the code, please double-check):
- The GPU is not POSTed at boot, so gf100_devinit_preinit() finds bit 1
  of 0x2240c clear and sets post = true.
- The new fallback then reads VGA CRTC 0x00 and 0x1a through
  nvkm_rdvgac(). On this headless GPU those accesses fault (0x6013d4)
  and return a non-zero error value, so the code concludes the VBIOS
  has already run and sets post = false.
- The VBIOS init tables are therefore skipped, the memory controller
  is left uninitialized (the VRAM size reads back as 0xbadf3000), and
  the machine hangs.
- In the 6.12.y backport, the "only works if there's a display engine"
  guard is dead code: it tests the return value of
  nvkm_devinit_disable(), which always returns 0 in this tree. Mainline
  uses "if (device->disp)" instead. That probably would not save this
  machine either: the display engine does not seem to be disabled here
  (with NvForcePost, nouveau accessed PDISP and faulted at 0x619444),
  so mainline is very likely affected too. I have not tested mainline.

Possible directions: revert the commit from 6.12.y (and possibly
mainline), or only trust the VGA CRTC check when the GPU actually
decodes legacy VGA (VGA-class PCI device) and the reads do not fault.

Workarounds: blacklisting nouveau, or nouveau.config=NvForcePost=1.
NvForcePost only covers the first init; we also used runpm=0 because
the same decision is presumably made again on runtime resume.

I'm happy to test patches.

#regzbot introduced: 3bc8829ce429

Thanks,
Niccolò

Reply via email to