Commit 4363e848 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] cleanup after dead hc needs task context

Simple patch to invoke hcd->stop() in task context, as
required.  When Cardbus works again (broken in 2.5.53
unless it's just me), this will get rid of some oopsing
when folk physically eject the device, with no shutdown.
As well as making other "hc died" faults behave better.
parent a08c2ca8
...@@ -1339,6 +1339,12 @@ EXPORT_SYMBOL (usb_hcd_irq); ...@@ -1339,6 +1339,12 @@ EXPORT_SYMBOL (usb_hcd_irq);
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static void hcd_panic (void *_hcd)
{
struct usb_hcd *hcd = _hcd;
hcd->driver->stop (hcd);
}
/** /**
* usb_hc_died - report abnormal shutdown of a host controller (bus glue) * usb_hc_died - report abnormal shutdown of a host controller (bus glue)
* @hcd: pointer to the HCD representing the controller * @hcd: pointer to the HCD representing the controller
...@@ -1371,9 +1377,9 @@ void usb_hc_died (struct usb_hcd *hcd) ...@@ -1371,9 +1377,9 @@ void usb_hc_died (struct usb_hcd *hcd)
urb->status = -ESHUTDOWN; urb->status = -ESHUTDOWN;
spin_unlock_irqrestore (&hcd_data_lock, flags); spin_unlock_irqrestore (&hcd_data_lock, flags);
if (urb) /* hcd->stop() needs a task context */
usb_rh_status_dequeue (hcd, urb); INIT_WORK (&hcd->work, hcd_panic, hcd);
hcd->driver->stop (hcd); (void) schedule_work (&hcd->work);
} }
EXPORT_SYMBOL (usb_hc_died); EXPORT_SYMBOL (usb_hc_died);
...@@ -67,6 +67,7 @@ struct usb_hcd { /* usb_bus.hcpriv points to this */ ...@@ -67,6 +67,7 @@ struct usb_hcd { /* usb_bus.hcpriv points to this */
struct timer_list rh_timer; /* drives root hub */ struct timer_list rh_timer; /* drives root hub */
struct list_head dev_list; /* devices on this bus */ struct list_head dev_list; /* devices on this bus */
struct work_struct work;
/* /*
* hardware info/state * hardware info/state
......
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