Skip to contentSkip to conversation

usb: gadget: s3c-hsotg: fix core reset timeout failure

PATCH New Felipe Balbi 2 participants 2 messages Jul 23, 2012 – Jul 24, 2012 1 message not in the archive USB

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

Quoted 38 lines · Changbin

The timeout values were 1000 and timeout issue occurred many times on my

s3c6410 Soc based board (mostly when booting with 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 can 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 10000 is big enough.

Quoted 7 lines

---

Changes for v2:

Fixed wrapped line done by my mail client

now it' s even worse. Please use git send-email instead.

Signature · 1 line
balbi
#2 lore raw

PATCH RESEND v2 1/1 usb: gadget: s3c-hsotg: fix core reset timeout failure

From: "Du, Changbin" <[email protected]>

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.

---
Changes for v2:
Fixed wrapped line done by my mail client

---
 drivers/usb/gadget/s3c-hsotg.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/s3c-hsotg.c +2 -2
index f4abb0e..f3e2234 100644
@@ -2215,7 +2215,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);
@@ -2225,7 +2225,7 @@ static int s3c_hsotg_corereset(struct s3c_hsotg *hsotg)
 		return -EINVAL;
 	}
 
-	timeout = 1000;
+	timeout = 10000;
 
 	while (1) {
 		u32 grstctl = readl(hsotg->regs + GRSTCTL);
Signature · 1 line
1.7.9.5