On Mon, 20 Mar 2006, Willi Mann wrote:

> Currently, I can only reproduce the bug if my mouse and my keyboard are 
> plugged differently as to the last "boot". I'm not sure if that's always 
> the case. However, the log shows the -71 error also when the keyboard 
> worked (maybe it's from the mouse). Should I try to track down more 
> exaclty in which cases it works and it which cases it doesn't work? Or 
> does the logfile tell you enough?

I can't tell exactly how this happened.  It's connected with the fact that 
you switched the USB cable to a different port while the computer was 
asleep.  For some reason the UHCI controller thought the newly-connected 
port was suspended while the driver thought it wasn't.

This patch should fix the problem.  If it doesn't, send another kernel log 
like this one.

Alan Stern


Index: usb-2.6/drivers/usb/host/uhci-hub.c
===================================================================
--- usb-2.6.orig/drivers/usb/host/uhci-hub.c
+++ usb-2.6/drivers/usb/host/uhci-hub.c
@@ -85,18 +85,18 @@ static void uhci_finish_suspend(struct u
 {
        int status;
 
+       CLR_RH_PORTSTAT(USBPORTSC_SUSP | USBPORTSC_RD);
        if (test_bit(port, &uhci->suspended_ports)) {
-               CLR_RH_PORTSTAT(USBPORTSC_SUSP | USBPORTSC_RD);
                clear_bit(port, &uhci->suspended_ports);
-               clear_bit(port, &uhci->resuming_ports);
                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);
        }
+       clear_bit(port, &uhci->resuming_ports);
+
+       /* 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_ports(struct uhci_hcd *uhci)
@@ -322,8 +322,11 @@ static int uhci_hub_control(struct usb_h
                        CLR_RH_PORTSTAT(USBPORTSC_PEC);
                        OK(0);
                case USB_PORT_FEAT_SUSPEND:
-                       if (test_bit(port, &uhci->suspended_ports) &&
-                                       !test_and_set_bit(port,
+                       if (!test_bit(port, &uhci->suspended_ports)) {
+
+                               /* Make certain the port isn't suspended */
+                               uhci_finish_suspend(uhci, port, port_addr);
+                       } else if (!test_and_set_bit(port,
                                                &uhci->resuming_ports)) {
                                SET_RH_PORTSTAT(USBPORTSC_RD);
 



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to