public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure
@ 2026-04-20  6:52 Myeonghun Pak
  2026-04-22 19:25 ` Dmitry Baryshkov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Myeonghun Pak @ 2026-04-20  6:52 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Myeonghun Pak, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
	linux-kernel, Ijae Kim, Taegyu Kim, Yuho Choi

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure
  2026-04-20  6:52 [PATCH] drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure Myeonghun Pak
@ 2026-04-22 19:25 ` Dmitry Baryshkov
  2026-04-23  0:13 ` Claude review: " Claude Code Review Bot
  2026-04-23  0:13 ` Claude Code Review Bot
  2 siblings, 0 replies; 4+ messages in thread
From: Dmitry Baryshkov @ 2026-04-22 19:25 UTC (permalink / raw)
  To: Myeonghun Pak
  Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
	linux-kernel, Ijae Kim, Taegyu Kim, Yuho Choi

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Claude review: drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure
  2026-04-20  6:52 [PATCH] drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure Myeonghun Pak
  2026-04-22 19:25 ` Dmitry Baryshkov
  2026-04-23  0:13 ` Claude review: " Claude Code Review Bot
@ 2026-04-23  0:13 ` Claude Code Review Bot
  2 siblings, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-04-23  0:13 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure
Author: Myeonghun Pak <mhun512@gmail.com>
Patches: 2
Reviewed: 2026-04-23T10:13:55.634488

---

This is a single, straightforward bugfix patch. The analysis is correct: in `jdi_fhd_r63452_probe()`, `drm_panel_add()` is called at line 203, and if `mipi_dsi_attach()` fails at line 205, the function returns without calling `drm_panel_remove()`, leaving a stale entry in the global panel list. The `.remove()` callback won't run because probe failed. The fix is minimal and correct — adding `drm_panel_remove(&ctx->panel)` in the error path before returning.

**Verdict: The patch looks good and is correct.**

One minor observation: there's no `Fixes:` tag in the commit message, which would typically be expected for a bugfix. The original commit that introduced this driver should be cited. This helps stable-kernel backporting.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Claude review: drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure
  2026-04-20  6:52 [PATCH] drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure Myeonghun Pak
  2026-04-22 19:25 ` Dmitry Baryshkov
@ 2026-04-23  0:13 ` Claude Code Review Bot
  2026-04-23  0:13 ` Claude Code Review Bot
  2 siblings, 0 replies; 4+ messages in thread
From: Claude Code Review Bot @ 2026-04-23  0:13 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Correctness:** The fix is correct. Looking at the probe function:

```c
drm_panel_add(&ctx->panel);          // line 203

ret = mipi_dsi_attach(dsi);          // line 205
if (ret < 0) {
    dev_err(dev, "Failed to attach to DSI host: %d\n", ret);
    return ret;                      // BUG: panel left in global list
}
```

`devm_drm_panel_alloc()` registers a devm action for `drm_panel_put()` but does NOT handle `drm_panel_remove()` — the `drm_panel_add()`/`drm_panel_remove()` lifecycle is the driver's responsibility. The `.remove()` callback at line 214 calls `drm_panel_remove()`, but that path is never taken when probe fails. So the added `drm_panel_remove()` call is the correct fix.

**Commit message:** The commit message clearly explains the problem and solution. However:

- **Missing `Fixes:` tag.** This is a bugfix and should reference the commit that introduced the bug. This is important for stable-kernel backporting. The commit that introduced the driver (or that converted it to `devm_drm_panel_alloc` without adding error-path cleanup) should be cited.

**Style:** The patch is minimal and well-placed — exactly one line in the right location.

**Nit:** The blank line between "If mipi_dsi_attach() fails, the driver returns without calling" and "drm_panel_remove()" in the commit message body (lines 101-102 of the mbox) appears to be an unintentional line break splitting a sentence across paragraphs. It should read as a continuous paragraph.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-23  0:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20  6:52 [PATCH] drm/panel: jdi-fhd-r63452: remove panel on DSI attach failure Myeonghun Pak
2026-04-22 19:25 ` Dmitry Baryshkov
2026-04-23  0:13 ` Claude review: " Claude Code Review Bot
2026-04-23  0:13 ` Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox