Commit 7cbe5bbe authored by Paul Mackerras's avatar Paul Mackerras Committed by Greg Kroah-Hartman

[PATCH] USB root hub polling and suspend

Currently with 2.5, when I suspend and resume my powerbook, I find
that the USB subsystem no longer sees root hub events, i.e. it doesn't
notice when I plug in a new USB device (it doesn't notice when I
unplug a device either but of course the driver for the device sees
that it is no longer responding).

It turns out that what happens is that the root hub timer goes off
after the OHCI driver has done its suspend stuff.  The timer routine
sees that the HCD is not running at the moment and doesn't schedule
another timeout.  Hence the series of timeouts stops.
parent 89c43fb6
......@@ -454,7 +454,6 @@ static int rh_status_urb (struct usb_hcd *hcd, struct urb *urb)
/* rh_timer protected by hcd_data_lock */
if (timer_pending (&hcd->rh_timer)
|| urb->status != -EINPROGRESS
|| !HCD_IS_RUNNING (hcd->state)
|| urb->transfer_buffer_length < len) {
dbg ("not queuing status urb, stat %d", urb->status);
return -EINVAL;
......@@ -508,8 +507,12 @@ static void rh_report_status (unsigned long ptr)
BUG ();
}
spin_unlock_irqrestore (&hcd_data_lock, flags);
} else
} else {
spin_unlock_irqrestore (&urb->lock, flags);
spin_lock_irqsave (&hcd_data_lock, flags);
rh_status_urb (hcd, urb);
spin_unlock_irqrestore (&hcd_data_lock, flags);
}
} else {
/* this urb's been unlinked */
urb->hcpriv = 0;
......
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