Skip to contentSkip to conversation

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

PATCH In review Myeonghun Pak 2 participants 3 messages Apr 20 – Apr 24

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

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.

---
 drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c +1 -0
index cbe354b51..4356c07c4 100644
@@ -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;
 	}
 
Signature · 1 line
2.47.1
#1 lore raw
Quoted 18 lines · Myeonghun Pak

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.

Quoted 4 lines
---
 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.

Signature · 2 lines
With best wishes
Dmitry
#2 lore raw

Dmitry,

Thank you for the review.

As you pointed out, I will group the similar patches into a single series for submission.

I also agree that using devm_drm_panel_add() is a better approach for cleaning up the code. I will re-work the next version to apply this managed resource API.

Thanks,

Myeonghun Pak

2026년 4월 23일 (목) 오전 4:25, Dmitry Baryshkov <
[email protected]>님이 작성:

Quoted 31 lines · Myeonghun Pak
Quoted 18 lines

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.

Quoted 4 lines
---
 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