ChangeSet 1.1171, 2003/04/29 15:30:31-07:00, stern@rowland.harvard.edu [PATCH] USB: Minor patch for uhci-hcd.c diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c --- a/drivers/usb/host/uhci-hcd.c Wed Apr 30 13:34:24 2003 +++ b/drivers/usb/host/uhci-hcd.c Wed Apr 30 13:34:24 2003 @@ -1283,7 +1283,8 @@ } if (last_urb) { - *end = (last_urb->start_frame + last_urb->number_of_packets) & 1023; + *end = (last_urb->start_frame + last_urb->number_of_packets * + last_urb->interval) & (UHCI_NUMFRAMES-1); ret = 0; } else ret = -1; /* no previous urb found */ @@ -1933,9 +1934,10 @@ dbg("%x: suspend_hc", io_addr); - outw(USBCMD_EGSM, io_addr + USBCMD); - uhci->is_suspended = 1; + smp_wmb(); + + outw(USBCMD_EGSM, io_addr + USBCMD); } static void wakeup_hc(struct uhci_hcd *uhci) @@ -1945,6 +1947,9 @@ dbg("%x: wakeup_hc", io_addr); + /* Global resume for 20ms */ + outw(USBCMD_FGR | USBCMD_EGSM, io_addr + USBCMD); + wait_ms(20); outw(0, io_addr + USBCMD); /* wait for EOP to be sent */ @@ -1965,7 +1970,7 @@ int i; for (i = 0; i < uhci->rh_numports; i++) - connection |= (inw(io_addr + USBPORTSC1 + i * 2) & 0x1); + connection |= (inw(io_addr + USBPORTSC1 + i * 2) & USBPORTSC_CCS); return connection; }