From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/mediatek: dsi: Store driver data before invoking mipi_dsi_host_register
Date: Sun, 22 Mar 2026 03:36:31 +1000 [thread overview]
Message-ID: <review-patch1-20260320153753.25450-1-l.scorcia@gmail.com> (raw)
In-Reply-To: <20260320153753.25450-1-l.scorcia@gmail.com>
Patch Review
**Problem analysis:** Correct. The call chain is:
`mipi_dsi_host_register` → `panel_simple_dsi_probe` → `mipi_dsi_attach` → `mtk_dsi_host_attach` → `component_add` → `mtk_dsi_bind` → `dev_get_drvdata` (returns NULL) → crash in `drm_simple_encoder_init`.
**Fix correctness:**
1. **Moving `platform_set_drvdata(pdev, dsi)` before `mipi_dsi_host_register`** — correct and necessary. This is the core fix.
2. **Moving `init_waitqueue_head(&dsi->irq_wait_queue)` before `mipi_dsi_host_register`** — also correct. Since the bind path can now execute during `mipi_dsi_host_register`, and the IRQ handler (`mtk_dsi_irq`) uses `dsi->irq_wait_queue` via `wake_up_interruptible`, the waitqueue must be initialized before any code path could potentially trigger it. While the IRQ is requested *after* `mipi_dsi_host_register`, initializing the waitqueue early is defensive and costs nothing.
3. **Error path consideration:** After this patch, if `mipi_dsi_host_register` fails, `platform_set_drvdata` will have been called but the function returns an error and the device will be torn down by devm, so no issue. If `devm_request_irq` fails, the existing cleanup (`mipi_dsi_host_unregister`) is still correct — `drvdata` being set is harmless.
**No issues found.** The Fixes tag correctly references the commit that introduced the regression. The patch is minimal and focused.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-21 17:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 15:37 [PATCH v3 RESEND] drm/mediatek: dsi: Store driver data before invoking mipi_dsi_host_register Luca Leonardo Scorcia
2026-03-21 17:36 ` Claude review: " Claude Code Review Bot
2026-03-21 17:36 ` Claude Code Review Bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-02-25 9:38 [PATCH v3] " Luca Leonardo Scorcia
2026-02-27 3:42 ` Claude review: " Claude Code Review Bot
2026-02-27 3:42 ` Claude Code Review Bot
2026-02-23 14:16 [PATCH v2] " Luca Leonardo Scorcia
2026-02-24 0:09 ` Claude review: " Claude Code Review Bot
2026-02-24 0:09 ` Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch1-20260320153753.25450-1-l.scorcia@gmail.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox