[PATCH 00/12] Recover sysfb after DRM probe failure

From: Zack Rusin
Date: Mon Dec 29 2025 - 17:05:25 EST


Almost a rite of passage for every DRM developer and most Linux users
is upgrading your DRM driver/updating boot flags/changing some config
and having DRM driver fail at probe resulting in a blank screen.

Currently there's no way to recover from DRM driver probe failure. PCI
DRM driver explicitly throw out the existing sysfb to get exclusive
access to PCI resources so if the probe fails the system is left without
a functioning display driver.

Add code to sysfb to recever system framebuffer when DRM driver's probe
fails. This means that a DRM driver that fails to load reloads the system
framebuffer driver.

This works best with simpledrm. Without it Xorg won't recover because
it still tries to load the vendor specific driver which ends up usually
not working at all. With simpledrm the system recovers really nicely
ending up with a working console and not a blank screen.

There's a caveat in that some hardware might require some special magic
register write to recover EFI display. I'd appreciate it a lot if
maintainers could introduce a temporary failure in their drivers
probe to validate that the sysfb recovers and they get a working console.
The easiest way to double check it is by adding:
/* XXX: Temporary failure to test sysfb restore - REMOVE BEFORE COMMIT */
dev_info(&pdev->dev, "Testing sysfb restore: forcing probe failure\n");
ret = -EINVAL;
goto out_error;
or such right after the devm_aperture_remove_conflicting_pci_devices .

Cc: Alex Deucher <alexander.deucher@xxxxxxx>
Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: Ard Biesheuvel <ardb@xxxxxxxxxx>
Cc: Ce Sun <cesun102@xxxxxxx>
Cc: Chia-I Wu <olvaffe@xxxxxxxxx>
Cc: "Christian König" <christian.koenig@xxxxxxx>
Cc: Danilo Krummrich <dakr@xxxxxxxxxx>
Cc: Dave Airlie <airlied@xxxxxxxxxx>
Cc: Deepak Rawat <drawat.floss@xxxxxxxxx>
Cc: Dmitry Osipenko <dmitry.osipenko@xxxxxxxxxxxxx>
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
Cc: Gerd Hoffmann <kraxel@xxxxxxxxxx>
Cc: Gurchetan Singh <gurchetansingh@xxxxxxxxxxxx>
Cc: Hans de Goede <hansg@xxxxxxxxxx>
Cc: Hawking Zhang <Hawking.Zhang@xxxxxxx>
Cc: Helge Deller <deller@xxxxxx>
Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: intel-xe@xxxxxxxxxxxxxxxxxxxxx
Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
Cc: Javier Martinez Canillas <javierm@xxxxxxxxxx>
Cc: Jocelyn Falempe <jfalempe@xxxxxxxxxx>
Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
Cc: Lijo Lazar <lijo.lazar@xxxxxxx>
Cc: linux-efi@xxxxxxxxxxxxxxx
Cc: linux-fbdev@xxxxxxxxxxxxxxx
Cc: linux-hyperv@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: Lucas De Marchi <lucas.demarchi@xxxxxxxxx>
Cc: Lyude Paul <lyude@xxxxxxxxxx>
Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
Cc: "Mario Limonciello (AMD)" <superm1@xxxxxxxxxx>
Cc: Mario Limonciello <mario.limonciello@xxxxxxx>
Cc: Maxime Ripard <mripard@xxxxxxxxxx>
Cc: nouveau@xxxxxxxxxxxxxxxxxxxxx
Cc: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
Cc: Simona Vetter <simona@xxxxxxxx>
Cc: spice-devel@xxxxxxxxxxxxxxxxxxxxx
Cc: "Thomas Hellström" <thomas.hellstrom@xxxxxxxxxxxxxxx>
Cc: Thomas Zimmermann <tzimmermann@xxxxxxx>
Cc: "Timur Kristóf" <timur.kristof@xxxxxxxxx>
Cc: Tvrtko Ursulin <tursulin@xxxxxxxxxxx>
Cc: virtualization@xxxxxxxxxxxxxxx
Cc: Vitaly Prosyak <vitaly.prosyak@xxxxxxx>

Zack Rusin (12):
video/aperture: Add sysfb restore on DRM probe failure
drm/vmwgfx: Use devm aperture helpers for sysfb restore on probe
failure
drm/xe: Use devm aperture helpers for sysfb restore on probe failure
drm/amdgpu: Use devm aperture helpers for sysfb restore on probe
failure
drm/virtio: Add sysfb restore on probe failure
drm/nouveau: Use devm aperture helpers for sysfb restore on probe
failure
drm/qxl: Use devm aperture helpers for sysfb restore on probe failure
drm/vboxvideo: Use devm aperture helpers for sysfb restore on probe
failure
drm/hyperv: Add sysfb restore on probe failure
drm/ast: Use devm aperture helpers for sysfb restore on probe failure
drm/radeon: Use devm aperture helpers for sysfb restore on probe
failure
drm/i915: Use devm aperture helpers for sysfb restore on probe failure

drivers/firmware/efi/sysfb_efi.c | 2 +-
drivers/firmware/sysfb.c | 191 +++++++++++++--------
drivers/firmware/sysfb_simplefb.c | 10 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 +
drivers/gpu/drm/ast/ast_drv.c | 13 +-
drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 23 +++
drivers/gpu/drm/i915/i915_driver.c | 13 +-
drivers/gpu/drm/nouveau/nouveau_drm.c | 16 +-
drivers/gpu/drm/qxl/qxl_drv.c | 14 +-
drivers/gpu/drm/radeon/radeon_drv.c | 15 +-
drivers/gpu/drm/vboxvideo/vbox_drv.c | 13 +-
drivers/gpu/drm/virtio/virtgpu_drv.c | 29 ++++
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 13 +-
drivers/gpu/drm/xe/xe_device.c | 7 +-
drivers/gpu/drm/xe/xe_pci.c | 7 +
drivers/video/aperture.c | 54 ++++++
include/linux/aperture.h | 14 ++
include/linux/sysfb.h | 6 +
19 files changed, 368 insertions(+), 88 deletions(-)

--
2.48.1