alistair23-linux/drivers/usb/storage
Alan Stern bb94a40668 usb-storage: fix freezing of the scanning thread
This patch (as1521b) fixes the interaction between usb-storage's
scanning thread and the freezer.  The current implementation has a
race: If the device is unplugged shortly after being plugged in and
just as a system sleep begins, the scanning thread may get frozen
before the khubd task.  Khubd won't be able to freeze until the
disconnect processing is complete, and the disconnect processing can't
proceed until the scanning thread finishes, so the sleep transition
will fail.

The implementation in the 3.2 kernel suffers from an additional
problem.  There the scanning thread calls set_freezable_with_signal(),
and the signals sent by the freezer will mess up the thread's I/O
delays, which are all interruptible.

The solution to both problems is the same: Replace the kernel thread
used for scanning with a delayed-work routine on the system freezable
work queue.  Freezable work queues have the nice property that you can
cancel a work item even while the work queue is frozen, and no signals
are needed.

The 3.2 version of this patch solves the problem in Bugzilla #42730.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
CC: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-21 16:29:15 -08:00
..
alauda.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
cypress_atacb.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
datafab.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
debug.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
debug.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
ene_ub6250.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
freecom.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
initializers.c USB: usb-storage fails to attach to Huawei Datacard cdrom device 2009-09-23 06:46:32 -07:00
initializers.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
isd200.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
jumpshot.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
karma.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
Kconfig usb-storage: fix realtek cr configuration 2011-09-18 01:33:07 -07:00
libusual.c usb-storage: prepare for subdriver separation 2009-03-24 16:20:34 -07:00
Makefile Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6 2011-03-16 15:19:35 -07:00
onetouch.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
option_ms.c usb: Add module.h to drivers/usb consumers who really use it. 2011-10-31 19:31:25 -04:00
option_ms.h USB: unusual dev for Option N.V. ZeroCD modems 2009-01-07 10:00:09 -08:00
protocol.c usb-storage: Accept 8020i-protocol commands longer than 12 bytes 2011-11-14 17:05:03 -08:00
protocol.h USB: usb-storage: merge ATAPI and QIC-157 protocol routines 2009-01-07 09:59:57 -08:00
realtek_cr.c USB: Realtek cr: fix autopm scheduling while atomic 2012-01-26 11:22:41 -08:00
scsiglue.c Fix common misspellings 2011-03-31 11:26:23 -03:00
scsiglue.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
sddr09.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
sddr55.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
shuttle_usbat.c Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb 2012-01-09 12:09:47 -08:00
sierra_ms.c usb: Add module.h to drivers/usb consumers who really use it. 2011-10-31 19:31:25 -04:00
sierra_ms.h USB Storage Sierra: TRU-Install feature update 2008-08-13 17:32:51 -07:00
transport.c usb: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed 2011-10-31 19:31:25 -04:00
transport.h USB: usb-storage: merge CB and CBI transport routines 2009-01-07 09:59:57 -08:00
uas.c USB: convert drivers/usb/* to use module_usb_driver() 2011-11-18 09:34:02 -08:00
unusual_alauda.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_cypress.h USB: usb-storage: unusual_devs update for Cypress ATACB 2011-01-22 18:31:26 -08:00
unusual_datafab.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_devs.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-01-08 13:21:22 -08:00
unusual_ene_ub6250.h Staging: Merge ENE UB6250 SD card codes from keucr to drivers/usb/storage 2011-03-07 13:40:59 -08:00
unusual_freecom.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_isd200.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_jumpshot.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_karma.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_onetouch.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_realtek.h usb-storage: fix up the unusual_realtek device list 2011-05-17 11:56:28 -07:00
unusual_sddr09.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_sddr55.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
unusual_usbat.h USB: storage: Use USB_ prefix instead of US_ prefix 2010-10-22 10:21:49 -07:00
usb.c usb-storage: fix freezing of the scanning thread 2012-02-21 16:29:15 -08:00
usb.h usb-storage: fix freezing of the scanning thread 2012-02-21 16:29:15 -08:00
usual-tables.c Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6 2011-03-16 15:19:35 -07:00