[PATCH] usb_storage: make usb-stor-scan task non-freezable

From: Seth Forshee
Date: Thu Jul 14 2011 - 00:02:48 EST

The usb-stor-scan task is freezable, but the code in
quiesce_and_remove_host() that waits for scanning to complete is
not. This can cause task freezing to fail, which is happening
consistently on at least one model of netbook with a built-in USB
card reader when freezing tasks prior to restoring a hibernation

This patch makes the usb-stor-scan task non-freezable to prevent
this from happening. Tested across 200 S4 cycles without a single
failure to freeze tasks.

Signed-off-by: Seth Forshee <seth.forshee@xxxxxxxxxxxxx>
drivers/usb/storage/usb.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 0ca0958..f59fc90 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -831,12 +831,11 @@ static int usb_stor_scan_thread(void * __us)

dev_dbg(dev, "device found\n");

- set_freezable();
/* Wait for the timeout to expire or for a disconnect */
if (delay_use > 0) {
dev_dbg(dev, "waiting for device to settle "
"before scanning\n");
- wait_event_freezable_timeout(us->delay_wait,
+ wait_event_interruptible_timeout(us->delay_wait,
test_bit(US_FLIDX_DONT_SCAN, &us->dflags),
delay_use * HZ);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/