[PATCH v17 5/7] phy: rockchip: usbdp: Re-init PHY on mux change

sashiko-bot at kernel.org sashiko-bot at kernel.org
Fri Nov 13 18:31:11 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 d6ebe3b4d4e77722fa4249c2e6b90ebd4aab0b90
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() at the end of
rk_udphy_typec_mux_set() so that the PHY is re-initialized 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 fc3c4104dcd7e..b79b6db96a0e6 100644
> --- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
> +++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
> @@ -1434,7 +1434,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);
>  }

[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[] 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 in Device
Tree (or with Type-C controller drivers that call typec_set_orientation()
without a subsequent typec_set_mode()), rk_udphy_typec_mux_set() is not
called after an orientation change, leaving the hardware lane mux register
unprogrammed and USB3 SuperSpeed broken on a flipped cable.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261114-b4-rockchip-usbdp-cleanup-part3-v17-0-1af5f566408e@collabora.com?part=5



More information about the linux-phy mailing list