Skip to content

Commit

Permalink
usb: gadget: s3c-hsotg: fix core reset timeout failure
Browse files Browse the repository at this point in the history
The timeout values were 1000 and timeout issue occured many times on my
s3c6410 Soc based board (mostly when booting whith USB cable not
connected). This patch increase the values to 10000 to guarantee the
success of reset.

Having set timeout to 10000, I printed the remained timeout values
which could cause timeout issue before this change (tested several
times).
the first timeout value remained:
	timeout = 8079
	timeout = 8079
	timeout = 8078
	timeout = 8081
the second timeout value remained:
	timeout = 7940
	timeout = 7945
	timeout = 7940
	timeout = 7938
Seeing from above values, I think the value 10000 is big enough.

Signed-off-by: Du, Changbin <changbin.du@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Du, Changbin authored and Felipe Balbi committed Aug 23, 2012
1 parent 4fefe9f commit 2868fea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/gadget/s3c-hsotg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2197,7 +2197,7 @@ static int s3c_hsotg_corereset(struct s3c_hsotg *hsotg)
/* issue soft reset */
writel(GRSTCTL_CSftRst, hsotg->regs + GRSTCTL);

timeout = 1000;
timeout = 10000;
do {
grstctl = readl(hsotg->regs + GRSTCTL);
} while ((grstctl & GRSTCTL_CSftRst) && timeout-- > 0);
Expand All @@ -2207,7 +2207,7 @@ static int s3c_hsotg_corereset(struct s3c_hsotg *hsotg)
return -EINVAL;
}

timeout = 1000;
timeout = 10000;

while (1) {
u32 grstctl = readl(hsotg->regs + GRSTCTL);
Expand Down

0 comments on commit 2868fea

Please sign in to comment.