[PATCH v9 38/38] phy: rockchip: usbdp: Power optimizations

sashiko-bot at kernel.org sashiko-bot at kernel.org
Wed Jul 1 17:06:00 PDT 2026


Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] DP-only PHY initialization will always fail with a timeout because `rk_udphy_status_check()` was not updated to use the new `mode` parameter, causing it to poll uninitialized USB PLLs.
--

commit dfd202b9c15655907ae97e937e85e69b72eb2e33
Author: Sebastian Reichel <sebastian.reichel at collabora.com>

phy: rockchip: usbdp: Power optimizations

This patch changes the initialization routine to request power only
for software requested modes rather than all hardware supported modes.
This reduces wasted power when certain ports are not in use.

> diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
> index d056da53cb1c8..7f90f666076c3 100644
> --- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
> +++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
[ ... ]
> @@ -837,7 +837,7 @@ static int rk_udphy_init(struct rk_udphy *udphy)
>  	udelay(1);
>  
>  	/*  Step 5: deassert cmn/lane rstn */
> -	if (udphy->hw_mode & UDPHY_MODE_USB) {
> +	if (mode & UDPHY_MODE_USB) {
>  		ret = rk_udphy_reset_deassert(udphy, "cmn");
>  		if (ret)
>  			goto assert_resets;

[Severity: High]
Does this cause DP-only initialization to fail with a timeout?

Because rk_udphy_status_check() wasn't updated to take the new mode
parameter, it still checks udphy->hw_mode & UDPHY_MODE_USB:

drivers/phy/rockchip/phy-rockchip-usbdp.c:rk_udphy_status_check() {
	...
	if (udphy->hw_mode & UDPHY_MODE_USB) {
		ret = regmap_read_poll_timeout(udphy->pma_regmap, CMN_ANA_LCPLL_DONE_OFFSET,
	...
}

If software requests DP-only mode, the USB resets are safely left asserted
here in rk_udphy_init().

However, when rk_udphy_init() later calls rk_udphy_status_check(), it will
still try to poll the uninitialized USB LCPLL because hw_mode still supports
USB. This will inevitably time out after 100ms and cause the entire DP
initialization to abort.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260702-rockchip-usbdp-cleanup-v9-0-e31efbb62d2e@collabora.com?part=38



More information about the linux-phy mailing list