scsi: ufs: clean-up remained cmd on abort-handling
authorhgchu <hg.chu@samsung.com>
Fri, 12 Jan 2018 04:06:10 +0000 (13:06 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:20:23 +0000 (17:20 +0900)
Change-Id: Iee3000f142cd9ef969f351c22810d7f17724c29f
Signed-off-by: hgchu <hg.chu@samsung.com>
drivers/scsi/ufs/ufshcd.c

index 5122b6bd95ffbc5d8b8785986b99afd018980da6..54fe87af197b9d4e0500458ef1877d2ef15f0003 100644 (file)
@@ -5816,6 +5816,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
                dev_err(hba->dev,
                "%s: cmd was completed, but without a notifying intr, tag = %d",
                __func__, tag);
+               goto clean;
        }
 
        /* Print Transfer Request of aborted task */
@@ -5876,12 +5877,18 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
                                __func__, tag, err);
                        if (!err)
                                err = resp; /* service response error */
+                       dev_err(hba->dev,
+                               "%s: query task failed with err %d\n",
+                               __func__, err);
                        goto out;
                }
        }
 
        if (!poll_cnt) {
                err = -EBUSY;
+               dev_err(hba->dev,
+                       "%s: cmd might be missed, not pending in device\n",
+                       __func__);
                goto out;
        }
 
@@ -5902,7 +5909,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
                        __func__, tag, err);
                goto out;
        }
-
+clean:
        scsi_dma_unmap(cmd);
 
        spin_lock_irqsave(host->host_lock, flags);