From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/bridge: samsung-dsim: use DSIM interrupt to wait for PLL stability
Date: Wed, 25 Mar 2026 08:14:57 +1000 [thread overview]
Message-ID: <review-patch2-20260322-exynos-dsim-fixes-v2-2-0069c9e1d9bf@disroot.org> (raw)
In-Reply-To: <20260322-exynos-dsim-fixes-v2-2-0069c9e1d9bf@disroot.org>
Patch Review
**Verdict: Has bugs that need fixing.**
**Bug 1 (Critical): Inverted `wait_for_completion_timeout` check**
At lines 868-871 of the patched file:
```c
if (wait_for_completion_timeout(&dsi->pll_stabilized,
usecs_to_jiffies(timeout))) {
dev_err(dsi->dev, "PLL failed to stabilize\n");
return 0;
}
```
`wait_for_completion_timeout()` returns **0 on timeout** and **>0 on success**. The condition is inverted — the error path runs on success, and the success path runs on timeout. This should be:
```c
if (!wait_for_completion_timeout(...)) {
```
**Bug 2 (Critical): PLL_STABLE interrupt is masked**
Looking at the interrupt handler at line 1596-1602, after `DSIM_INT_SW_RST_RELEASE`, the interrupt mask is set to block everything except `DSIM_INT_RX_DONE`, `DSIM_INT_SFR_FIFO_EMPTY`, `DSIM_INT_SFR_HDR_FIFO_EMPTY`, `DSIM_INT_RX_ECC_ERR`, and `DSIM_INT_SW_RST_RELEASE`. Notably, `DSIM_INT_PLL_STABLE` is **not** in this unmasked set — it remains masked. This means the PLL_STABLE interrupt will never be delivered after reset, and `wait_for_completion_timeout` will always time out.
The mask at line 1597 needs to also include `DSIM_INT_PLL_STABLE`:
```c
unsigned long mask = ~(DSIM_INT_RX_DONE |
DSIM_INT_SFR_FIFO_EMPTY |
DSIM_INT_SFR_HDR_FIFO_EMPTY |
DSIM_INT_RX_ECC_ERR |
DSIM_INT_SW_RST_RELEASE |
DSIM_INT_PLL_STABLE);
```
(Note: since bug 1 inverts the sense, on current hardware these two bugs may accidentally cancel out — the masked interrupt causes a timeout, which the inverted check treats as success. But that's fragile and wrong.)
**Minor: Typo in comment**
Line 855: `Calcutate` should be `Calculate`.
**Minor: Assumption about clk_data[0] being bus clock**
The comment says "It is assumed that the bus clock is the first clock in the provided bulk clock data." This holds for all current variants (exynos3 has `bus_clk`, exynos4 has `bus_clk`, exynos5433 has `bus_clk`, exynos7870 has `bus`), but for the IMX variants the first clock is also `bus_clk`. Still, this is fragile — if a future driver data entry reorders clocks, this silently breaks. Consider whether a named lookup would be more robust, though this is a minor concern.
**Minor: `usecs_to_jiffies` with small values**
With a typical HZ=250, `usecs_to_jiffies(100)` returns 1 jiffy (4ms), which is already much larger than 100µs. The "gracious lower bound of 100 microseconds" described in the commit message is somewhat misleading since the actual wait granularity is jiffies. This isn't a bug but worth being aware of.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-24 22:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-22 17:02 [PATCH RESEND v2 0/2] Fixes and enhancements for Exynos (7870) DSIM bridge driver Kaustabh Chakraborty
2026-03-22 17:02 ` [PATCH RESEND v2 1/2] drm/bridge: samsung-dsim: enable MFLUSH_VS for Exynos 7870 DSIM Kaustabh Chakraborty
2026-03-24 22:14 ` Claude review: " Claude Code Review Bot
2026-03-22 17:02 ` [PATCH RESEND v2 2/2] drm/bridge: samsung-dsim: use DSIM interrupt to wait for PLL stability Kaustabh Chakraborty
2026-03-24 22:14 ` Claude Code Review Bot [this message]
2026-03-24 22:14 ` Claude review: Fixes and enhancements for Exynos (7870) DSIM bridge driver 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-patch2-20260322-exynos-dsim-fixes-v2-2-0069c9e1d9bf@disroot.org \
--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