Thread (71 messages) 71 messages, 6 authors, 2026-09-01

Re: [PATCH v14 37/38] phy: rockchip: usbdp: Re-init PHY on mux change

From: sashiko-bot@kernel.org
Date: 2026-08-14 06:49:13
Also in: linux-phy

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] rk_udphy_update_power_state() resets the PHY during Type-C mux changes without restoring active DP state, causing permanent loss of the DP link.
--
--- Patch [37]: [PATCH v14 37/38] phy: rockchip: usbdp: Re-init PHY on mux change ---
commit e0f454f6eb0c8216453e00dfe50cf7716c4aa60b
Author: Sebastian Reichel [off-list ref]

phy: rockchip: usbdp: Re-init PHY on mux change

This commit updates the driver to re-initialize the PHY when the mode
changes by replacing a return 0 with a call to rk_udphy_update_power_state().
This ensures the PHY is re-initialized when cable orientation changes or
when switching from DP-only to a mode with USB support.
quoted hunk ↗ jump to hunk
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -1392,7 +1392,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: High]
This is a pre-existing issue, but does forcing rk_udphy_update_power_state()
to run immediately on mux change cause an active DP link to drop permanently?

When the Type-C mux changes (such as plugging a USB device into a hub to
switch from DP-only to DP+USB), rk_udphy_update_power_state() triggers
rk_udphy_init() to reset the PHY.

rk_udphy_init() clears CMN_DP_LANE_EN_ALL, which physically disables the
active DP lanes. While the power state update restores the USB port status,
there appears to be no logic to re-enable the DP lanes via
rk_udphy_dp_lane_enable() or restore DP configurations.

Since subsequent link retraining via phy_configure() does not re-enable the
lanes, the DP link can permanently fail to train until a full DRM modeset
occurs, leaving the display black.

Additionally, does resetting the PHY mid-stream without a reset notification
sequence for DP (unlike the sequence used for USB) risk APB bus lockups
(SErrors) in the DP controller?
 }
 
 static void rk_udphy_typec_mux_unregister(void *data)
-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260813-rockchip-usbdp-cleanup-v14-0-b5ad9c68fa11@collabora.com?part=37
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help