uas: Properly complete inflight commands on bus-reset or disconnect
authorHans de Goede <hdegoede@redhat.com>
Tue, 12 Nov 2013 12:44:20 +0000 (13:44 +0100)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 4 Mar 2014 23:38:22 +0000 (15:38 -0800)
commit61c09ce510a1eba8595beda6aac194f42571d768
treedc99ca6f8b01509ab4b09738a362fc49a7a57344
parentc6d4579d4ba24c494d03daf656cd2ff2a9e683c6
uas: Properly complete inflight commands on bus-reset or disconnect

Before this commit the uas driver would keep track of scsi commands which still
need to have some urbs submitted to the device, and complete this with an
ABORT result code on bus-reset or disconnect, but in flight scsi commands
which have all their urbs submitted, and thus are not part of the work list,
would never get their done callback called.

The problem is killed sense urbs don't have any tag info, so it is impossible
to tell which scsi cmd they belong to, so merely making sure all the urbs
have completed one way or the other is not enough.

This commit fixes this by changing the work list to an inflight list, which
keeps tracks of all inflight scsi cmnds, using the IS_IN_WORK_LIST flag to
determine if actual work needs to be done in uas_do_work(), and by moving
marking all inflight scsi commands as aborted and moving them to the dead list
on bus-reset or disconnect.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/storage/uas.c