public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: phy: freescale: Add DisplayPort/HDMI Combo-PHY driver for i.MX8MQ
Date: Mon, 25 May 2026 22:48:48 +1000	[thread overview]
Message-ID: <review-patch4-20260519-dcss-hdmi-upstreaming-v23-4-5615524a9c63@oss.nxp.com> (raw)
In-Reply-To: <20260519-dcss-hdmi-upstreaming-v23-4-5615524a9c63@oss.nxp.com>

Patch Review

Large PHY driver (1359 lines) with extensive PLL configuration tables.

**Issues:**

1. **`cdns_phy->base` pointer lifetime**: The PHY obtains the `cdns_mhdp_base` pointer from its parent via `dev_get_drvdata(cdns_phy->dev->parent)` in `cdns_hdptx_phy_init()`. This pointer is valid as long as the parent bridge device is alive, but there's no reference counting or deferred probe protection. If the parent driver is unbound first, `cdns_phy->base` becomes a dangling pointer. The `if (!cdns_phy->base)` checks in power_on/off/set_mode only protect against init not being called yet, not against parent unbind.

2. **`hdptx_clk_enable()` uses `devm_clk_get_enabled()` at probe time**: This means clocks are enabled from probe until device removal. For a PHY that might not always be in use, this wastes power. Consider using `devm_clk_get()` at probe and `clk_prepare_enable()`/`clk_disable_unprepare()` in `power_on`/`power_off`.

3. **`ndelay(150)` usage in `hdptx_dp_aux_cfg()`**: Many sequential `ndelay(150)` calls between register writes. While the hardware may require these delays, `ndelay` is busy-wait and can be inaccurate on some platforms. The existing approach is functional but worth noting.

4. **Error accumulator pattern**: The `int *err` parameter on `cdns_phy_reg_read/write` is a nice pattern for batching error checks, but the accumulated error could mask which specific register access failed during debugging.

5. **Multi-line comment style**:
```c
/* Configure PHY in A0 mode (PHY must be in the A0 power
 * state in order to transmit data)
 */
```
Should follow kernel style: `/*` on its own line for multi-line comments, or use single-line.

---
Generated by Claude Code Patch Reviewer

  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 review: " Claude Code Review Bot
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 Code Review Bot [this message]
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 6/8] phy: freescale: Add DisplayPort/HDMI Combo-PHY driver " 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-patch4-20260519-dcss-hdmi-upstreaming-v23-4-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