Commit a31a942a authored by Daniel Mack's avatar Daniel Mack Committed by Felipe Balbi

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: default avatarDaniel Mack <zonque@gmail.com>
Cc: stable@vger.kernel.org [3.14]
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 2656c9e2
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/delay.h>
#include "am35x-phy-control.h" #include "am35x-phy-control.h"
struct am335x_control_usb { struct am335x_control_usb {
...@@ -86,6 +87,14 @@ static void am335x_phy_power(struct phy_control *phy_ctrl, u32 id, bool on) ...@@ -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); 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 = { static const struct phy_control ctrl_am335x = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment