• Hans de Goede's avatar
    uas: Properly complete inflight commands on bus-reset or disconnect · 61c09ce5
    Hans de Goede authored
    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: default avatarHans de Goede <hdegoede@redhat.com>
    Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
uas.c 32.4 KB