linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: samsung: s5pv210-usb2: Add delay after reset
@ 2020-04-25 17:36 Jonathan Bakker
  2020-04-27 12:40 ` Kishon Vijay Abraham I
  2020-05-13  2:20 ` Kishon Vijay Abraham I
  0 siblings, 2 replies; 5+ messages in thread
From: Jonathan Bakker @ 2020-04-25 17:36 UTC (permalink / raw)
  To: linux-kernel, kishon, s.nawrocki, kamil, krzk, linux-samsung-soc
  Cc: Jonathan Bakker

The USB phy takes some time to reset, so make sure we give it to it. The
delay length was taken from the 4x12 phy driver.

This manifested in issues with the DWC2 driver since commit fe369e1826b3
("usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic.")
where the endianness check would read the DWC ID as 0 due to the phy still
resetting, resulting in the wrong endian mode being chosen.

Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
---
 drivers/phy/samsung/phy-s5pv210-usb2.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/phy/samsung/phy-s5pv210-usb2.c b/drivers/phy/samsung/phy-s5pv210-usb2.c
index 56a5083fe6f9..32be62e49804 100644
--- a/drivers/phy/samsung/phy-s5pv210-usb2.c
+++ b/drivers/phy/samsung/phy-s5pv210-usb2.c
@@ -139,6 +139,10 @@ static void s5pv210_phy_pwr(struct samsung_usb2_phy_instance *inst, bool on)
 		udelay(10);
 		rst &= ~rstbits;
 		writel(rst, drv->reg_phy + S5PV210_UPHYRST);
+		/* The following delay is necessary for the reset sequence to be
+		 * completed
+		 */
+		udelay(80);
 	} else {
 		pwr = readl(drv->reg_phy + S5PV210_UPHYPWR);
 		pwr |= phypwr;
-- 
2.20.1


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

end of thread, other threads:[~2020-05-13  2:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25 17:36 [PATCH] phy: samsung: s5pv210-usb2: Add delay after reset Jonathan Bakker
2020-04-27 12:40 ` Kishon Vijay Abraham I
2020-04-28 21:50   ` Jonathan Bakker
     [not found]   ` <f8e8aa73-15bb-9bbd-d983-cba12528ba01@live.ca>
2020-05-09  2:37     ` Jonathan Bakker
2020-05-13  2:20 ` Kishon Vijay Abraham I

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).