From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/bridge: imx93-mipi-dsi: Fix mode validation
Date: Sat, 16 May 2026 13:49:55 +1000 [thread overview]
Message-ID: <review-patch1-20260512-imx93-mipi-dsi-fix-mode-validation-v2-1-7aec3be5da2c@nxp.com> (raw)
In-Reply-To: <20260512-imx93-mipi-dsi-fix-mode-validation-v2-1-7aec3be5da2c@nxp.com>
Patch Review
**Problem analysis:** Correct. The old code at line 496-497:
```c
struct drm_bridge *last_bridge __free(drm_bridge_put) =
drm_bridge_chain_get_last_bridge(dmd_bridge->encoder);
```
only checked the terminal bridge. When a connector bridge (e.g., `drm_connector_bridge`) sits at the end of the chain without `DRM_BRIDGE_OP_DETECT` or `DRM_BRIDGE_OP_EDID`, the tolerance path was never entered, causing valid modes to be rejected.
**Fix analysis:** The replacement iterates from `dmd_bridge` forward:
```c
drm_for_each_bridge_in_chain_from(dmd_bridge, bridge) {
if ((bridge->ops & DRM_BRIDGE_OP_DETECT) &&
(bridge->ops & DRM_BRIDGE_OP_EDID)) {
...
break;
}
}
```
This is correct. The `drm_for_each_bridge_in_chain_from()` macro (defined in `drm_bridge.h:1532`) declares `bridge` with `__free(__drm_for_each_bridge_in_chain_cleanup)`, so both the `return MODE_NOCLOCK` early-exit and the normal `break` path properly unlock the chain mutex and drop the bridge reference. This replaces the explicit `__free(drm_bridge_put)` cleanup on the old `last_bridge` variable.
**Minor observation:** The iteration starts from `dmd_bridge` inclusive, so the DW MIPI DSI bridge itself is checked. It won't have the ops bits set, so this is harmless but slightly broader than "bridges after this bridge" as stated in the commit message. Not a problem.
**Nit (not blocking):** The `break` after the tolerance check exits the loop on the first matching bridge. If there were somehow multiple bridges with `DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID` in the chain, only the first one would be considered. This is the right behavior for the described topology.
No issues found. The patch is correct and ready to apply.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-16 3:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 9:18 [PATCH v2] drm/bridge: imx93-mipi-dsi: Fix mode validation Liu Ying
2026-05-14 5:55 ` Liu Ying
2026-05-16 3:49 ` Claude review: " Claude Code Review Bot
2026-05-16 3:49 ` Claude Code Review Bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-05-15 6:54 [PATCH v3] " Liu Ying
2026-05-15 23:49 ` Claude review: " Claude Code Review Bot
2026-05-15 23:49 ` 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-20260512-imx93-mipi-dsi-fix-mode-validation-v2-1-7aec3be5da2c@nxp.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