From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/mediatek: Use dp_connector helpers to report link training state
Date: Sun, 12 Apr 2026 10:51:26 +1000 [thread overview]
Message-ID: <review-patch12-20260409-feat_link_cap-v1-12-7069e8199ce2@bootlin.com> (raw)
In-Reply-To: <20260409-feat_link_cap-v1-12-7069e8199ce2@bootlin.com>
Patch Review
**Bug -- `bridge.ops` overwrite:**
```c
mtk_dp->bridge.dp_link_train_caps = &dp_link_train_caps;
mtk_dp->bridge.ops = DRM_BRIDGE_OP_DP;
if (mtk_dp->bridge.type == DRM_MODE_CONNECTOR_eDP) {
...
} else {
mtk_dp->bridge.ops = DRM_BRIDGE_OP_DETECT |
DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_HPD;
```
For the non-eDP (regular DP) case, the `else` branch overwrites `bridge.ops` to `DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_HPD`, losing `DRM_BRIDGE_OP_DP`. The fix is to change the else branch to use `|=` or move the `DRM_BRIDGE_OP_DP` assignment after the conditional and use `|=`.
For the eDP case, `DRM_BRIDGE_OP_DP` would stick, but the eDP branch never calls `devm_drm_bridge_add()` directly (it's called from `mtk_dp_edp_link_panel`), and it lacks DETECT/EDID/HPD ops which may cause issues.
**Bug -- uninitialized `dp_link_train` in `mtk_dp_report_link_train()`:**
```c
struct drm_connector_dp_link_train dp_link_train;
dp_link_train.rate = drm_dp_bw_code_to_link_rate(mtk_dp->train_info.link_rate);
dp_link_train.nlanes = mtk_dp->train_info.lane_count;
```
`dsc_en` is never set, and remaining `v_swing[]`/`pre_emph[]` entries (for lanes beyond `lane_count`) are uninitialized. Should be `= {};`.
Note: the `dp_link_train_caps` struct doesn't set `.dsc = true`, so the `dsc_en` property won't be created, and the uninitialized `dsc_en` field in the report won't cause a NULL deref. But the struct should still be zero-initialized for correctness.
**Minor -- untested.** The author explicitly notes this patch is untested. Given the bugs above, it clearly needs testing before non-RFC submission.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-12 0:51 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 17:08 [PATCH RFC 00/12] Add support for DisplayPort link training information report Kory Maincent
2026-04-09 17:08 ` [PATCH RFC 01/12] drm/i915/display/intel_sdvo: Fix double connector destroy in error paths Kory Maincent
2026-04-12 0:51 ` Claude review: " Claude Code Review Bot
2026-04-09 17:08 ` [PATCH RFC 02/12] drm/i915/display/intel_lvds: Drop redundant manual cleanup on init failure Kory Maincent
2026-04-12 0:51 ` Claude review: " Claude Code Review Bot
2026-04-09 17:08 ` [PATCH RFC 03/12] drm/i915/display/intel_dp: Drop redundant intel_dp_aux_fini() " Kory Maincent
2026-04-12 0:51 ` Claude review: " Claude Code Review Bot
2026-04-09 17:08 ` [PATCH RFC 04/12] drm/i915/display: Switch to drmm_mode_config_init() and drop manual cleanup Kory Maincent
2026-04-12 0:51 ` Claude review: " Claude Code Review Bot
2026-04-09 17:08 ` [PATCH RFC 05/12] drm/i915/display: Switch to managed for crtc Kory Maincent
2026-04-12 0:51 ` Claude review: " Claude Code Review Bot
2026-04-09 17:08 ` [PATCH RFC 06/12] drm/i915/display: Switch to managed for plane Kory Maincent
2026-04-12 0:51 ` Claude review: " Claude Code Review Bot
2026-04-09 17:08 ` [PATCH RFC 07/12] drm/i915/display: Switch to managed for encoder Kory Maincent
2026-04-12 0:51 ` Claude review: " Claude Code Review Bot
2026-04-09 17:08 ` [PATCH RFC 08/12] drm/i915/display: Switch to managed for connector Kory Maincent
2026-04-12 0:51 ` Claude review: " Claude Code Review Bot
2026-04-09 17:08 ` [PATCH RFC 09/12] drm: Introduce drmm_connector_dp_init() with link training state properties Kory Maincent
2026-04-09 21:53 ` Dmitry Baryshkov
2026-04-10 16:20 ` Jani Nikula
2026-04-12 0:51 ` Claude review: " Claude Code Review Bot
2026-04-09 17:08 ` [PATCH RFC 10/12] drm/i915/display/dp: Adopt dp_connector helpers to expose link training state Kory Maincent
2026-04-10 16:26 ` Jani Nikula
2026-04-12 0:51 ` Claude review: " Claude Code Review Bot
2026-04-09 17:08 ` [PATCH RFC 11/12] drm/bridge: Wire drmm_connector_dp_init() via new DRM_BRIDGE_OP_DP flag Kory Maincent
2026-04-12 0:51 ` Claude review: " Claude Code Review Bot
2026-04-09 17:08 ` [PATCH RFC 12/12] drm/mediatek: Use dp_connector helpers to report link training state Kory Maincent
2026-04-12 0:51 ` Claude Code Review Bot [this message]
2026-04-09 20:36 ` [PATCH RFC 00/12] Add support for DisplayPort link training information report Ville Syrjälä
2026-04-09 21:36 ` Dmitry Baryshkov
2026-04-12 0:51 ` Claude review: " 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-patch12-20260409-feat_link_cap-v1-12-7069e8199ce2@bootlin.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