]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: storage: When a device returns no sense data, call it a Hardware Error
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 6 Oct 2009 18:07:57 +0000 (14:07 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Oct 2009 22:11:50 +0000 (15:11 -0700)
commit4e45dde88210d0f4300675470b666979de88e965
tree3b4913bb34b8579d1094697b110024e1ed876d87
parentef6a2d7173326557fc172598ce10171dc541ce69
USB: storage: When a device returns no sense data, call it a Hardware Error

commit f1a0743bc0e7a30c032b1eb78f6a2b0f805b4597 upstream.

This patch (as1294) fixes a problem that has plagued users for several
kernel releases.  Some USB mass-storage devices don't return any sense
data when they encounter certain kinds of errors.  The SCSI layer
interprets this to mean that the operation should be retried, and the
same thing happens -- over and over again with no limit.  In some
circumstances (such as when a bus reset occurs) that is the right
thing to do, but not here.

The patch checks for this condition (a transport failure with no sense
data) and changes the result code to DID_ERROR and the sense code to
Hardware Error.  This does get only a limited number of retries, and
so the command will fail relatively quickly instead of getting stuck
in an infinite loop.

This fixes a large part of Bugzilla #14118.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Mantas Mikulenas <grawity@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/storage/transport.c