From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260324-fd-hdmi-phy-v7-1-b41dde8d83b8@oss.qualcomm.com> References: <20260324-fd-hdmi-phy-v7-0-b41dde8d83b8@oss.qualcomm.com> <20260324-fd-hdmi-phy-v7-1-b41dde8d83b8@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review This is the core patch =E2=80=94 it removes the ad-hoc HDMI PHY code from t= he DRM driver and creates new PHY drivers under `drivers/phy/qualcomm/`. Th= e DRM side now uses the standard `devm_phy_get()`, `phy_init()`, `phy_confi= gure()`, `phy_power_on()` / `phy_power_off()`, `phy_exit()` API. This is cl= ean. **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[] =3D { { .compatible =3D "qcom,hdmi-phy-8996", .data =3D &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. T= his means MSM8998 HDMI will be broken. Add: ```c { .compatible =3D "qcom,hdmi-phy-8998", .data =3D &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 integ= er offset), not `hdmi_phy->serdes + offset`. This is a pointer arithmetic b= ug 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_runtim= e_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 actua= lly suspend the device when no longer in use. **Minor: `devm_phy_get` error message** In `hdmi.c`: ```c hdmi->phy =3D 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 defer= red probing. **Minor: Duplicate `write16`/`write24`/`read24` helpers** The `write16()`, `write24()`, `read24()` helper functions are defined ident= ically 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 comm= on 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 platform= s: ``` "presend" should be "present". --- Generated by Claude Code Patch Reviewer