From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/bridge: tc358762: Drop drm_bridge_funcs.mode_set
Date: Sat, 16 May 2026 12:04:24 +1000 [thread overview]
Message-ID: <review-patch11-20260513-tc358762-fixes-v3-11-6698b55008b9@ideasonboard.com> (raw)
In-Reply-To: <20260513-tc358762-fixes-v3-11-6698b55008b9@ideasonboard.com>
Patch Review
Replaces the deprecated `.mode_set` callback (which stored the mode into `ctx->mode`) with fetching the mode from atomic state in `tc358762_enable()`. Uses `drm_atomic_get_new_connector_for_encoder()` → `drm_atomic_get_new_connector_state()` → `drm_atomic_get_new_crtc_state()` → `crtc_state->mode`.
**Issue: Missing NULL checks.** The return values of `drm_atomic_get_new_connector_for_encoder()`, `drm_atomic_get_new_connector_state()`, and `drm_atomic_get_new_crtc_state()` can all be NULL. While in practice they shouldn't be NULL when called from `atomic_enable` (the CRTC/connector must be active), other bridge drivers (e.g., `dw-dp.c`, `adv7511_drv.c`, `analogix_dp_core.c`) do NULL-check the connector return. The sibling driver `tc358768.c` doesn't check either, but that doesn't make it right.
```c
connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
conn_state = drm_atomic_get_new_connector_state(state, connector);
crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc);
mode = &crtc_state->mode;
```
A NULL `connector` here would cause a NULL-pointer dereference on the next line. Recommend at minimum a `WARN_ON(!connector)` guard with early return, consistent with the pattern in `adv7511_drv.c`.
Also uses `crtc_state->mode` rather than `crtc_state->adjusted_mode`. This is consistent with the original `.mode_set` which was passed the unadjusted mode, so it preserves behavior. But for a bridge that needs actual hardware timings, `adjusted_mode` is often more appropriate. Worth considering whether `adjusted_mode` would be better, though for this simple bridge the difference is likely negligible.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-16 2:04 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 13:10 [PATCH v3 00/13] drm/bridge: tc358762: Various small fixes Tomi Valkeinen
2026-05-13 13:10 ` [PATCH v3 01/13] drm/bridge: tc358762: Clean up register defines Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-13 13:10 ` [PATCH v3 02/13] drm/bridge: tc358762: Improve SYSCTRL " Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-13 13:10 ` [PATCH v3 03/13] drm/bridge: tc358762: Improve LCDCTRL defines Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-13 13:10 ` [PATCH v3 04/13] drm/bridge: tc358762: Configure SYSCTRL first Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-13 13:10 ` [PATCH v3 05/13] drm/bridge: tc358762: Drop SPICMR write Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-13 13:10 ` [PATCH v3 06/13] drm/bridge: tc358762: Improve DPI enable handling Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-13 13:10 ` [PATCH v3 07/13] drm/bridge: tc358762: Update comment about the number of lanes Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-13 13:10 ` [PATCH v3 08/13] drm/bridge: tc358762: Support VTG Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-13 13:10 ` [PATCH v3 09/13] drm/bridge: tc358762: Fix sync polarities Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-13 13:10 ` [PATCH v3 10/13] drm/bridge: tc358762: Move tc358762_init() into tc358762_enable() Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-13 13:10 ` [PATCH v3 11/13] drm/bridge: tc358762: Drop drm_bridge_funcs.mode_set Tomi Valkeinen
2026-05-16 2:04 ` Claude Code Review Bot [this message]
2026-05-13 13:10 ` [PATCH v3 12/13] drm/bridge: tc358762: Set DE_POL and DCLK_POL properly Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-13 13:10 ` [PATCH v3 13/13] drm/panel-simple: Fix powertip,ph800480t013-idf02 timings Tomi Valkeinen
2026-05-16 2:04 ` Claude review: " Claude Code Review Bot
2026-05-16 2:04 ` Claude review: drm/bridge: tc358762: Various small fixes 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-patch11-20260513-tc358762-fixes-v3-11-6698b55008b9@ideasonboard.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