Commit 00c5c968 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Greg Kroah-Hartman

staging: hikey9xx: phy-hi3670-usb3: adjust retry logic

Instead of running a loop up to 100k times, add a small
delay inside it, running it up to 10 times, waiting up
to 100-200 us.

It should be noticed that I don't have the datasheet for
this PHY. So, not sure if this time will cover all
situations.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/b653d7d6073de176598a5026c41b1a845f360c9e.1611052729.git.mchehab+huawei@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a346129e
...@@ -185,7 +185,7 @@ static int hi3670_phy_cr_start(struct regmap *usb31misc, int direction) ...@@ -185,7 +185,7 @@ static int hi3670_phy_cr_start(struct regmap *usb31misc, int direction)
static int hi3670_phy_cr_wait_ack(struct regmap *usb31misc) static int hi3670_phy_cr_wait_ack(struct regmap *usb31misc)
{ {
u32 reg; u32 reg;
int retry = 100000; int retry = 10;
int ret; int ret;
while (retry-- > 0) { while (retry-- > 0) {
...@@ -198,6 +198,8 @@ static int hi3670_phy_cr_wait_ack(struct regmap *usb31misc) ...@@ -198,6 +198,8 @@ static int hi3670_phy_cr_wait_ack(struct regmap *usb31misc)
ret = hi3670_phy_cr_clk(usb31misc); ret = hi3670_phy_cr_clk(usb31misc);
if (ret) if (ret)
return ret; return ret;
usleep_range(10, 20);
} }
return -ETIMEDOUT; return -ETIMEDOUT;
......
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