From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/bridge: tc358768: Add support for long command tx via video buffer
Date: Thu, 12 Mar 2026 07:14:51 +1000 [thread overview]
Message-ID: <review-patch7-20260311-tc358768-v2-7-e75a99131bd5@ideasonboard.com> (raw)
In-Reply-To: <20260311-tc358768-v2-7-e75a99131bd5@ideasonboard.com>
Patch Review
The main feature patch. Key observations:
1. **Guard against video-active state**: The check `if (confctl & BIT(6))` correctly tests `PP_en` to ensure long commands aren't sent while video is active. Good defensive check.
2. **Boundary condition for tx_len**: The check `msg->tx_len > 1024` correctly limits the maximum payload. Note however that `msg->tx_len` includes the header, but `packet.payload_length` is what actually gets written to the video buffer. The 1024-byte limit check against `msg->tx_len` is slightly conservative (by the header size) but this is safe and fine in practice.
3. **Sleep estimation**: The sleep calculation `packet.payload_length * 2` microseconds (2us per byte for LP mode) is described as a "safe estimate." For very small packets just over 8 bytes (e.g., 9 bytes), this gives ~18us which should be adequate. For maximum 1024-byte payloads, this gives ~2ms. The `usleep_range(tx_sleep_us, tx_sleep_us * 2)` pattern is proper kernel style.
4. **RstPtr release**: Line 814 releases RstPtr (BIT(14) of PP_MISC) early in `pre_enable()` so the video buffer can be used for DSI commands. In `enable()`, line 1217 clears both FrmStop and RstPtr (`0x3 << 14`), which is fine since RstPtr is already 0 at that point. The lifecycle is coherent.
5. **Missing poll for completion**: The comment says "The TC358768 spec says to wait until the transmission has been finished" but the implementation uses a time-based estimate rather than polling a status register. The cover letter acknowledges this approach. While polling would be more robust, the simple estimate with generous margins is pragmatic and has been tested working on hardware.
6. **DATAFMT register**: For long commands, `TC358768_DATAFMT` is set to `BIT(0)` (txdt_en only), which differs from the video mode setting that also includes `BIT(1) | BIT(2)` (dsitx_en, rdswap_en) and the format-specific bits. This is correct per the datasheet for command-mode buffer transmission.
Overall, a clean and well-organized series. No blocking issues found.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-11 21:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 7:48 [PATCH v2 0/7] drm/bridge: tc358768: Long command support Tomi Valkeinen
2026-03-11 7:48 ` [PATCH v2 1/7] drm/bridge: tc358768: Fix typo in TC358768_DSI_CONTROL_DIS_MODE Tomi Valkeinen
2026-03-11 21:14 ` Claude review: " Claude Code Review Bot
2026-03-11 7:48 ` [PATCH v2 2/7] drm/bridge: tc358768: Set pre_enable_prev_first for reverse order Tomi Valkeinen
2026-03-11 21:14 ` Claude review: " Claude Code Review Bot
2026-03-11 7:48 ` [PATCH v2 3/7] drm/bridge: tc358768: Separate indirect register writes Tomi Valkeinen
2026-03-11 21:14 ` Claude review: " Claude Code Review Bot
2026-03-11 7:48 ` [PATCH v2 4/7] drm/bridge: tc358768: Support non-continuous clock Tomi Valkeinen
2026-03-11 21:14 ` Claude review: " Claude Code Review Bot
2026-03-11 7:48 ` [PATCH v2 5/7] drm/bridge: tc358768: Add LP mode command support Tomi Valkeinen
2026-03-11 21:14 ` Claude review: " Claude Code Review Bot
2026-03-11 7:48 ` [PATCH v2 6/7] drm/bridge: tc358768: Separate video format config Tomi Valkeinen
2026-03-11 21:14 ` Claude review: " Claude Code Review Bot
2026-03-11 7:48 ` [PATCH v2 7/7] drm/bridge: tc358768: Add support for long command tx via video buffer Tomi Valkeinen
2026-03-11 21:14 ` Claude Code Review Bot [this message]
2026-03-11 21:14 ` Claude review: drm/bridge: tc358768: Long command support 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-patch7-20260311-tc358768-v2-7-e75a99131bd5@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