Commit 114c173d authored by Alan Stern's avatar Alan Stern Committed by Linus Torvalds

[PATCH] USB UHCI: minor bugfix for port resume

This patch fixes two small problems in the port suspend/resume handling
for the UHCI driver.  There were a couple of spots where I neglected to
store I/O addresses in unsigned _long_ variables (required for 64-bit
architectures).  And it turns out the host controller will continue to
indicate a resume is in progress for a few microseconds after it has been
turned off, so an extra delay is needed.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent d84ab56d
...@@ -69,7 +69,7 @@ static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf) ...@@ -69,7 +69,7 @@ static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf)
* FIXME: Synchronize access to these fields by a spinlock. * FIXME: Synchronize access to these fields by a spinlock.
*/ */
static void uhci_finish_suspend(struct uhci_hcd *uhci, int port, static void uhci_finish_suspend(struct uhci_hcd *uhci, int port,
unsigned int port_addr) unsigned long port_addr)
{ {
int status; int status;
...@@ -78,13 +78,19 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port, ...@@ -78,13 +78,19 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port,
clear_bit(port, &uhci->suspended_ports); clear_bit(port, &uhci->suspended_ports);
clear_bit(port, &uhci->resuming_ports); clear_bit(port, &uhci->resuming_ports);
set_bit(port, &uhci->port_c_suspend); set_bit(port, &uhci->port_c_suspend);
/* 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);
} }
} }
static void uhci_check_resume(struct uhci_hcd *uhci) static void uhci_check_resume(struct uhci_hcd *uhci)
{ {
unsigned int port; unsigned int port;
unsigned int port_addr; unsigned long port_addr;
for (port = 0; port < uhci->rh_numports; ++port) { for (port = 0; port < uhci->rh_numports; ++port) {
port_addr = uhci->io_addr + USBPORTSC1 + 2 * port; port_addr = uhci->io_addr + USBPORTSC1 + 2 * port;
......
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