From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/rockchip: vop2: Use vop2->old_layer_sel directly in wait_for_layer_cfg_done()
Date: Tue, 05 May 2026 08:08:46 +1000 [thread overview]
Message-ID: <review-patch5-20260504-vop2-layer-cfg-tmout-v1-5-730226a7331e@collabora.com> (raw)
In-Reply-To: <20260504-vop2-layer-cfg-tmout-v1-5-730226a7331e@collabora.com>
Patch Review
**Verdict: Correct but has a subtle consideration.**
This removes the `cfg` parameter from `rk3568_vop2_wait_for_layer_cfg_done()` since the only caller always passes `vop2->old_layer_sel`.
```diff
-static void rk3568_vop2_wait_for_layer_cfg_done(struct vop2 *vop2, u32 cfg)
+static void rk3568_vop2_wait_for_layer_cfg_done(struct vop2 *vop2)
```
And inside:
```diff
- atv_layer_cfg == cfg, 10, 50 * 1000);
+ atv_layer_cfg == vop2->old_layer_sel, 10, 50 * 1000);
```
**Minor concern**: `readx_poll_timeout_atomic` re-evaluates the condition expression on each poll iteration. With the parameter version, the target value `cfg` was a stack copy captured before the loop started. With the new version, `vop2->old_layer_sel` is read from the struct on every poll iteration. If another thread (another VP's atomic commit) were to concurrently modify `vop2->old_layer_sel` while this spin is running, the target would shift mid-poll.
In practice, this is likely safe because:
- The function runs under `vop2->ovl_lock` mutex, and all paths that write `vop2->old_layer_sel` (after patch 3) also hold that mutex.
- So no concurrent writer should be able to change the value during the spin.
But this is worth noting — the parameter version was inherently immune to this class of bug, while the new version relies on the caller holding the mutex. If a future code path ever calls this function or modifies `old_layer_sel` without the lock, it would introduce a subtle bug. This is a reasonable tradeoff for code simplicity, but it might be worth a brief comment, or the maintainer may prefer keeping the parameter for robustness.
This is a style/maintainability judgment call rather than a correctness bug.
---
**Summary**: The series is well-crafted. Patches 1 and 2 are clear, correct bug fixes suitable for stable backport. Patches 3-5 are clean follow-up refactors. The only point worth discussing with the author is whether patch 5's removal of the explicit parameter is worth the implicit coupling to the mutex contract — but it's defensible either way.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-04 22:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 18:23 [PATCH 0/5] drm/rockchip: vop2: Fix layer cfg done timeout on multi-output setups Cristian Ciocaltea
2026-05-04 18:23 ` [PATCH 1/5] drm/rockchip: vop2: Fix wrong wait target in layer cfg done check Cristian Ciocaltea
2026-05-04 22:08 ` Claude review: " Claude Code Review Bot
2026-05-04 18:24 ` [PATCH 2/5] drm/rockchip: vop2: Wait for layer cfg done before switching LAYERSEL_REGDONE_SEL Cristian Ciocaltea
2026-05-04 22:08 ` Claude review: " Claude Code Review Bot
2026-05-04 18:24 ` [PATCH 3/5] drm/rockchip: vop2: Delay old_{layer|port}_sel updates in setup_layer_mixer() Cristian Ciocaltea
2026-05-04 22:08 ` Claude review: " Claude Code Review Bot
2026-05-04 18:24 ` [PATCH 4/5] drm/rockchip: vop2: Drop redundant zero-init " Cristian Ciocaltea
2026-05-04 22:08 ` Claude review: " Claude Code Review Bot
2026-05-04 18:24 ` [PATCH 5/5] drm/rockchip: vop2: Use vop2->old_layer_sel directly in wait_for_layer_cfg_done() Cristian Ciocaltea
2026-05-04 22:08 ` Claude Code Review Bot [this message]
2026-05-04 22:08 ` Claude review: drm/rockchip: vop2: Fix layer cfg done timeout on multi-output setups 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-patch5-20260504-vop2-layer-cfg-tmout-v1-5-730226a7331e@collabora.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