A while ago I saw that "halted, very bad" message, and my system
then wedged when rmmod called a driver disconnect which waited
forever in the UHCI code.

What's supposed to happen is that HCDs mark themselves as dead,
and then usbcore shuts them down cleanly.  OHCI and EHCI did,
or they did last fall; though the logic in that layer is still
not as "obviously correct" as it could be.

I don't think that'll "just work" with UHCI any more than it did
with those drivers, but I thought I'd send this patch along.  It
sets the flag which the HCD glue layer checks (as well as letting
driver model debugging macros be used).

- Dave

--- 1.36/drivers/usb/host/uhci-hcd.c    Mon Jun 30 10:16:34 2003
+++ edited/drivers/usb/host/uhci-hcd.c  Fri Jul 11 20:18:16 2003
@@ -27,6 +27,11 @@
  */
 
 #include <linux/config.h>
+#ifdef CONFIG_USB_DEBUG
+#define DEBUG
+#else
+#undef DEBUG
+#endif
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
@@ -41,11 +46,6 @@
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
 #include <linux/proc_fs.h>
-#ifdef CONFIG_USB_DEBUG
-#define DEBUG
-#else
-#undef DEBUG
-#endif
 #include <linux/usb.h>
 
 #include <asm/uaccess.h>
@@ -1890,7 +1896,7 @@
                        err("%x: host controller process error. something bad 
happened", io_addr);
                if ((status & USBSTS_HCH) && uhci->state > 0) {
                        err("%x: host controller halted. very bad", io_addr);
-                       /* FIXME: Reset the controller, fix the offending TD */
+                       uhci->hcd.state = USB_STATE_HALT;
                }
        }
 

Reply via email to