Commit 289cf6ad authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

[PATCH] USB: new delay helper safe wrt waitqueues

this is a new waiting helper safe even if we are left on a waitqueue.
This version addresses Alan's concerns about ifdefs. Please apply.

  - add delay helper that is safe even if we are still on another waitqueue
parent 331a2d82
......@@ -1483,6 +1483,16 @@ static int usb_device_resume(struct device *dev)
return 0;
}
void usb_uninterruptible_sleep_ms(int msecs)
{
long timeout = msecs_to_jiffies(msecs);
while(timeout) {
set_current_state(TASK_UNINTERRUPTIBLE);
timeout = schedule_timeout(timeout);
}
}
struct bus_type usb_bus_type = {
.name = "usb",
.match = usb_device_match,
......@@ -1600,6 +1610,7 @@ EXPORT_SYMBOL(usb_reset_device);
EXPORT_SYMBOL(usb_disconnect);
EXPORT_SYMBOL(__usb_get_extra_descriptor);
EXPORT_SYMBOL(usb_uninterruptible_sleep_ms);
EXPORT_SYMBOL(usb_find_device);
EXPORT_SYMBOL(usb_get_current_frame_number);
......
......@@ -31,6 +31,8 @@ static __inline__ void wait_ms(unsigned int ms)
mdelay(ms);
}
void usb_uninterruptible_sleep_ms(int msecs);
struct usb_device;
struct usb_driver;
......
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