USB: usb-storage: add BAD_SENSE flag
commit2e8ca1b618a6df647e0557317a8c0fc7f17c5988
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 7 Dec 2009 21:39:16 +0000 (7 16:39 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 21:43:35 +0000 (18 13:43 -0800)
tree040d7635a78527bc65b0c748c570fbeabe0154d0
parent670c58208d3b8c86e52fd5bcf43186c5f45aa8be
USB: usb-storage: add BAD_SENSE flag

commit a0bb108112a872c0b0c4b3ef4974f95fb75b155d upstream.

This patch (as1311) fixes a problem in usb-storage: Some devices are
pretty broken when it comes to reporting sense data.  The information
they send back indicates that they have more than 18 bytes of sense
data available, but when the system asks for more than 18 they fail or
hang.  The symptom is that probing fails with multiple resets.

The patch adds a new BAD_SENSE flag to indicate that usb-storage
should never ask for more than 18 bytes of sense data.  The flag can
be set in an unusual_devs entry or via the "quirks=" module parameter,
and it is set automatically whenever a REQUEST SENSE command for more
than 18 bytes fails or times out.

An unusual_devs entry is added for the Agfa photo frame, which uses a
Prolific chip having this bug.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Daniel Kukula <daniel.kuku@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Documentation/kernel-parameters.txt
drivers/usb/storage/transport.c
drivers/usb/storage/unusual_devs.h
drivers/usb/storage/usb.c
include/linux/usb_usual.h