aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/hikey9xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-01-19 11:44:40 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-26 18:49:20 +0100
commit00c5c96886faeb6d2f3dd4369b9b92eee4d4286a (patch)
treea98cb861341a377bab7bcaafb53f2cf540ecbea0 /drivers/staging/hikey9xx
parentstaging: hikey9xx: phy-hi3670-usb3: use bitfield macros (diff)
downloadlinux-dev-00c5c96886faeb6d2f3dd4369b9b92eee4d4286a.tar.xz
linux-dev-00c5c96886faeb6d2f3dd4369b9b92eee4d4286a.zip
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: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/b653d7d6073de176598a5026c41b1a845f360c9e.1611052729.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/hikey9xx')
-rw-r--r--drivers/staging/hikey9xx/phy-hi3670-usb3.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/hikey9xx/phy-hi3670-usb3.c b/drivers/staging/hikey9xx/phy-hi3670-usb3.c
index 722cabaa9bd9..cffe6c58dfd7 100644
--- a/drivers/staging/hikey9xx/phy-hi3670-usb3.c
+++ b/drivers/staging/hikey9xx/phy-hi3670-usb3.c
@@ -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)
{
u32 reg;
- int retry = 100000;
+ int retry = 10;
int ret;
while (retry-- > 0) {
@@ -198,6 +198,8 @@ static int hi3670_phy_cr_wait_ack(struct regmap *usb31misc)
ret = hi3670_phy_cr_clk(usb31misc);
if (ret)
return ret;
+
+ usleep_range(10, 20);
}
return -ETIMEDOUT;