All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: stm32-usphyc: add mdelay(1) to fix timeout on some machines
@ 2023-01-24 20:45 ` Michael Grzeschik
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Grzeschik @ 2023-01-24 20:45 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-phy, vkoul, kishon, mcoquelin.stm32, alexandre.torgue,
	error27, kernel

An mdelay of 1 seems to be necessary on some machines, since
the monsel status does not seem to be accurate. On rare occasions just
working with the phy after this pll check lead to no functional usb.
With this short mdelay this issue was not reported again.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/phy/st/phy-stm32-usbphyc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c
index 5bb9647b078f12..c452a0caceb9fa 100644
--- a/drivers/phy/st/phy-stm32-usbphyc.c
+++ b/drivers/phy/st/phy-stm32-usbphyc.c
@@ -353,6 +353,15 @@ static int stm32_usbphyc_phy_init(struct phy *phy)
 		goto pll_disable;
 	}
 
+	/* This mdelay seems to be necessary on some machines, since the
+	 * monsel status does not seem to be accurate. On rare occasions
+	 * just working with the phy after this pll check the usb
+	 * peripheral (e.g. on the dwc2) run into timeout issues and
+	 * leading to no functional usb. With this short mdelay this
+	 * issue was not reported again.
+	 */
+	mdelay(1);
+
 	usbphyc_phy->active = true;
 
 	return 0;
-- 
2.30.2


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

end of thread, other threads:[~2023-03-31 13:30 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-24 20:45 [PATCH] phy: stm32-usphyc: add mdelay(1) to fix timeout on some machines Michael Grzeschik
2023-01-24 20:45 ` Michael Grzeschik
2023-02-01 16:20 ` Fabrice Gasnier
2023-02-01 16:20   ` Fabrice Gasnier
2023-02-13 14:59   ` Michael Grzeschik
2023-02-13 14:59     ` Michael Grzeschik
2023-02-16  8:30     ` Fabrice Gasnier
2023-02-16  8:30       ` Fabrice Gasnier
2023-02-27 15:13       ` [PATCH v2] phy: stm32-usphyc: add 200 to 300 us delay " Michael Grzeschik
2023-02-27 15:13         ` Michael Grzeschik
2023-02-28 17:28         ` Fabrice Gasnier
2023-02-28 17:28           ` Fabrice Gasnier
2023-03-10 10:44           ` Michael Grzeschik
2023-03-10 10:44             ` Michael Grzeschik
2023-03-20 12:02             ` Michael Grzeschik
2023-03-20 12:02               ` Michael Grzeschik
2023-03-31 12:06               ` Michael Grzeschik
2023-03-31 12:06                 ` Michael Grzeschik
2023-03-31 13:19                 ` Greg KH
2023-03-31 13:19                   ` Greg KH
2023-03-31 13:27                   ` Vinod Koul
2023-03-31 13:27                     ` Vinod Koul
2023-03-31 13:29         ` Vinod Koul
2023-03-31 13:29           ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.