From 519008c6e5db7cb50587ab195fb15c5e6f7fd26b Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Fri, 11 Aug 2006 11:33:58 -0400 Subject: [PATCH] --- yaml --- r: 36418 b: refs/heads/master c: de06a3b842b31b31220637c869f112cfbc1a5ef6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/uhci-hub.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 2eeb0c0f4317..8b4169ed04e4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 64a21d025d3a979a8715f2ec7acabca7b5406c8a +refs/heads/master: de06a3b842b31b31220637c869f112cfbc1a5ef6 diff --git a/trunk/drivers/usb/host/uhci-hub.c b/trunk/drivers/usb/host/uhci-hub.c index c545ef92fe29..16fb72eb6fc9 100644 --- a/trunk/drivers/usb/host/uhci-hub.c +++ b/trunk/drivers/usb/host/uhci-hub.c @@ -84,6 +84,7 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port, unsigned long port_addr) { int status; + int i; if (inw(port_addr) & (USBPORTSC_SUSP | USBPORTSC_RD)) { CLR_RH_PORTSTAT(USBPORTSC_SUSP | USBPORTSC_RD); @@ -92,9 +93,14 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port, /* The controller won't actually turn off the RD bit until * it has had a chance to send a low-speed EOP sequence, - * which takes 3 bit times (= 2 microseconds). We'll delay - * slightly longer for good luck. */ - udelay(4); + * which is supposed to take 3 bit times (= 2 microseconds). + * Experiments show that some controllers take longer, so + * we'll poll for completion. */ + for (i = 0; i < 10; ++i) { + if (!(inw(port_addr) & USBPORTSC_RD)) + break; + udelay(1); + } } clear_bit(port, &uhci->resuming_ports); }