提交 cca26be3 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

UAS: also check for ESHUTDOWN in error reporting

-ESHUTDOWN means that the HC has been unplugged.
Reporting an error in that case makes no sense.
Signed-off-by: NOliver Neukum <oneukum@suse.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 db1319e1
...@@ -257,17 +257,16 @@ static void uas_stat_cmplt(struct urb *urb) ...@@ -257,17 +257,16 @@ static void uas_stat_cmplt(struct urb *urb)
struct uas_cmd_info *cmdinfo; struct uas_cmd_info *cmdinfo;
unsigned long flags; unsigned long flags;
unsigned int idx; unsigned int idx;
int status = urb->status;
spin_lock_irqsave(&devinfo->lock, flags); spin_lock_irqsave(&devinfo->lock, flags);
if (devinfo->resetting) if (devinfo->resetting)
goto out; goto out;
if (urb->status) { if (status) {
if (urb->status != -ENOENT && urb->status != -ECONNRESET) { if (status != -ENOENT && status != -ECONNRESET && status != -ESHUTDOWN)
dev_err(&urb->dev->dev, "stat urb: status %d\n", dev_err(&urb->dev->dev, "stat urb: status %d\n", status);
urb->status);
}
goto out; goto out;
} }
...@@ -348,6 +347,7 @@ static void uas_data_cmplt(struct urb *urb) ...@@ -348,6 +347,7 @@ static void uas_data_cmplt(struct urb *urb)
struct uas_dev_info *devinfo = (void *)cmnd->device->hostdata; struct uas_dev_info *devinfo = (void *)cmnd->device->hostdata;
struct scsi_data_buffer *sdb = NULL; struct scsi_data_buffer *sdb = NULL;
unsigned long flags; unsigned long flags;
int status = urb->status;
spin_lock_irqsave(&devinfo->lock, flags); spin_lock_irqsave(&devinfo->lock, flags);
...@@ -374,9 +374,9 @@ static void uas_data_cmplt(struct urb *urb) ...@@ -374,9 +374,9 @@ static void uas_data_cmplt(struct urb *urb)
goto out; goto out;
} }
if (urb->status) { if (status) {
if (urb->status != -ENOENT && urb->status != -ECONNRESET) if (status != -ENOENT && status != -ECONNRESET && status != -ESHUTDOWN)
uas_log_cmd_state(cmnd, "data cmplt err", urb->status); uas_log_cmd_state(cmnd, "data cmplt err", status);
/* error: no data transfered */ /* error: no data transfered */
sdb->resid = sdb->length; sdb->resid = sdb->length;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册