From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260519-dcss-hdmi-upstreaming-v23-4-5615524a9c63@oss.nxp.com> References: <20260519-dcss-hdmi-upstreaming-v23-0-5615524a9c63@oss.nxp.com> <20260519-dcss-hdmi-upstreaming-v23-4-5615524a9c63@oss.nxp.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 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