linux/drivers/usb/storage
Alan Stern 8b52291a07 usb-storage: fix deadlock involving host lock and scsi_done
Christoph Hellwig says that since version 4.12, the kernel switched to
using blk-mq by default.  The old code used a softirq for handling
request completions, but blk-mq can handle completions in the caller's
context.  This may cause a problem for usb-storage, because it invokes
the ->scsi_done callback while holding the host lock, and the
completion routine sometimes tries to acquire the same lock (when
running the error handler, for example).

The consequence is that the existing code will sometimes deadlock upon
error completion of a SCSI command (with a lockdep warning).

This is easy enough to fix, since usb-storage doesn't really need to
hold the host lock while the callback runs.  It was simpler to write
it that way, but moving the call outside the locked region is pretty
easy and there's no downside.  That's what this patch does.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Arthur Marsh <arthur.marsh@internode.on.net>
CC: Christoph Hellwig <hch@lst.de>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-30 07:18:27 -07:00
..
alauda.c
cypress_atacb.c
datafab.c
debug.c
debug.h
ene_ub6250.c Merge 4.12-rc2 into usb-next 2017-05-22 09:00:23 +02:00
freecom.c
initializers.c
initializers.h
isd200.c usb: storage: return on error to avoid a null pointer dereference 2017-07-17 13:11:57 +02:00
jumpshot.c
karma.c usb: storage: karma: remove useless variable 2017-03-17 13:27:41 +09:00
Kconfig
Makefile
onetouch.c
option_ms.c
option_ms.h
protocol.c
protocol.h
realtek_cr.c
scsiglue.c scsi: introduce a quirk for false cache reporting 2016-09-13 08:08:24 +02:00
scsiglue.h
sddr09.c usb: storage: sddr09: Remove a set-but-not-used variable 2017-01-25 10:52:43 +01:00
sddr55.c
shuttle_usbat.c
sierra_ms.c
sierra_ms.h
transport.c Fix USB CB/CBI storage devices with CONFIG_VMAP_STACK=y 2016-11-15 11:08:51 +01:00
transport.h
uas-detect.h
uas.c
unusual_alauda.h
unusual_cypress.h
unusual_datafab.h
unusual_devs.h USB: storage: e-mail update in drivers/usb/storage/unusual_devs.h 2017-04-25 20:01:23 +02:00
unusual_ene_ub6250.h
unusual_freecom.h
unusual_isd200.h
unusual_jumpshot.h
unusual_karma.h
unusual_onetouch.h
unusual_realtek.h
unusual_sddr09.h
unusual_sddr55.h
unusual_uas.h uas: Add US_FL_IGNORE_RESIDUE for Initio Corporation INIC-3069 2017-07-30 07:18:27 -07:00
unusual_usbat.h
usb.c usb-storage: fix deadlock involving host lock and scsi_done 2017-07-30 07:18:27 -07:00
usb.h
usual-tables.c