提交 9c15c573 编写于 作者: H Hans de Goede 提交者: Greg Kroah-Hartman

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: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 1589349f
...@@ -145,6 +145,7 @@ static void uas_zap_pending(struct uas_dev_info *devinfo, int result) ...@@ -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 *cmdinfo;
struct uas_cmd_info *temp; struct uas_cmd_info *temp;
unsigned long flags; unsigned long flags;
int err;
spin_lock_irqsave(&devinfo->lock, flags); spin_lock_irqsave(&devinfo->lock, flags);
list_for_each_entry_safe(cmdinfo, temp, &devinfo->dead_list, list) { 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) ...@@ -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, struct scsi_cmnd *cmnd = container_of(scp, struct scsi_cmnd,
SCp); SCp);
uas_log_cmd_state(cmnd, __func__); uas_log_cmd_state(cmnd, __func__);
/* all urbs are killed, clear inflight bits */ /* Sense urbs were killed, clear COMMAND_INFLIGHT manually */
cmdinfo->state &= ~(COMMAND_INFLIGHT | cmdinfo->state &= ~COMMAND_INFLIGHT;
DATA_IN_URB_INFLIGHT |
DATA_OUT_URB_INFLIGHT);
cmnd->result = result << 16; 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); spin_unlock_irqrestore(&devinfo->lock, flags);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册