[PATCH v11 28/36] phy: rockchip: usbdp: Only enable USB3 when not in high-speed mode
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Jul 9 12:35:16 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The USB3 port is unconditionally disabled during PHY re-initialization but never re-enabled, permanently breaking USB3 functionality after a mode change.
--
--- Patch [28]: [PATCH v11 28/36] phy: rockchip: usbdp: Only enable USB3 when not in high-speed mode ---
commit f42d06c6d124fe98eab8964760884de8f170d304
Author: Sebastian Reichel <sebastian.reichel at collabora.com>
phy: rockchip: usbdp: Only enable USB3 when not in high-speed mode
Ensure that USB3 mode is not accidently enabled during PHY re-init
for systems that are configured as high-speed only via DT.
Closes: https://sashiko.dev/#/message/20260626212424.C215E1F000E9%40smtp.kernel.org
> diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
> --- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
> +++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
> @@ -1009,7 +1009,7 @@ static int rk_udphy_power_on(struct rk_udphy *udphy, u8 mode)
> if (ret)
> return ret;
>
> - if (udphy->mode & UDPHY_MODE_USB)
> + if (!udphy->hs && udphy->mode & UDPHY_MODE_USB)
> rk_udphy_u3_port_disable(udphy, false);
> udphy->phy_needs_reinit = false;
> } else if (udphy->phy_needs_reinit) {
> rk_udphy_u3_port_disable(udphy, true);
> udelay(10);
>
> ret = rk_udphy_init(udphy);
> if (ret)
> return ret;
> udphy->phy_needs_reinit = false;
> }
[Severity: High]
This is a pre-existing issue, but does this missing re-enablement permanently
break USB3 functionality after a mode change?
If the PHY is already active and a mode change occurs (such as plugging
in a DP monitor or a Type-C cable flip), udphy->phy_needs_reinit is set
to true.
When rk_udphy_power_on() is subsequently called, the U3 port is disabled
in this branch to avoid xHCI SErrors, but there is no corresponding call to
rk_udphy_u3_port_disable(udphy, false) to restore it after rk_udphy_init()
completes.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260709-rockchip-usbdp-cleanup-v11-0-a149ac60f76c@collabora.com?part=28
More information about the linux-phy
mailing list