[PATCH v2 2/9] phy: rockchip: usbdp: Keep clocks running on PHY re-init
Sebastian Reichel
sebastian.reichel at collabora.com
Fri Feb 13 06:39:25 PST 2026
When a mode change is required rk_udphy_power_on() disables the clocks
and then calls rk_udphy_setup(), which then enables all the clocks again
before continuing with rk_udphy_init().
Considering that rk_udphy_init() does assert the reset lines, re-enabling
the clocks is just delaying things. Avoid it by directly calling
rk_udphy_init() and skip the clock restart.
Keeping the time with non-working PHY on re-init as short as possible
helps (but does not fix!) a race-condition: The USB3 controller needs
the PHY running to access its registers. With the PHY stopped, accessing
the USB3 registers results in an SError. The re-init is usually
triggered by the DisplayPort controller driver requesting the DP's side
of the PHY. If the USB controller is already running at that point
(which is usually the case), the system can run into the SError.
A proper fix requires some API to lock/pause the USB controller from
the PHY side, which is a bigger change. Luckily this workaround, whichis
sensible anyways, I didn't manage to run into the SError. This is
most likely due to the fact that the DP driver will enable the DP PHY
directly after the USB-C cable is plugged in, before the USB driver is
aware of new devices being available.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Signed-off-by: Sebastian Reichel <sebastian.reichel at collabora.com>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index 744cc7c642f4..98562a888b42 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -1012,8 +1012,7 @@ static int rk_udphy_power_on(struct rk_udphy *udphy, u8 mode)
if (udphy->mode == UDPHY_MODE_DP)
rk_udphy_u3_port_disable(udphy, true);
- rk_udphy_disable(udphy);
- ret = rk_udphy_setup(udphy);
+ ret = rk_udphy_init(udphy);
if (ret)
return ret;
}
--
2.51.0
More information about the Linux-rockchip
mailing list