[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251229215906.3688205-12-zack.rusin@broadcom.com>
Date: Mon, 29 Dec 2025 16:58:17 -0500
From: Zack Rusin <zack.rusin@...adcom.com>
To: dri-devel@...ts.freedesktop.org
Cc: Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
amd-gfx@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 11/12] drm/radeon: Use devm aperture helpers for sysfb restore on probe failure
Use devm_aperture_remove_conflicting_pci_devices() instead of the
non-devm variant to automatically restore the system framebuffer
(efifb/simpledrm) if the driver's probe fails after removing the
firmware framebuffer.
Call devm_aperture_remove_conflicting_pci_devices_done() after
successful probe to cancel the automatic restore, as the driver
is now responsible for display output.
This ensures users don't lose display output if the radeon driver
fails to probe after removing the firmware framebuffer.
Signed-off-by: Zack Rusin <zack.rusin@...adcom.com>
Cc: Alex Deucher <alexander.deucher@....com>
Cc: "Christian König" <christian.koenig@....com>
Cc: David Airlie <airlied@...il.com>
Cc: Simona Vetter <simona@...ll.ch>
Cc: amd-gfx@...ts.freedesktop.org
Cc: dri-devel@...ts.freedesktop.org
Cc: linux-kernel@...r.kernel.org
---
drivers/gpu/drm/radeon/radeon_drv.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 87fd6255c114..225f716d5db9 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -324,8 +324,13 @@ static int radeon_pci_probe(struct pci_dev *pdev,
if (vga_switcheroo_client_probe_defer(pdev))
return -EPROBE_DEFER;
- /* Get rid of things like offb */
- ret = aperture_remove_conflicting_pci_devices(pdev, kms_driver.name);
+ /*
+ * Get rid of things like offb. Use devm variant to automatically
+ * restore sysfb if probe fails. This ensures the user doesn't lose
+ * display if our probe fails after removing the firmware framebuffer
+ * (efifb/simpledrm).
+ */
+ ret = devm_aperture_remove_conflicting_pci_devices(pdev, kms_driver.name);
if (ret)
return ret;
@@ -361,6 +366,12 @@ static int radeon_pci_probe(struct pci_dev *pdev,
drm_client_setup(ddev, format);
+ /*
+ * Probe succeeded - cancel the automatic sysfb restore action.
+ * We're now responsible for display output.
+ */
+ devm_aperture_remove_conflicting_pci_devices_done(pdev);
+
return 0;
err:
--
2.48.1
Powered by blists - more mailing lists