Skip to content

Recover sysfb after DRM probe failure

Zack Rusin amd-gfx dri-devel intel-gfx intel-xe linux-efi linux-fbdev linux-hyperv lkml nouveau virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12video/aperture: Add sysfb restore on DRM probe failuredrivers/firmware/efi/sysfb_efi.c drivers/firmware/sysfb.c drivers/firmware/sysfb_simplefb.c +3 more+201 -760 replies
2/12drm/vmwgfx: Use devm aperture helpers for sysfb restore on probe failuredrivers/gpu/drm/vmwgfx/vmwgfx_drv.c+12 -10 replies
3/12drm/xe: Use devm aperture helpers for sysfb restore on probe failuredrivers/gpu/drm/xe/xe_device.c drivers/gpu/drm/xe/xe_pci.c+13 -10 replies
4/12drm/amdgpu: Use devm aperture helpers for sysfb restore on probe failuredrivers/gpu/drm/amd/amdgpu/amdgpu_device.c drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+14 -20 replies
5/12drm/virtio: Add sysfb restore on probe failuredrivers/gpu/drm/virtio/virtgpu_drv.c+29 -01 reply
6/12drm/nouveau: Use devm aperture helpers for sysfb restore on probe failuredrivers/gpu/drm/nouveau/nouveau_drm.c+14 -20 replies
7/12drm/qxl: Use devm aperture helpers for sysfb restore on probe failuredrivers/gpu/drm/qxl/qxl_drv.c+13 -10 replies
8/12drm/vboxvideo: Use devm aperture helpers for sysfb restore on probe failuredrivers/gpu/drm/vboxvideo/vbox_drv.c+12 -10 replies
9/12drm/hyperv: Add sysfb restore on probe failuredrivers/gpu/drm/hyperv/hyperv_drm_drv.c+23 -00 replies
10/12drm/ast: Use devm aperture helpers for sysfb restore on probe failuredrivers/gpu/drm/ast/ast_drv.c+12 -10 replies
11/12drm/radeon: Use devm aperture helpers for sysfb restore on probe failuredrivers/gpu/drm/radeon/radeon_drv.c+13 -20 replies
12/12drm/i915: Use devm aperture helpers for sysfb restore on probe failuredrivers/gpu/drm/i915/i915_driver.c+12 -10 replies

Reviews trailers per patch

1 of 12 patches has a Reviewed-by or Acked-by.

PatchDmitry Osipenko
1/12
2/12
3/12
4/12
5/12A-b
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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 <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Ce Sun <[email protected]>
Cc Chia-I Wu <[email protected]>
Cc "Christian König" <[email protected]>
Cc Danilo Krummrich <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Deepak Rawat <[email protected]>
Cc Dmitry Osipenko <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Gurchetan Singh <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Hawking Zhang <[email protected]>
Cc Helge Deller <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Javier Martinez Canillas <[email protected]>
Cc Jocelyn Falempe <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Lijo Lazar <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Lyude Paul <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc "Mario Limonciello (AMD)" <[email protected]>
Cc Mario Limonciello <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc Simona Vetter <[email protected]>
Cc "Thomas Hellström" <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc "Timur Kristóf" <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc Vitaly Prosyak <[email protected]>

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(-)
Signature · 1 line
2.48.1