linux/drivers/usb/storage
Alan Stern 25ff1c316f USB: storage: add last-sector hacks
This patch (as1189b) adds some hacks to usb-storage for dealing with
the growing problems involving bad capacity values and last-sector
accesses:

	A new flag, US_FL_CAPACITY_OK, is created to indicate that
	the device is known to report its capacity correctly.  An
	unusual_devs entry for Linux's own File-backed Storage Gadget
	is added with this flag set, since g_file_storage always
	reports the correct capacity and since the capacity need
	not be even (it is determined by the size of the backing
	file).

	An entry in unusual_devs.h which has only the CAPACITY_OK
	flag set shouldn't prejudice libusual, since the device will
	work perfectly well with either usb-storage or ub.  So a
	new macro, COMPLIANT_DEV, is added to let libusual know
	about these entries.

	When a last-sector access succeeds and the total number of
	sectors is odd (the unexpected case, in which guessing that
	the number is even might cause trouble), a WARN is triggered.
	The kerneloops.org project will collect these warnings,
	allowing us to add CAPACITY_OK flags for the devices in
	question before implementing the default-to-even heuristic.
	If users want to prevent the stack dump produced by the WARN,
	they can disable the hack by adding an unusual_devs entry
	for their device with the CAPACITY_OK flag.

	When a last-sector access fails three times in a row and
	neither the FIX_CAPACITY nor the CAPACITY_OK flag is set,
	we assume the last-sector bug is present.  We replace the
	existing status and sense data with values that will cause
	the SCSI core to fail the access immediately rather than
	retry indefinitely.  This should fix the difficulties
	people have been having with Nokia phones.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 10:00:11 -08:00
..
alauda.c USB storage: sg chaining support 2007-10-16 11:20:59 +02:00
alauda.h
cypress_atacb.c [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer 2008-05-02 10:18:22 -05:00
cypress_atacb.h USB: mass storage: emulation of sat scsi_pass_thru with ATACB 2008-04-24 21:16:42 -07:00
datafab.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
datafab.h
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
freecom.c remove unnecessary <linux/hdreg.h> includes 2008-08-05 18:16:58 +02:00
freecom.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
initializers.c USB: support Huawei data card product IDs 2008-10-22 10:05:28 -07:00
initializers.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
isd200.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
isd200.h
jumpshot.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
jumpshot.h
karma.c
karma.h
Kconfig USB: usb-storage: merge DPCM support into SDDR09 2009-01-07 10:00:06 -08:00
libusual.c USB: storage: add last-sector hacks 2009-01-07 10:00:11 -08:00
Makefile USB: unusual dev for Option N.V. ZeroCD modems 2009-01-07 10:00:09 -08:00
onetouch.c USB: remove err() macro from more usb drivers 2008-10-17 14:41:14 -07:00
onetouch.h
option_ms.c USB: unusual dev for Option N.V. ZeroCD modems 2009-01-07 10:00:09 -08:00
option_ms.h USB: unusual dev for Option N.V. ZeroCD modems 2009-01-07 10:00:09 -08:00
protocol.c USB: usb-storage: merge ATAPI and QIC-157 protocol routines 2009-01-07 09:59:57 -08:00
protocol.h USB: usb-storage: merge ATAPI and QIC-157 protocol routines 2009-01-07 09:59:57 -08:00
scsiglue.c USB: storage: add last-sector hacks 2009-01-07 10:00:11 -08:00
scsiglue.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
sddr09.c USB: usb-storage: merge DPCM support into SDDR09 2009-01-07 10:00:06 -08:00
sddr09.h USB: usb-storage: merge DPCM support into SDDR09 2009-01-07 10:00:06 -08:00
sddr55.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
sddr55.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
shuttle_usbat.c USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
shuttle_usbat.h USB: remove CVS keywords 2008-07-21 15:15:55 -07:00
sierra_ms.c USB Storage Sierra: TRU-Install feature update 2008-08-13 17:32:51 -07:00
sierra_ms.h USB Storage Sierra: TRU-Install feature update 2008-08-13 17:32:51 -07:00
transport.c USB: storage: add last-sector hacks 2009-01-07 10:00:11 -08:00
transport.h USB: usb-storage: merge CB and CBI transport routines 2009-01-07 09:59:57 -08:00
unusual_devs.h USB: storage: add last-sector hacks 2009-01-07 10:00:11 -08:00
usb.c USB: storage: add last-sector hacks 2009-01-07 10:00:11 -08:00
usb.h USB: storage: add last-sector hacks 2009-01-07 10:00:11 -08:00