* [PATCH v3 1/3] phy: exynos5-usbdrd: power the Exynos2200 phy down when its init fails
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 ` 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-14 6:44 ` [PATCH v3 3/3] phy: exynos5-usbdrd: fix HS phy init count imbalance on Exynos2200 Soheyb Boulaa
2 siblings, 1 reply; 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, stable
exynos2200_usbdrd_phy_init() enables the regulators of the UTMI phy and
takes the phy out of isolation in the PMU before it enables the clocks.
When clk_bulk_prepare_enable() fails, it returns without undoing
either. The phy core does not count a failed init, so no exit undoes
them later: the phy stays out of isolation, and its supplies stay
enabled, until an init and an exit succeed.
Isolate the phy again and disable the UTMI regulators when the clocks
or the phy-specific init fail. The phy-specific init does not fail yet;
the next patch makes the UTMI init return the result of the init of the
high-speed phy.
Fixes: cc52a697f87e ("phy: exynos5-usbdrd: support Exynos USBDRD 3.2 4nm controller")
Cc: stable@vger.kernel.org
Signed-off-by: Soheyb Boulaa <soheyb_boulaa@proton.me>
---
v3: full name in From and Signed-off-by.
v2: new patch.
drivers/phy/samsung/phy-exynos5-usbdrd.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c
index 087d552..a6fe779 100644
--- a/drivers/phy/samsung/phy-exynos5-usbdrd.c
+++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c
@@ -1462,7 +1462,7 @@ static int exynos2200_usbdrd_phy_init(struct phy *phy)
ret = clk_bulk_prepare_enable(phy_drd->drv_data->n_clks, phy_drd->clks);
if (ret)
- return ret;
+ goto power_down;
/* Set up the link controller */
exynos2200_usbdrd_link_init(phy_drd);
@@ -1475,6 +1475,17 @@ static int exynos2200_usbdrd_phy_init(struct phy *phy)
clk_bulk_disable_unprepare(phy_drd->drv_data->n_clks, phy_drd->clks);
+ if (ret)
+ goto power_down;
+
+ return 0;
+
+power_down:
+ exynos5_usbdrd_phy_isol(inst, true);
+ if (inst->phy_cfg->id == EXYNOS5_DRDPHY_UTMI)
+ regulator_bulk_disable(phy_drd->drv_data->n_regulators,
+ phy_drd->regulators);
+
return ret;
}
--
2.56.0
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3 1/3] phy: exynos5-usbdrd: power the Exynos2200 phy down when its init fails
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
0 siblings, 0 replies; 7+ messages in thread
From: Manivannan Sadhasivam @ 2026-11-27 13:51 UTC (permalink / raw)
To: Soheyb Boulaa
Cc: Vinod Koul, Krzysztof Kozlowski, Neil Armstrong,
Manivannan Sadhasivam, Peter Griffin, Alim Akhtar, Ivaylo Ivanov,
linux-phy, linux-arm-kernel, linux-samsung-soc, linux-kernel,
stable
On 2026-11-14 06:44 +0000, Soheyb Boulaa wrote:
> exynos2200_usbdrd_phy_init() enables the regulators of the UTMI phy and
> takes the phy out of isolation in the PMU before it enables the clocks.
> When clk_bulk_prepare_enable() fails, it returns without undoing
> either. The phy core does not count a failed init, so no exit undoes
> them later: the phy stays out of isolation, and its supplies stay
> enabled, until an init and an exit succeed.
>
> Isolate the phy again and disable the UTMI regulators when the clocks
> or the phy-specific init fail. The phy-specific init does not fail yet;
> the next patch makes the UTMI init return the result of the init of the
Then add the error handling in next patch.
> high-speed phy.
>
> Fixes: cc52a697f87e ("phy: exynos5-usbdrd: support Exynos USBDRD 3.2 4nm controller")
> Cc: stable@vger.kernel.org
This patch is not a critical fix to backport. Please drop the tag.
> Signed-off-by: Soheyb Boulaa <soheyb_boulaa@proton.me>
> ---
> v3: full name in From and Signed-off-by.
> v2: new patch.
>
> drivers/phy/samsung/phy-exynos5-usbdrd.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c
> index 087d552..a6fe779 100644
> --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c
> +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c
> @@ -1462,7 +1462,7 @@ static int exynos2200_usbdrd_phy_init(struct phy *phy)
>
> ret = clk_bulk_prepare_enable(phy_drd->drv_data->n_clks, phy_drd->clks);
> if (ret)
> - return ret;
> + goto power_down;
>
> /* Set up the link controller */
> exynos2200_usbdrd_link_init(phy_drd);
> @@ -1475,6 +1475,17 @@ static int exynos2200_usbdrd_phy_init(struct phy *phy)
>
> clk_bulk_disable_unprepare(phy_drd->drv_data->n_clks, phy_drd->clks);
>
> + if (ret)
> + goto power_down;
Is there a logic in doing the error check here?
- Mani
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 2/3] phy: exynos5-usbdrd: return the Exynos2200 high-speed phy init error
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-14 6:44 ` 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
2 siblings, 1 reply; 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, Sashiko, stable
exynos2200_usbdrd_utmi_init() ignores the result of phy_init() on the
high-speed phy and returns 0. When the high-speed phy fails to
initialize, the UTMI phy thus counts as initialized, and the controller
goes on with a high-speed phy that is not set up.
Return the result of phy_init(), so that a failed init of the
high-speed phy fails the init of the UTMI phy. The next patch, which
exits the high-speed phy with the UTMI phy, relies on it: an exit after
a failed init would otherwise take the init count of the high-speed
phy below zero.
Fixes: cc52a697f87e ("phy: exynos5-usbdrd: support Exynos USBDRD 3.2 4nm controller")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/linux-phy/sashiko-outbox-205724@kernel.org/
Cc: stable@vger.kernel.org
Signed-off-by: Soheyb Boulaa <soheyb_boulaa@proton.me>
---
v3: full name in From and Signed-off-by.
v2: new patch, after Sashiko's review of v1.
drivers/phy/samsung/phy-exynos5-usbdrd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c
index a6fe779..cf0597a 100644
--- a/drivers/phy/samsung/phy-exynos5-usbdrd.c
+++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c
@@ -1369,9 +1369,7 @@ static const struct phy_ops exynos7870_usbdrd_phy_ops = {
static int exynos2200_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd)
{
/* Configure non-Samsung IP PHY, responsible for UTMI */
- phy_init(phy_drd->hs_phy);
-
- return 0;
+ return phy_init(phy_drd->hs_phy);
}
static void exynos2200_usbdrd_link_init(struct exynos5_usbdrd_phy *phy_drd)
--
2.56.0
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3 2/3] phy: exynos5-usbdrd: return the Exynos2200 high-speed phy init error
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
0 siblings, 0 replies; 7+ messages in thread
From: Manivannan Sadhasivam @ 2026-11-27 13:52 UTC (permalink / raw)
To: Soheyb Boulaa
Cc: Vinod Koul, Krzysztof Kozlowski, Neil Armstrong,
Manivannan Sadhasivam, Peter Griffin, Alim Akhtar, Ivaylo Ivanov,
linux-phy, linux-arm-kernel, linux-samsung-soc, linux-kernel,
Sashiko, stable
On 2026-11-14 06:44 +0000, Soheyb Boulaa wrote:
> exynos2200_usbdrd_utmi_init() ignores the result of phy_init() on the
> high-speed phy and returns 0. When the high-speed phy fails to
> initialize, the UTMI phy thus counts as initialized, and the controller
> goes on with a high-speed phy that is not set up.
>
> Return the result of phy_init(), so that a failed init of the
> high-speed phy fails the init of the UTMI phy. The next patch, which
> exits the high-speed phy with the UTMI phy, relies on it: an exit after
> a failed init would otherwise take the init count of the high-speed
> phy below zero.
>
> Fixes: cc52a697f87e ("phy: exynos5-usbdrd: support Exynos USBDRD 3.2 4nm controller")
> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Closes: https://lore.kernel.org/linux-phy/sashiko-outbox-205724@kernel.org/
> Cc: stable@vger.kernel.org
Drop the tag please.
> Signed-off-by: Soheyb Boulaa <soheyb_boulaa@proton.me>
With tag dropped,
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
- Mani
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 3/3] phy: exynos5-usbdrd: fix HS phy init count imbalance on Exynos2200
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-14 6:44 ` [PATCH v3 2/3] phy: exynos5-usbdrd: return the Exynos2200 high-speed phy init error Soheyb Boulaa
@ 2026-11-14 6:44 ` Soheyb Boulaa
2026-11-27 13:54 ` Manivannan Sadhasivam
2 siblings, 1 reply; 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, stable
exynos2200_usbdrd_utmi_init() calls phy_init() on the high-speed phy,
but exynos2200_usbdrd_phy_exit() never calls phy_exit() on it. The init
count of the high-speed phy therefore never drops back to zero: after
the first init, every later phy_init() of it returns early, and its
clocks and supplies stay enabled across an exit of the UTMI phy.
When the high-speed phy loses power while the controller is suspended,
it is thus not set up again on resume, and the DWC3 core soft reset
times out:
dwc3 11210000.usb: DWC3 controller soft reset failed
Exit the high-speed phy when the UTMI phy exits, last, once the rest of
the exit has succeeded: the phy core counts a failed exit as no exit,
so the high-speed phy has to stay initialized along with the UTMI phy.
Fixes: cc52a697f87e ("phy: exynos5-usbdrd: support Exynos USBDRD 3.2 4nm controller")
Cc: stable@vger.kernel.org
Signed-off-by: Soheyb Boulaa <soheyb_boulaa@proton.me>
---
v3: full name in From and Signed-off-by.
v2: the high-speed phy exits last, once the rest of the exit has
succeeded, after Sashiko's review of v1; v1 exited it first. The comment
is dropped, after Ivaylo's review of v1. His Acked-by of v1 is left
out, since the exit has moved.
drivers/phy/samsung/phy-exynos5-usbdrd.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c
index cf0597a..041a555 100644
--- a/drivers/phy/samsung/phy-exynos5-usbdrd.c
+++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c
@@ -1510,8 +1510,15 @@ static int exynos2200_usbdrd_phy_exit(struct phy *phy)
clk_bulk_disable_unprepare(phy_drd->drv_data->n_clks, phy_drd->clks);
exynos5_usbdrd_phy_isol(inst, true);
- return regulator_bulk_disable(phy_drd->drv_data->n_regulators,
- phy_drd->regulators);
+ ret = regulator_bulk_disable(phy_drd->drv_data->n_regulators,
+ phy_drd->regulators);
+ if (ret)
+ return ret;
+
+ if (inst->phy_cfg->id == EXYNOS5_DRDPHY_UTMI)
+ return phy_exit(phy_drd->hs_phy);
+
+ return 0;
}
static const struct phy_ops exynos2200_usbdrd_phy_ops = {
--
2.56.0
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3 3/3] phy: exynos5-usbdrd: fix HS phy init count imbalance on Exynos2200
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
0 siblings, 0 replies; 7+ messages in thread
From: Manivannan Sadhasivam @ 2026-11-27 13:54 UTC (permalink / raw)
To: Soheyb Boulaa
Cc: Vinod Koul, Krzysztof Kozlowski, Neil Armstrong,
Manivannan Sadhasivam, Peter Griffin, Alim Akhtar, Ivaylo Ivanov,
linux-phy, linux-arm-kernel, linux-samsung-soc, linux-kernel,
stable
On 2026-11-14 06:44 +0000, Soheyb Boulaa wrote:
> exynos2200_usbdrd_utmi_init() calls phy_init() on the high-speed phy,
> but exynos2200_usbdrd_phy_exit() never calls phy_exit() on it. The init
> count of the high-speed phy therefore never drops back to zero: after
> the first init, every later phy_init() of it returns early, and its
> clocks and supplies stay enabled across an exit of the UTMI phy.
>
> When the high-speed phy loses power while the controller is suspended,
> it is thus not set up again on resume, and the DWC3 core soft reset
> times out:
>
> dwc3 11210000.usb: DWC3 controller soft reset failed
>
> Exit the high-speed phy when the UTMI phy exits, last, once the rest of
> the exit has succeeded: the phy core counts a failed exit as no exit,
> so the high-speed phy has to stay initialized along with the UTMI phy.
>
> Fixes: cc52a697f87e ("phy: exynos5-usbdrd: support Exynos USBDRD 3.2 4nm controller")
> Cc: stable@vger.kernel.org
> Signed-off-by: Soheyb Boulaa <soheyb_boulaa@proton.me>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
- Mani
^ permalink raw reply [flat|nested] 7+ messages in thread