diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-09-13 12:26:37 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-23 21:42:11 -0700 |
commit | 9c15c5738b5219fdc273e8923b2c1a9d5e8ce3b3 (patch) | |
tree | a1a6241d97026279dac1b2fe664210a08ed369f1 /drivers | |
parent | 1589349f74d669b767bc0971fb21372ad300452e (diff) |
uas: zap_pending: data urbs should have completed at this time
The data urbs are all killed before calling zap_pending, and their completion
handler should have cleared their inflight flag.
Do not 0 the data inflight flags, and add a check for try_complete succeeding,
as it should always succeed when called from zap_pending.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/storage/uas.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index dd8772b60ab8..7daecd59cd38 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -145,6 +145,7 @@ static void uas_zap_pending(struct uas_dev_info *devinfo, int result) struct uas_cmd_info *cmdinfo; struct uas_cmd_info *temp; unsigned long flags; + int err; spin_lock_irqsave(&devinfo->lock, flags); list_for_each_entry_safe(cmdinfo, temp, &devinfo->dead_list, list) { @@ -152,12 +153,11 @@ static void uas_zap_pending(struct uas_dev_info *devinfo, int result) struct scsi_cmnd *cmnd = container_of(scp, struct scsi_cmnd, SCp); uas_log_cmd_state(cmnd, __func__); - /* all urbs are killed, clear inflight bits */ - cmdinfo->state &= ~(COMMAND_INFLIGHT | - DATA_IN_URB_INFLIGHT | - DATA_OUT_URB_INFLIGHT); + /* Sense urbs were killed, clear COMMAND_INFLIGHT manually */ + cmdinfo->state &= ~COMMAND_INFLIGHT; cmnd->result = result << 16; - uas_try_complete(cmnd, __func__); + err = uas_try_complete(cmnd, __func__); + WARN_ON(err != 0); } spin_unlock_irqrestore(&devinfo->lock, flags); } |