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: qualcomm: add MSM8974 HDMI PHY support
Date: Sun, 22 Mar 2026 04:56:09 +1000	[thread overview]
Message-ID: <review-patch4-20260319-fd-hdmi-phy-v6-4-cefc08a55470@oss.qualcomm.com> (raw)
In-Reply-To: <20260319-fd-hdmi-phy-v6-4-cefc08a55470@oss.qualcomm.com>

Patch Review

Adds PLL rate calculation and programming to the MSM8974 (28HPM) HDMI PHY driver. This is the most algorithmically complex patch.

**Critical: Likely unit mismatch for `tmds_char_rate`**

The `struct phy_configure_opts_hdmi` defines `tmds_char_rate` in Hz (unsigned long long). However, the PLL calculation code treats it as kHz:

```c
unsigned long pixclk = opts->hdmi.tmds_char_rate;
...
if (pixclk == 297000) {
```

297000 Hz is 297 kHz, not the 297 MHz (297000000 Hz) that 4K HDMI requires. Either the comparisons should be against `297000000` (Hz), or `pixclk` should be explicitly divided: `pixclk = opts->hdmi.tmds_char_rate / 1000`. The VCO calculations later also appear to assume kHz:

```c
unsigned long vco_rate = pixclk * 10;
...
unsigned long rem = vco_rate % ref_clk;
```

If `pixclk` were in Hz (~148500000 for 1080p), then `vco_rate = pixclk * 10` would overflow a 32-bit intermediate on some platforms, and the divisor values would be wrong. This needs verification against the hardware reference.

**Good use of FIELD_PREP for register programming**

```c
writel(FIELD_PREP(UNIPHY_PLL_SDM_CFG0_BYP, !sdm_byp) |
       FIELD_PREP(UNIPHY_PLL_SDM_CFG0_BYP_DBLR, sdm_byp),
       pll_base + UNIPHY_PLL_SDM_CFG0);
```

This is much more readable than the raw magic number writes in the old driver.

**`of_device_get_match_data` in probe path**

Same issue as patch 1 — should use `device_get_match_data()`.

**PLL lock polling**

```c
while (!(readl(pll_base + UNIPHY_PLL_STATUS) & UNIPHY_PLL_STATUS_PLL_LOCK)) {
	udelay(1);
	if (timeout_us-- == 0)
		return -ETIMEDOUT;
}
```

This is a common pattern but `readl_poll_timeout()` would be the idiomatic kernel helper for this, providing consistent timeout behavior and reducing boilerplate.

---

**Summary**: The series is architecturally sound but has two critical issues (missing compatible strings for APQ8084/MSM8998, and a likely Hz/kHz unit mismatch in PLL calculations) that must be resolved before merge. The minor issues (typos, API preferences, code duplication) are worth fixing but non-blocking.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-21 18:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  3:48 [PATCH v6 0/4] drm/msm/hdmi & phy: use generic PHY framework Dmitry Baryshkov
2026-03-19  3:48 ` [PATCH v6 1/4] drm/msm/hdmi: switch to generic PHY subsystem Dmitry Baryshkov
2026-03-21 18:56   ` Claude review: " Claude Code Review Bot
2026-03-19  3:48 ` [PATCH v6 2/4] phy: qcom: apq8064-sata: extract UNI PLL register defines Dmitry Baryshkov
2026-03-21 18:56   ` Claude review: " Claude Code Review Bot
2026-03-19  3:48 ` [PATCH v6 3/4] phy: qcom-uniphy: add more registers from display PHYs Dmitry Baryshkov
2026-03-21 18:56   ` Claude review: " Claude Code Review Bot
2026-03-19  3:48 ` [PATCH v6 4/4] phy: qualcomm: add MSM8974 HDMI PHY support Dmitry Baryshkov
2026-03-21 18:56   ` Claude Code Review Bot [this message]
2026-03-21 18:56 ` Claude review: drm/msm/hdmi & phy: use generic PHY framework Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-23 22:56 [PATCH v7 0/4] " Dmitry Baryshkov
2026-03-23 22:56 ` [PATCH v7 4/4] phy: qualcomm: add MSM8974 HDMI PHY support Dmitry Baryshkov
2026-03-24 21:14   ` Claude review: " Claude Code Review Bot
2026-03-14  5:06 [PATCH v5 0/4] drm/msm/hdmi & phy: use generic PHY framework Dmitry Baryshkov
2026-03-14  5:06 ` [PATCH v5 4/4] phy: qualcomm: add MSM8974 HDMI PHY support Dmitry Baryshkov
2026-03-16  2:08   ` 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-20260319-fd-hdmi-phy-v6-4-cefc08a55470@oss.qualcomm.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