ARM Sunxi Platform Development
 help / color / mirror / Atom feed
* [PATCH] phy: allwinner: sun4i-usb: disable the PHY2 PMU clock after SIDDQ setup
@ 2026-07-06  9:35 raoxu
  2026-07-06  9:51 ` sashiko-bot
  2026-07-06 10:13 ` Andre Przywara
  0 siblings, 2 replies; 4+ messages in thread
From: raoxu @ 2026-07-06  9:35 UTC (permalink / raw)
  To: vkoul
  Cc: wens, jernej.skrabec, samuel, neil.armstrong, andre.przywara,
	raoxu, marco.crivellari, linux-phy, linux-arm-kernel, linux-sunxi,
	linux-kernel

From: Xu Rao <raoxu@uniontech.com>

sun4i_usb_phy_init() temporarily enables PHY2's clk2 when a SoC needs
PHY2 SIDDQ setup while initializing another PHY. However, after updating
PHY2's PMU register it disables the clk2 pointer from the PHY currently
being initialized.

This leaves PHY2's clk2 enabled and also drops an extra reference from
the current PHY's clk2, causing the prepare/enable accounting to become
unbalanced.

Disable the same PHY2 clk2 that was enabled for the auxiliary PMU access.

Signed-off-by: Xu Rao <raoxu@uniontech.com>
---
 drivers/phy/allwinner/phy-sun4i-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index e2fbf8ccf99e..839856c09e30 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -318,7 +318,7 @@ static int sun4i_usb_phy_init(struct phy *_phy)
 			writel(val, phy2->pmu + REG_HCI_PHY_CTL);
 		}

-		clk_disable_unprepare(phy->clk2);
+		clk_disable_unprepare(phy2->clk2);
 	}

 	if (phy->pmu && data->cfg->hci_phy_ctl_clear) {
--
2.50.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-07  3:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06  9:35 [PATCH] phy: allwinner: sun4i-usb: disable the PHY2 PMU clock after SIDDQ setup raoxu
2026-07-06  9:51 ` sashiko-bot
2026-07-06 10:13 ` Andre Przywara
2026-07-07  3:21   ` Xu Rao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox