[PATCH] drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure

Myeonghun Pak posted 1 patch 1 month, 3 weeks ago
drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure
Posted by Myeonghun Pak 1 month, 3 weeks ago
The probe path calls drm_panel_add() before mipi_dsi_attach().

If mipi_dsi_attach() fails, the driver returns without calling

drm_panel_remove(), leaving the panel registered in the global DRM
panel list. The driver's .remove() callback does not handle this case
because failed probe does not transition through the normal bound-device
removal path.

Fix this by unwinding drm_panel_add() when mipi_dsi_attach() fails.

Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Co-developed-by: Taegyu Kim <tmk5904@psu.edu>
Signed-off-by: Taegyu Kim <tmk5904@psu.edu>
Co-developed-by: Yuho Choi <dbgh9129@gmail.com>
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
 drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c b/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c
index cbe354b51..4356c07c4 100644
--- a/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c
+++ b/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c
@@ -205,6 +205,7 @@ static int jdi_fhd_r63452_probe(struct mipi_dsi_device *dsi)
 	ret = mipi_dsi_attach(dsi);
 	if (ret < 0) {
 		dev_err(dev, "Failed to attach to DSI host: %d\n", ret);
+		drm_panel_remove(&ctx->panel);
 		return ret;
 	}
 
-- 
2.47.1
Re: [PATCH] drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure
Posted by Dmitry Baryshkov 1 month, 3 weeks ago
On Mon, Apr 20, 2026 at 03:52:15PM +0900, Myeonghun Pak wrote:
> The probe path calls drm_panel_add() before mipi_dsi_attach().
> 
> If mipi_dsi_attach() fails, the driver returns without calling
> 
> drm_panel_remove(), leaving the panel registered in the global DRM
> panel list. The driver's .remove() callback does not handle this case
> because failed probe does not transition through the normal bound-device
> removal path.
> 
> Fix this by unwinding drm_panel_add() when mipi_dsi_attach() fails.
> 
> Co-developed-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Ijae Kim <ae878000@gmail.com>
> Co-developed-by: Taegyu Kim <tmk5904@psu.edu>
> Signed-off-by: Taegyu Kim <tmk5904@psu.edu>
> Co-developed-by: Yuho Choi <dbgh9129@gmail.com>
> Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> ---
>  drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 1 +
>  1 file changed, 1 insertion(+)
> 

Please group similar pathces in a single series. There is
devm_drm_panel_add() in drm-misc-next.

-- 
With best wishes
Dmitry