mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/3] phy: exynos5-usbdrd: fix HS phy init count on Exynos2200
@ 2026-11-14  6:44 Soheyb Boulaa
  2026-11-14  6:44 ` [PATCH v3 1/3] phy: exynos5-usbdrd: power the Exynos2200 phy down when its init fails Soheyb Boulaa
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Soheyb Boulaa @ 2026-11-14  6:44 UTC (permalink / raw)
  To: Vinod Koul, Krzysztof Kozlowski
  Cc: Neil Armstrong, Manivannan Sadhasivam, Peter Griffin,
	Alim Akhtar, Ivaylo Ivanov, linux-phy, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, Soheyb Boulaa

The UTMI phy of Exynos2200 initializes the high-speed (eUSB2) phy but
never exits it, so the high-speed phy is not set up again after it lost
power in system sleep (patch 3, v1 [1]).

Sashiko's review of v1 [2] found two error paths that v1 leaves wrong: a
failed init of the high-speed phy is ignored, so the exit that follows
takes its init count below zero; and the high-speed phy exits before
the steps of the UTMI exit that can fail, so a failed exit leaves the
UTMI phy initialized and the high-speed phy not. Patch 2 returns the
init error, and patch 3 exits the high-speed phy last. Patch 1 undoes
the UTMI init when it fails, which its clocks path already lacks and
which patch 2 makes reachable from the high-speed phy.

Changes in v3:
- full name in From and Signed-off-by, as Vinod asked [3]; no code
  change
- Link to v2: https://lore.kernel.org/all/20261111032309.3365794-1-soheyb_boulaa@proton.me/

Changes in v2:
- patch 1, new: undo the init on failure
- patch 2, new: return the init error of the high-speed phy
- patch 3: exit the high-speed phy last, once the rest of the exit has
  succeeded; drop the comment (Ivaylo); his Acked-by of v1 is left
  out, since the exit has moved

Tested on a Google Pixel 9 (Tensor G4), an out-of-tree port on 7.3-rc7
that uses the Exynos2200 phy ops and powers USB off in system sleep:
USB comes back after each sleep, and with each error path forced by a
test-only switch, both init counts stay balanced. Not tested on
Exynos2200 hardware, nor built in linux-phy next as a whole.

[1] https://lore.kernel.org/all/20261109221522.2796426-1-soheyb_boulaa@proton.me/
[2] https://lore.kernel.org/linux-phy/sashiko-outbox-205724@kernel.org/
[3] https://lore.kernel.org/linux-phy/avcPwEEAfCstmORh@parshuram/

Soheyb Boulaa (3):
  phy: exynos5-usbdrd: power the Exynos2200 phy down when its init fails
  phy: exynos5-usbdrd: return the Exynos2200 high-speed phy init error
  phy: exynos5-usbdrd: fix HS phy init count imbalance on Exynos2200

 drivers/phy/samsung/phy-exynos5-usbdrd.c | 28 +++++++++++++++++++-----
 1 file changed, 22 insertions(+), 6 deletions(-)

base-commit: 6bdfbe223ed4735073c299a6645ebd3faac3f51f

-- 
2.56.0


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

end of thread, other threads:[~2026-11-27 13:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-14  6:44 [PATCH v3 0/3] phy: exynos5-usbdrd: fix HS phy init count on Exynos2200 Soheyb Boulaa
2026-11-14  6:44 ` [PATCH v3 1/3] phy: exynos5-usbdrd: power the Exynos2200 phy down when its init fails Soheyb Boulaa
2026-11-27 13:51   ` Manivannan Sadhasivam
2026-11-14  6:44 ` [PATCH v3 2/3] phy: exynos5-usbdrd: return the Exynos2200 high-speed phy init error Soheyb Boulaa
2026-11-27 13:52   ` Manivannan Sadhasivam
2026-11-14  6:44 ` [PATCH v3 3/3] phy: exynos5-usbdrd: fix HS phy init count imbalance on Exynos2200 Soheyb Boulaa
2026-11-27 13:54   ` Manivannan Sadhasivam

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

all inboxes | Powered by JetHome®