From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: robh@kernel.org, linux-phy@lists.infradead.org,
devicetree@vger.kernel.org, neil.armstrong@linaro.org,
vkoul@kernel.org, conor+dt@kernel.org, olteanv@gmail.com
Subject: Re: [PATCH 04/10] phy: qcom-ipq806x-usb: add MSM8974 HS PHY support
Date: Mon, 10 Aug 2026 11:51:35 +0000 [thread overview]
Message-ID: <20260810115136.4DCF11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260810-msm8974-usb3-v1-4-1a47e1185524@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] The MSM8974 initialization sequence reuses the shared IPQ806x sequence instead of providing its own, directly contradicting the commit message and unconditionally overwriting the PHY_CTRL register.
- [High] Setting the active-low HSUSB_CLAMP_MPM_DPSE_DMSE_EN_N bit disables the DP/DM MPM clamps, contradicting the commit message.
- [Low] Duplicate and redundant macro definitions for BIT(26) in the PHY_CTRL register.
--
--- Patch [4]: [PATCH 04/10] phy: qcom-ipq806x-usb: add MSM8974 HS PHY support ---
commit 90246a8322244753151c5fb6777bd8d442742a72
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
phy: qcom-ipq806x-usb: add MSM8974 HS PHY support
This commit adds support for the MSM8974 DWC3 wrapper by introducing a new
compatible string and driver data. It claims to implement a dedicated init
sequence for MSM8974 to preserve reference frequency selection straps.
> Add the qcom,msm8974-usb-phy-hs compatible with its own init
> sequence: unlike the IPQ806x one, it must not overwrite the whole
> PHY_CTRL register, as the power-on values of the reference frequency
> selection straps have to be preserved. Only enable the UTMI clock and
> the DP/DM MPM clamps, signal VBUS valid towards the link, and disable
> retention.
> diff --git a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> --- a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> +++ b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> @@ -17,6 +17,7 @@
> #define HSUSB_PHY_CTRL_REG (0x10)
>
> /* PHY_CTRL_REG */
> +#define HSUSB_CLAMP_MPM_DPSE_DMSE_EN_N BIT(26)
> #define HSUSB_CTRL_DMSEHV_CLAMP BIT(24)
> #define HSUSB_CTRL_USB2_SUSPEND BIT(23)
> #define HSUSB_CTRL_UTMI_CLK_EN BIT(21)
[ ... ]
> @@ -27,9 +28,13 @@
> #define HSUSB_CTRL_ID_HV_CLAMP BIT(9)
> #define HSUSB_CTRL_OTGSESSVLD_CLAMP BIT(8)
> #define HSUSB_CTRL_CLAMP_EN BIT(7)
> +#define HSUSB_CTRL_CLAMP_MPM_DPSE_DMSE BIT(26)
[Severity: Low]
This isn't a bug, but does this bit need to be defined twice? It was just
defined as HSUSB_CLAMP_MPM_DPSE_DMSE_EN_N a few lines above.
[ ... ]
> @@ -273,7 +283,8 @@ static int qcom_ipq806x_usb_hs_phy_init(struct phy *phy)
> HSUSB_CTRL_RETENABLEN | HSUSB_CTRL_COMMONONN |
> HSUSB_CTRL_OTGSESSVLD_CLAMP | HSUSB_CTRL_ID_HV_CLAMP |
> HSUSB_CTRL_UTMI_OTG_VBUS_VALID | HSUSB_CTRL_UTMI_CLK_EN |
> - HSUSB_CTRL_CLAMP_EN | 0x70;
> + HSUSB_CTRL_CLAMP_EN | HSUSB_CLAMP_MPM_DPSE_DMSE_EN_N |
[Severity: High]
The commit message mentions we should "enable the DP/DM MPM clamps". Since
this bit has an _EN_N suffix, standardly indicating it is active-low, does
setting it to 1 here actually disable the clamps instead of enabling them?
> + phy_dwc3->drvdata->fsel;
>
> /* use core clock if external reference is not present */
> if (!phy_dwc3->xo_clk)
> @@ -282,9 +293,14 @@ static int qcom_ipq806x_usb_hs_phy_init(struct phy *phy)
> writel(val, phy_dwc3->base + HSUSB_PHY_CTRL_REG);
[Severity: High]
The commit message states that the MSM8974 init sequence "must not
overwrite the whole PHY_CTRL register". Does unconditionally writing to
this register with writel() break the preservation of the power-on values
for the reference frequency selection straps?
[ ... ]
> @@ -458,6 +474,18 @@ static const struct phy_drvdata qcom_ipq806x_usb_hs_drvdata = {
> .owner = THIS_MODULE,
> },
> .clk_rate = 60000000,
> + .fsel = 0x70,
> +};
> +
> +static const struct phy_drvdata qcom_msm8974_usb_hs_drvdata = {
> + .ops = {
> + .init = qcom_ipq806x_usb_hs_phy_init,
[Severity: High]
The commit message indicates that MSM8974 was intended to have "its own init
sequence", but here it is assigned the shared qcom_ipq806x_usb_hs_phy_init
function. Should this point to a dedicated initialization function for
MSM8974 to avoid the writel() register overwrite mentioned above?
> + .exit = qcom_ipq806x_usb_hs_phy_exit,
> + .owner = THIS_MODULE,
> + },
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260810-msm8974-usb3-v1-0-1a47e1185524@oss.qualcomm.com?part=4
next prev parent reply other threads:[~2026-08-10 11:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 11:42 [PATCH 00/10] ARM: qcom: enable USB3 (DWC3) controller on MSM8974 platform Dmitry Baryshkov
2026-08-10 11:42 ` [PATCH 01/10] dt-bindings: usb: qcom,snps-dwc3: document the MSM8974 controller Dmitry Baryshkov
2026-08-10 11:42 ` [PATCH 02/10] dt-bindings: phy: qcom,ipq806x-usb-phy-hs: document the MSM8974 HS PHY Dmitry Baryshkov
2026-08-10 11:42 ` [PATCH 03/10] dt-bindings: phy: qcom,ipq806x-usb-phy-ss: add MSM8974 SS PHY Dmitry Baryshkov
2026-08-10 11:54 ` sashiko-bot
2026-08-10 13:05 ` Rob Herring (Arm)
2026-08-10 11:42 ` [PATCH 04/10] phy: qcom-ipq806x-usb: add MSM8974 HS PHY support Dmitry Baryshkov
2026-08-10 11:51 ` sashiko-bot [this message]
2026-08-10 11:42 ` [PATCH 05/10] phy: qcom-ipq806x-usb: fix the SS PHY TEST_POWERDOWN bit Dmitry Baryshkov
2026-08-10 11:53 ` sashiko-bot
2026-08-10 11:42 ` [PATCH 06/10] phy: qcom-ipq806x-usb: fix the PHY_PARAM_CTRL1 field masks Dmitry Baryshkov
2026-08-10 11:57 ` sashiko-bot
2026-08-10 11:42 ` [PATCH 07/10] phy: qcom-ipq806x-usb: parse the tx-deamp-3_5db property as documented Dmitry Baryshkov
2026-08-10 11:49 ` sashiko-bot
2026-08-10 11:42 ` [PATCH 08/10] phy: qcom-ipq806x-usb: support the MSM8974 SS PHY parameters Dmitry Baryshkov
2026-08-10 11:56 ` sashiko-bot
2026-08-10 11:42 ` [PATCH 09/10] ARM: dts: qcom: msm8974: add the USB3 controller and its PHYs Dmitry Baryshkov
2026-08-10 12:04 ` sashiko-bot
2026-08-10 11:42 ` [PATCH 10/10] ARM: dts: qcom: apq8074-dragonboard: enable the USB3 host Dmitry Baryshkov
2026-08-10 12:07 ` sashiko-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=20260810115136.4DCF11F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=linux-phy@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vkoul@kernel.org \
/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