From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: vkoul@kernel.org, olteanv@gmail.com, conor+dt@kernel.org,
devicetree@vger.kernel.org, robh@kernel.org,
neil.armstrong@linaro.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH 05/10] phy: qcom-ipq806x-usb: fix the SS PHY TEST_POWERDOWN bit
Date: Mon, 10 Aug 2026 11:53:43 +0000 [thread overview]
Message-ID: <20260810115343.D2BD31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260810-msm8974-usb3-v1-5-1a47e1185524@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the patch corrects the bit offset for `SSUSB_CTRL_TEST_POWERDOWN` while failing to actually fix the PHY powerdown issue due to a pre-existing copy-paste error that clears the bit instead of setting it. Furthermore, a naive correction of this error will expose a missing cleanup in the init sequence.
--
--- Patch [5]: [PATCH 05/10] phy: qcom-ipq806x-usb: fix the SS PHY TEST_POWERDOWN bit ---
commit c8781c769e4ee40df09815570d904fe2655dc82f
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
phy: qcom-ipq806x-usb: fix the SS PHY TEST_POWERDOWN bit
The SS PHY exit sequence tries to put the PHY into retention via the
TEST_POWERDOWN bit of SS_PHY_CTRL, but defines that bit as BIT(27). In
the DWC3 QSCRATCH SS_PHY_CTRL register TEST_POWERDOWN is bit 26 (see
the downstream phy-msm-ssusb driver for the same IP generation), so the
sequence pokes an unrelated bit and the PHY is never powered down.
> diff --git a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> index 21b59d4ca8d2a..cf77e0a66e20d 100644
> --- a/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> +++ b/drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
> @@ -51,7 +51,7 @@
>
> /* PHY_CTRL_REG */
> #define SSUSB_CTRL_REF_USE_PAD BIT(28)
> -#define SSUSB_CTRL_TEST_POWERDOWN BIT(27)
> +#define SSUSB_CTRL_TEST_POWERDOWN BIT(26)
[Severity: High]
This isn't a bug introduced by this patch, but while correcting the bit
offset for SSUSB_CTRL_TEST_POWERDOWN, the PHY powerdown issue remains
because the exit sequence clears the bit instead of setting it.
Looking at qcom_ipq806x_usb_ss_phy_exit() in
drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c, it calls:
usb_phy_write_readback(phy_dwc3, SSUSB_PHY_CTRL_REG,
SSUSB_CTRL_TEST_POWERDOWN, 0x0);
The usb_phy_write_readback() function clears the masked bits when passed 0x0:
tmp &= ~mask; /* retain other bits */
write_val = tmp | val;
Should the third call in qcom_ipq806x_usb_ss_phy_exit() pass
SSUSB_CTRL_TEST_POWERDOWN as the value to actually set the bit?
Furthermore, if the exit sequence is fixed to set the bit, will the PHY
fail to exit retention on resume? In qcom_ipq806x_usb_ss_phy_init(), the
register is read, modified, and written back without clearing the
TEST_POWERDOWN bit:
data = readl(phy_dwc3->base + SSUSB_PHY_CTRL_REG);
writel(data | SSUSB_CTRL_SS_PHY_RESET,
phy_dwc3->base + SSUSB_PHY_CTRL_REG);
Since data is never updated to clear SSUSB_CTRL_TEST_POWERDOWN, would it
stay set and prevent the PHY from exiting retention mode?
> #define SSUSB_CTRL_LANE0_PWR_PRESENT BIT(24)
> #define SSUSB_CTRL_SS_PHY_EN BIT(8)
> #define SSUSB_CTRL_SS_PHY_RESET BIT(7)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260810-msm8974-usb3-v1-0-1a47e1185524@oss.qualcomm.com?part=5
next prev parent reply other threads:[~2026-08-10 11:53 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
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 [this message]
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=20260810115343.D2BD31F000E9@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