From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/msm/hdmi: switch to generic PHY subsystem
Date: Wed, 25 Mar 2026 07:14:41 +1000 [thread overview]
Message-ID: <review-patch1-20260324-fd-hdmi-phy-v7-1-b41dde8d83b8@oss.qualcomm.com> (raw)
In-Reply-To: <20260324-fd-hdmi-phy-v7-1-b41dde8d83b8@oss.qualcomm.com>
Patch Review
This is the core patch — it removes the ad-hoc HDMI PHY code from the DRM driver and creates new PHY drivers under `drivers/phy/qualcomm/`. The DRM side now uses the standard `devm_phy_get()`, `phy_init()`, `phy_configure()`, `phy_power_on()` / `phy_power_off()`, `phy_exit()` API. This is clean.
**Bug: Missing `qcom,hdmi-phy-8998` in OF match table**
The old driver had entries for both `qcom,hdmi-phy-8996` and `qcom,hdmi-phy-8998`. The new `phy-qcom-qmp-hdmi-base.c` only has:
```c
static const struct of_device_id qmp_hdmi_of_match_table[] = {
{
.compatible = "qcom,hdmi-phy-8996", .data = &qmp_hdmi_8996_cfg,
},
{ },
};
```
The MSM8998 code is fully implemented in `phy-qcom-qmp-hdmi-msm8998.c` with `qmp_hdmi_8998_cfg` exported, but it's never wired into the match table. This means MSM8998 HDMI will be broken. Add:
```c
{ .compatible = "qcom,hdmi-phy-8998", .data = &qmp_hdmi_8998_cfg, },
```
**Bug: Wrong pointer in MSM8996 PHY `set_rate`**
In `phy-qcom-qmp-hdmi-msm8996.c`, line 5926 of the mbox:
```c
writel(11000000 / (parent_rate / 20),
hdmi_phy + QSERDES_COM_CP_CTRL_MODE0);
```
This writes to `hdmi_phy + offset` (a `struct qmp_hdmi_phy *` plus an integer offset), not `hdmi_phy->serdes + offset`. This is a pointer arithmetic bug that will corrupt memory or cause a crash. Should be:
```c
hdmi_phy->serdes + QSERDES_COM_CP_CTRL_MODE0);
```
**Minor: `pm_runtime_put_noidle` in phy_exit**
Both `qcom_hdmi_preqmp_phy_exit()` and `qmp_hdmi_phy_exit()` use `pm_runtime_put_noidle()`, which decrements the refcount without actually triggering runtime suspend. The matching `phy_init` uses `pm_runtime_resume_and_get()`. Consider using `pm_runtime_put` or `pm_runtime_put_sync` instead to actually suspend the device when no longer in use.
**Minor: `devm_phy_get` error message**
In `hdmi.c`:
```c
hdmi->phy = devm_phy_get(&pdev->dev, NULL);
if (IS_ERR(hdmi->phy)) {
DRM_DEV_ERROR(&pdev->dev, "failed to get phy\n");
return PTR_ERR(hdmi->phy);
}
```
`devm_phy_get` already returns `-EPROBE_DEFER` etc. Consider using `dev_err_probe()` instead of `DRM_DEV_ERROR` to avoid spamming the log during deferred probing.
**Minor: Duplicate `write16`/`write24`/`read24` helpers**
The `write16()`, `write24()`, `read24()` helper functions are defined identically in three files: `phy-qcom-hdmi-28lpm.c`, `phy-qcom-qmp-hdmi-msm8996.c`, and `phy-qcom-qmp-hdmi-msm8998.c`. These could be shared through a common header (e.g., `phy-qcom-qmp-hdmi.h` or a utility header).
**Minor: `__maybe_unused` on pm ops**
The runtime PM callbacks use `__maybe_unused` annotations. Since these are always used (referenced by `DEFINE_RUNTIME_DEV_PM_OPS`), the annotation is unnecessary but harmless.
**Minor: `of_device_get_match_data` deprecation**
Both `phy-qcom-hdmi-preqmp.c` and `phy-qcom-qmp-hdmi-base.c` use `of_device_get_match_data()`. Modern kernel code prefers `device_get_match_data()`.
**Minor: Typo in Kconfig**
```
+ Enable this to support the Qualcomm HDMI PHY presend on 32-bit platforms:
```
"presend" should be "present".
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-24 21:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 22:56 [PATCH v7 0/4] drm/msm/hdmi & phy: use generic PHY framework Dmitry Baryshkov
2026-03-23 22:56 ` [PATCH v7 1/4] drm/msm/hdmi: switch to generic PHY subsystem Dmitry Baryshkov
2026-03-24 21:14 ` Claude Code Review Bot [this message]
2026-03-23 22:56 ` [PATCH v7 2/4] phy: qcom: apq8064-sata: extract UNI PLL register defines Dmitry Baryshkov
2026-03-24 21:14 ` Claude review: " Claude Code Review Bot
2026-03-23 22:56 ` [PATCH v7 3/4] phy: qcom-uniphy: add more registers from display PHYs Dmitry Baryshkov
2026-03-24 21:14 ` Claude review: " Claude Code Review Bot
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-24 21:14 ` 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-19 3:48 [PATCH v6 0/4] " 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-14 5:06 [PATCH v5 0/4] drm/msm/hdmi & phy: use generic PHY framework Dmitry Baryshkov
2026-03-14 5:06 ` [PATCH v5 1/4] drm/msm/hdmi: switch to generic PHY subsystem Dmitry Baryshkov
2026-03-16 2:07 ` 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-20260324-fd-hdmi-phy-v7-1-b41dde8d83b8@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