diff options
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r-- | drivers/usb/storage/uas.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 1d326c5e6dea..42976eccf3a7 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c | |||
@@ -64,13 +64,13 @@ enum { | |||
64 | DATA_IN_URB_INFLIGHT = (1 << 9), | 64 | DATA_IN_URB_INFLIGHT = (1 << 9), |
65 | DATA_OUT_URB_INFLIGHT = (1 << 10), | 65 | DATA_OUT_URB_INFLIGHT = (1 << 10), |
66 | COMMAND_COMPLETED = (1 << 11), | 66 | COMMAND_COMPLETED = (1 << 11), |
67 | COMMAND_ABORTED = (1 << 12), | ||
67 | }; | 68 | }; |
68 | 69 | ||
69 | /* Overrides scsi_pointer */ | 70 | /* Overrides scsi_pointer */ |
70 | struct uas_cmd_info { | 71 | struct uas_cmd_info { |
71 | unsigned int state; | 72 | unsigned int state; |
72 | unsigned int stream; | 73 | unsigned int stream; |
73 | unsigned int aborted; | ||
74 | struct urb *cmd_urb; | 74 | struct urb *cmd_urb; |
75 | struct urb *data_in_urb; | 75 | struct urb *data_in_urb; |
76 | struct urb *data_out_urb; | 76 | struct urb *data_out_urb; |
@@ -163,7 +163,7 @@ static void uas_log_cmd_state(struct scsi_cmnd *cmnd, const char *caller) | |||
163 | struct uas_cmd_info *ci = (void *)&cmnd->SCp; | 163 | struct uas_cmd_info *ci = (void *)&cmnd->SCp; |
164 | 164 | ||
165 | scmd_printk(KERN_INFO, cmnd, "%s %p tag %d, inflight:" | 165 | scmd_printk(KERN_INFO, cmnd, "%s %p tag %d, inflight:" |
166 | "%s%s%s%s%s%s%s%s%s%s%s\n", | 166 | "%s%s%s%s%s%s%s%s%s%s%s%s\n", |
167 | caller, cmnd, cmnd->request->tag, | 167 | caller, cmnd, cmnd->request->tag, |
168 | (ci->state & SUBMIT_STATUS_URB) ? " s-st" : "", | 168 | (ci->state & SUBMIT_STATUS_URB) ? " s-st" : "", |
169 | (ci->state & ALLOC_DATA_IN_URB) ? " a-in" : "", | 169 | (ci->state & ALLOC_DATA_IN_URB) ? " a-in" : "", |
@@ -175,7 +175,8 @@ static void uas_log_cmd_state(struct scsi_cmnd *cmnd, const char *caller) | |||
175 | (ci->state & COMMAND_INFLIGHT) ? " CMD" : "", | 175 | (ci->state & COMMAND_INFLIGHT) ? " CMD" : "", |
176 | (ci->state & DATA_IN_URB_INFLIGHT) ? " IN" : "", | 176 | (ci->state & DATA_IN_URB_INFLIGHT) ? " IN" : "", |
177 | (ci->state & DATA_OUT_URB_INFLIGHT) ? " OUT" : "", | 177 | (ci->state & DATA_OUT_URB_INFLIGHT) ? " OUT" : "", |
178 | (ci->state & COMMAND_COMPLETED) ? " done" : ""); | 178 | (ci->state & COMMAND_COMPLETED) ? " done" : "", |
179 | (ci->state & COMMAND_ABORTED) ? " abort" : ""); | ||
179 | } | 180 | } |
180 | 181 | ||
181 | static int uas_try_complete(struct scsi_cmnd *cmnd, const char *caller) | 182 | static int uas_try_complete(struct scsi_cmnd *cmnd, const char *caller) |
@@ -302,7 +303,7 @@ static void uas_data_cmplt(struct urb *urb) | |||
302 | } else { | 303 | } else { |
303 | sdb->resid = sdb->length - urb->actual_length; | 304 | sdb->resid = sdb->length - urb->actual_length; |
304 | } | 305 | } |
305 | if (cmdinfo->aborted) { | 306 | if (cmdinfo->state & COMMAND_ABORTED) { |
306 | return; | 307 | return; |
307 | } | 308 | } |
308 | uas_try_complete(cmnd, __func__); | 309 | uas_try_complete(cmnd, __func__); |
@@ -570,7 +571,6 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd, | |||
570 | 571 | ||
571 | cmdinfo->state = SUBMIT_STATUS_URB | | 572 | cmdinfo->state = SUBMIT_STATUS_URB | |
572 | ALLOC_CMD_URB | SUBMIT_CMD_URB; | 573 | ALLOC_CMD_URB | SUBMIT_CMD_URB; |
573 | cmdinfo->aborted = 0; | ||
574 | 574 | ||
575 | switch (cmnd->sc_data_direction) { | 575 | switch (cmnd->sc_data_direction) { |
576 | case DMA_FROM_DEVICE: | 576 | case DMA_FROM_DEVICE: |
@@ -652,7 +652,7 @@ static int uas_eh_abort_handler(struct scsi_cmnd *cmnd) | |||
652 | int ret; | 652 | int ret; |
653 | 653 | ||
654 | uas_log_cmd_state(cmnd, __func__); | 654 | uas_log_cmd_state(cmnd, __func__); |
655 | cmdinfo->aborted = 1; | 655 | cmdinfo->state |= COMMAND_ABORTED; |
656 | ret = uas_eh_task_mgmt(cmnd, "ABORT TASK", TMF_ABORT_TASK); | 656 | ret = uas_eh_task_mgmt(cmnd, "ABORT TASK", TMF_ABORT_TASK); |
657 | if (cmdinfo->state & DATA_IN_URB_INFLIGHT) | 657 | if (cmdinfo->state & DATA_IN_URB_INFLIGHT) |
658 | usb_kill_urb(cmdinfo->data_in_urb); | 658 | usb_kill_urb(cmdinfo->data_in_urb); |