Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: phy: am335x-control: wait 1ms after power-up transitions

Tests have shown that when a power-up transition is followed by other
PHY operations too quickly, the USB port appears dead. Waiting 1ms fixes
this problem.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: stable@vger.kernel.org [3.14]
Signed-off-by: Felipe Balbi <balbi@ti.com>

authored by

Daniel Mack and committed by
Felipe Balbi
a31a942a 2656c9e2

+9
+9
drivers/usb/phy/phy-am335x-control.c
··· 3 3 #include <linux/err.h> 4 4 #include <linux/of.h> 5 5 #include <linux/io.h> 6 + #include <linux/delay.h> 6 7 #include "am35x-phy-control.h" 7 8 8 9 struct am335x_control_usb { ··· 87 86 } 88 87 89 88 writel(val, usb_ctrl->phy_reg + reg); 89 + 90 + /* 91 + * Give the PHY ~1ms to complete the power up operation. 92 + * Tests have shown unstable behaviour if other USB PHY related 93 + * registers are written too shortly after such a transition. 94 + */ 95 + if (on) 96 + mdelay(1); 90 97 } 91 98 92 99 static const struct phy_control ctrl_am335x = {