aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/usb.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2011-11-29 04:51:07 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-11-29 04:51:07 -0500
commit0d2cd91bf7b1a7cc1d638296111fcc2bcf5c0bb4 (patch)
treed2ca69347816c27f9dc352581f5d0fe76811cd49 /drivers/usb/storage/usb.c
parent3d95fd6ad8d3cf582a70ed65660017114b6e4065 (diff)
parentcaca6a03d365883564885f2c1da3e88dcf65d139 (diff)
Merge commit 'v3.2-rc3' into next
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r--drivers/usb/storage/usb.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 0ca095820f3e..c325e69415a1 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -831,12 +831,22 @@ static int usb_stor_scan_thread(void * __us)
831 831
832 dev_dbg(dev, "device found\n"); 832 dev_dbg(dev, "device found\n");
833 833
834 set_freezable(); 834 set_freezable_with_signal();
835 /* Wait for the timeout to expire or for a disconnect */ 835 /*
836 * Wait for the timeout to expire or for a disconnect
837 *
838 * We can't freeze in this thread or we risk causing khubd to
839 * fail to freeze, but we can't be non-freezable either. Nor can
840 * khubd freeze while waiting for scanning to complete as it may
841 * hold the device lock, causing a hang when suspending devices.
842 * So we request a fake signal when freezing and use
843 * interruptible sleep to kick us out of our wait early when
844 * freezing happens.
845 */
836 if (delay_use > 0) { 846 if (delay_use > 0) {
837 dev_dbg(dev, "waiting for device to settle " 847 dev_dbg(dev, "waiting for device to settle "
838 "before scanning\n"); 848 "before scanning\n");
839 wait_event_freezable_timeout(us->delay_wait, 849 wait_event_interruptible_timeout(us->delay_wait,
840 test_bit(US_FLIDX_DONT_SCAN, &us->dflags), 850 test_bit(US_FLIDX_DONT_SCAN, &us->dflags),
841 delay_use * HZ); 851 delay_use * HZ);
842 } 852 }