[PATCH v10 34/36] phy: rockchip: usbdp: Simplify power state handling
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Fri Jul 3 16:58:38 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing USB3 port disable in high-speed mode causes DWC3 SErrors on probe.
--
commit e0219fd5f4d784e78ff969af266e10196367be69
Author: Sebastian Reichel <sebastian.reichel at collabora.com>
phy: rockchip: usbdp: Simplify power state handling
This commit simplifies power state handling by introducing a sw_mode field in
addition to the hw_mode field. This allows the PHY to track hardware-supported
modes, software-requested modes, and the actual hardware status.
> diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
> index e2cd72643a7d7..ca9418fab8f3a 100644
> --- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
> +++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
[ ... ]
> @@ -1288,16 +1311,22 @@ static const struct phy_ops rk_udphy_dp_phy_ops = {
> static int rk_udphy_usb3_phy_init(struct phy *phy)
> {
> struct rk_udphy *udphy = phy_get_drvdata(phy);
> + int ret;
>
> guard(mutex)(&udphy->mutex);
>
> - /* DP only or high-speed, disable U3 port */
> - if (!(udphy->hw_mode & UDPHY_MODE_USB) || udphy->hs) {
> - rk_udphy_u3_port_disable(udphy, true);
> + if (udphy->hs)
> return 0;
[Severity: High]
Does returning early here without disabling the U3 port cause DWC3 SErrors
during probe in high-speed mode?
Previously, this path explicitly called rk_udphy_u3_port_disable(udphy, true)
before returning. By returning early now, we completely bypass
rk_udphy_update_power_state(), which leaves the U3 port enabled. When the
DWC3 controller is probed, this can leave it clocked by the unpowered PHY
instead of the safe UTMI fallback clock, resulting in an SError.
> - }
>
> - return rk_udphy_power_on(udphy, UDPHY_MODE_USB);
> + udphy->sw_mode |= UDPHY_MODE_USB;
> +
> + ret = rk_udphy_update_power_state(udphy);
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260703-rockchip-usbdp-cleanup-v10-0-a392711ca8a9@collabora.com?part=34
More information about the linux-phy
mailing list