From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: soc: cadence: Create helper functions for Cadence MHDP
Date: Mon, 25 May 2026 22:48:48 +1000 [thread overview]
Message-ID: <review-patch1-20260519-dcss-hdmi-upstreaming-v23-1-5615524a9c63@oss.nxp.com> (raw)
In-Reply-To: <20260519-dcss-hdmi-upstreaming-v23-1-5615524a9c63@oss.nxp.com>
Patch Review
This patch extracts mailbox access code from the mhdp8546 driver into a new shared helper under `drivers/soc/cadence/`. The design is clean with per-instance `mailbox_mutex`, proper `lockdep_assert_held()` annotations, and address validation on DPCD/register reads.
**Issues:**
1. **Commit message typo**: "helper fucntions" and "MDHP8501" should be "helper functions" and "MHDP8501".
2. **HDCP receiver ID buffer overflow risk** in `cdns_mhdp_secure_mailbox_send_recv_multi()`:
```c
if (module_id == MB_MODULE_ID_HDCP_TX &&
opcode == HDCP_TRAN_IS_REC_ID_VALID)
ret = mhdp_mailbox_recv_data(base, resp2, 5 * resp1[0], true);
```
`resp1[0]` is firmware-controlled. If it returns a value larger than the buffer behind `resp2`, this overflows. The caller in mhdp8546-hdcp.c passes `0` for `resp2_size` with `hdcp_rx_id` buffer — but the size of that buffer is `HDCP_MAX_RECEIVERS * 5 = 160` bytes. There's no validation that `resp1[0] <= HDCP_MAX_RECEIVERS` here.
3. **Code duplication**: The non-secure and secure variants of `cdns_mhdp_mailbox_send_recv` and `cdns_mhdp_mailbox_send_recv_multi` are nearly identical except for the `secure` boolean. The internal functions already take a `bool secure` parameter — consider whether the six exported wrappers could be reduced to three with a boolean parameter, or if the current approach is intentional for API clarity.
4. **Placement under `drivers/soc/`**: This is a display/PHY helper library. While it provides mailbox access for an IP block, placing it under `drivers/soc/cadence/` may be debatable. The DRM bridge subsystem maintainers or the linux-soc list should weigh in on whether this belongs under `drivers/soc/` or perhaps `drivers/firmware/` or `drivers/mfd/`.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-25 12:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 14:42 [PATCH v23 0/8] Initial support Cadence MHDP8501(HDMI/DP) for i.MX8MQ Laurentiu Palcu
2026-05-19 14:42 ` [PATCH v23 1/8] soc: cadence: Create helper functions for Cadence MHDP Laurentiu Palcu
2026-05-25 12:48 ` Claude Code Review Bot [this message]
2026-05-19 14:42 ` [PATCH v23 2/8] drm: bridge: cadence: Update mhdp8546 mailbox access functions Laurentiu Palcu
2026-05-25 12:48 ` Claude review: " Claude Code Review Bot
2026-05-19 14:42 ` [PATCH v23 3/8] dt-bindings: phy: Add Freescale iMX8MQ DP and HDMI PHY Laurentiu Palcu
2026-05-25 12:48 ` Claude review: " Claude Code Review Bot
2026-05-19 14:42 ` [PATCH v23 4/8] phy: freescale: Add DisplayPort/HDMI Combo-PHY driver for i.MX8MQ Laurentiu Palcu
2026-05-25 12:48 ` Claude review: " Claude Code Review Bot
2026-05-19 14:42 ` [PATCH v23 5/8] dt-bindings: display: bridge: Add Cadence MHDP8501 Laurentiu Palcu
2026-05-25 12:48 ` Claude review: " Claude Code Review Bot
2026-05-19 14:42 ` [PATCH v23 6/8] drm: bridge: Cadence: Add MHDP8501 DP/HDMI driver Laurentiu Palcu
2026-05-25 12:48 ` Claude review: " Claude Code Review Bot
2026-05-19 14:42 ` [PATCH v23 7/8] arm64: dts: imx8mq: Add DCSS + HDMI/DP display pipeline Laurentiu Palcu
2026-05-25 12:48 ` Claude review: " Claude Code Review Bot
2026-05-19 14:42 ` [PATCH v23 8/8] arm64: dts: imx8mq: tqma8mq-mba8mx: Enable HDMI support Laurentiu Palcu
2026-05-25 12:48 ` Claude review: " Claude Code Review Bot
2026-05-25 12:48 ` Claude review: Initial support Cadence MHDP8501(HDMI/DP) for i.MX8MQ Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-04-07 14:31 [PATCH v21 0/8] " Laurentiu Palcu
2026-04-07 14:31 ` [PATCH v21 1/8] soc: cadence: Create helper functions for Cadence MHDP Laurentiu Palcu
2026-04-12 3:34 ` 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-patch1-20260519-dcss-hdmi-upstreaming-v23-1-5615524a9c63@oss.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