From: Daniel Mack Date: Wed, 16 Apr 2014 15:11:16 +0000 (+0200) Subject: usb: phy: am335x-control: wait 1ms after power-up transitions X-Git-Tag: firefly_0821_release~176^2~3944^2~6^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a31a942a148e0083ce560ffeb54fb60e06ab7201;p=firefly-linux-kernel-4.4.55.git 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 Cc: stable@vger.kernel.org [3.14] Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/phy/phy-am335x-control.c b/drivers/usb/phy/phy-am335x-control.c index d75196ad5f2f..35b6083b7999 100644 --- a/drivers/usb/phy/phy-am335x-control.c +++ b/drivers/usb/phy/phy-am335x-control.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "am35x-phy-control.h" struct am335x_control_usb { @@ -86,6 +87,14 @@ static void am335x_phy_power(struct phy_control *phy_ctrl, u32 id, bool on) } writel(val, usb_ctrl->phy_reg + reg); + + /* + * Give the PHY ~1ms to complete the power up operation. + * Tests have shown unstable behaviour if other USB PHY related + * registers are written too shortly after such a transition. + */ + if (on) + mdelay(1); } static const struct phy_control ctrl_am335x = {