From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260320153753.25450-1-l.scorcia@gmail.com> References: <20260320153753.25450-1-l.scorcia@gmail.com> <20260320153753.25450-1-l.scorcia@gmail.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Problem analysis:** Correct. The call chain is: `mipi_dsi_host_register` =E2=86=92 `panel_simple_dsi_probe` =E2=86=92 `mipi= _dsi_attach` =E2=86=92 `mtk_dsi_host_attach` =E2=86=92 `component_add` =E2= =86=92 `mtk_dsi_bind` =E2=86=92 `dev_get_drvdata` (returns NULL) =E2=86=92 = crash in `drm_simple_encoder_init`. **Fix correctness:** 1. **Moving `platform_set_drvdata(pdev, dsi)` before `mipi_dsi_host_registe= r`** =E2=80=94 correct and necessary. This is the core fix. 2. **Moving `init_waitqueue_head(&dsi->irq_wait_queue)` before `mipi_dsi_ho= st_register`** =E2=80=94 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 ini= tialized before any code path could potentially trigger it. While the IRQ i= s requested *after* `mipi_dsi_host_register`, initializing the waitqueue ea= rly is defensive and costs nothing. 3. **Error path consideration:** After this patch, if `mipi_dsi_host_regist= er` fails, `platform_set_drvdata` will have been called but the function re= turns an error and the device will be torn down by devm, so no issue. If `d= evm_request_irq` fails, the existing cleanup (`mipi_dsi_host_unregister`) i= s still correct =E2=80=94 `drvdata` being set is harmless. **No issues found.** The Fixes tag correctly references the commit that int= roduced the regression. The patch is minimal and focused. --- Generated by Claude Code Patch Reviewer