[PATCH v18 5/7] phy: rockchip: usbdp: Re-init PHY on mux change
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Nov 19 11:54:54 PST 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] phy: rockchip: usbdp: missing PHY re-init in
rk_udphy_orien_sw_set()
--
commit d39ec87ebe55de6d04fd645f2dc5add42612f593
Author: Sebastian Reichel <sebastian.reichel at collabora.com>
phy: rockchip: usbdp: Re-init PHY on mux change
This commit calls rk_udphy_update_power_state() in rk_udphy_typec_mux_set()
to re-initialize the PHY when the Type-C mux state changes.
> diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
> index 140bec887a5ef..e4bbcb4edeae6 100644
> --- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
> +++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
> @@ -1438,7 +1438,7 @@ static int rk_udphy_typec_mux_set(struct typec_mux_dev *mux,
>
> rk_udphy_set_typec_state(udphy, state->mode);
>
> - return 0;
> + return rk_udphy_update_power_state(udphy);
> }
>
> static void rk_udphy_typec_mux_unregister(void *data)
[Severity: Medium]
Should rk_udphy_orien_sw_set() also call rk_udphy_update_power_state()?
When cable orientation changes, rk_udphy_orien_sw_set() sets
udphy->phy_needs_reinit = true and updates udphy->lane_mux_sel and
udphy->hw_mode via rk_udphy_set_typec_default_mapping(), but returns 0
without re-initializing the PHY:
drivers/phy/rockchip/phy-rockchip-usbdp.c:rk_udphy_orien_sw_set() {
...
if (udphy->flip != flipped) {
dev_dbg(udphy->dev, "cable orientation changed, PHY re-init required.\n");
udphy->phy_needs_reinit = true;
}
udphy->flip = flipped;
rk_udphy_set_typec_default_mapping(udphy);
rk_udphy_usb_bvalid_enable(udphy, true);
return 0;
}
On boards that specify orientation-switch without mode-switch (such as
rk3588-jaguar.dts), or with Type-C controller drivers that do not call
typec_set_mode() after typec_set_orientation(), rk_udphy_typec_mux_set()
is not invoked after the orientation change and the PHY is never
re-initialized for the new lane mapping.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-b4-rockchip-usbdp-cleanup-part3-v18-0-fb325e336494@collabora.com?part=5
More information about the linux-phy
mailing list