Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264889
b: refs/heads/master
c: f02fe89
h: refs/heads/master
i:
  264887: 8168637
v: v3
  • Loading branch information
Seth Forshee authored and Greg Kroah-Hartman committed Aug 22, 2011
1 parent 5ba3db3 commit 79c48b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 316541bf70281b6c3b501b442b6994c1839776ad
refs/heads/master: f02fe890ece7d695a5744b20525d45312382e6e4
16 changes: 13 additions & 3 deletions trunk/drivers/usb/storage/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,12 +831,22 @@ 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 */
set_freezable_with_signal();
/*
* Wait for the timeout to expire or for a disconnect
*
* We can't freeze in this thread or we risk causing khubd to
* fail to freeze, but we can't be non-freezable either. Nor can
* khubd freeze while waiting for scanning to complete as it may
* hold the device lock, causing a hang when suspending devices.
* So we request a fake signal when freezing and use
* interruptible sleep to kick us out of our wait early when
* freezing happens.
*/
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);
}
Expand Down

0 comments on commit 79c48b4

Please sign in to comment.