Hi,

This is the 2.4 version of a fix that's been in 2.4 for some
time now:  when an HCD dies a premature death, its cleanup
needs to be done in a task context.  The most likely case for
that would be physical cardbus eject without driver shutdown.

Please merge.

- Dave
--- 1.13/drivers/usb/hcd.c      Sun Feb 16 06:50:23 2003
+++ edited/drivers/usb/hcd.c    Mon Mar  3 10:39:10 2003
@@ -935,6 +935,12 @@
 
 /*-------------------------------------------------------------------------*/
 
+static void hcd_panic (void *_hcd)
+{
+       struct usb_hcd *hcd = _hcd;
+       hcd->driver->stop (hcd);
+}
+
 static void hc_died (struct usb_hcd *hcd)
 {
        struct list_head        *devlist, *urblist;
@@ -962,7 +968,10 @@
 
        if (urb)
                rh_status_dequeue (hcd, urb);
-       hcd->driver->stop (hcd);
+
+       /* hcd->stop() needs a task context */
+       INIT_TQUEUE (&hcd->work, hcd_panic, hcd);
+       (void) schedule_task (&hcd->work);
 }
 
 /*-------------------------------------------------------------------------*/

--- 1.9/drivers/usb/hcd.h       Mon Jan  6 16:43:04 2003
+++ edited/drivers/usb/hcd.h    Mon Mar  3 10:50:29 2003
@@ -41,6 +41,7 @@
 
        struct timer_list       rh_timer;       /* drives root hub */
        struct list_head        dev_list;       /* devices on this bus */
+       struct tq_struct        work;
 
        /*
         * hardware info/state

Reply via email to