diff mbox series

[v2,2/2] scsi: ufs: no need to send one Abort Task TM in case the task in DB was cleared

Message ID 20200811141859.27399-3-huobean@gmail.com (mailing list archive)
State Mainlined
Commit d87a1f6d021f401f99ae2ba8ccddb87dac921308
Headers show
Series scsi: ufs: two fixups of ufshcd_abort() | expand

Commit Message

Bean Huo Aug. 11, 2020, 2:18 p.m. UTC
From: Bean Huo <beanhuo@micron.com>

If the bit corresponds to a task in the Doorbell register has been
cleared, no need to poll the status of the task on the device side
and to send an Abort Task TM. Instead, let it directly goto cleanup.

Meanwhile, to keep original debug print, move this goto below the debug
print.

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/scsi/ufs/ufshcd.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

Comments

Can Guo Aug. 14, 2020, 9:27 a.m. UTC | #1
On 2020-08-11 22:18, Bean Huo wrote:
> From: Bean Huo <beanhuo@micron.com>
> 
> If the bit corresponds to a task in the Doorbell register has been
> cleared, no need to poll the status of the task on the device side
> and to send an Abort Task TM. Instead, let it directly goto cleanup.
> 
> Meanwhile, to keep original debug print, move this goto below the debug
> print.
> 
> Signed-off-by: Bean Huo <beanhuo@micron.com>

Reviewed-by: Can Guo <cang@codeaurora.org>

> ---
>  drivers/scsi/ufs/ufshcd.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 66fe814c8725..5f09cda7b21c 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -6434,14 +6434,8 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
>  		goto out;
>  	}
> 
> -	if (!(reg & (1 << tag))) {
> -		dev_err(hba->dev,
> -		"%s: cmd was completed, but without a notifying intr, tag = %d",
> -		__func__, tag);
> -	}
> -
>  	/* Print Transfer Request of aborted task */
> -	dev_err(hba->dev, "%s: Device abort task at tag %d\n", __func__, 
> tag);
> +	dev_info(hba->dev, "%s: Device abort task at tag %d\n", __func__, 
> tag);
> 
>  	/*
>  	 * Print detailed info about aborted request.
> @@ -6462,6 +6456,13 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
>  	}
>  	hba->req_abort_count++;
> 
> +	if (!(reg & (1 << tag))) {
> +		dev_err(hba->dev,
> +		"%s: cmd was completed, but without a notifying intr, tag = %d",
> +		__func__, tag);
> +		goto cleanup;
> +	}
> +
>  	/* Skip task abort in case previous aborts failed and report failure 
> */
>  	if (lrbp->req_abort_skip) {
>  		err = -EIO;
Stanley Chu Aug. 16, 2020, 1:54 a.m. UTC | #2
On Tue, 2020-08-11 at 16:18 +0200, Bean Huo wrote:
> From: Bean Huo <beanhuo@micron.com>
> 
> If the bit corresponds to a task in the Doorbell register has been
> cleared, no need to poll the status of the task on the device side
> and to send an Abort Task TM. Instead, let it directly goto cleanup.
> 
> Meanwhile, to keep original debug print, move this goto below the debug
> print.
> 
> Signed-off-by: Bean Huo <beanhuo@micron.com>

Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 66fe814c8725..5f09cda7b21c 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6434,14 +6434,8 @@  static int ufshcd_abort(struct scsi_cmnd *cmd)
 		goto out;
 	}
 
-	if (!(reg & (1 << tag))) {
-		dev_err(hba->dev,
-		"%s: cmd was completed, but without a notifying intr, tag = %d",
-		__func__, tag);
-	}
-
 	/* Print Transfer Request of aborted task */
-	dev_err(hba->dev, "%s: Device abort task at tag %d\n", __func__, tag);
+	dev_info(hba->dev, "%s: Device abort task at tag %d\n", __func__, tag);
 
 	/*
 	 * Print detailed info about aborted request.
@@ -6462,6 +6456,13 @@  static int ufshcd_abort(struct scsi_cmnd *cmd)
 	}
 	hba->req_abort_count++;
 
+	if (!(reg & (1 << tag))) {
+		dev_err(hba->dev,
+		"%s: cmd was completed, but without a notifying intr, tag = %d",
+		__func__, tag);
+		goto cleanup;
+	}
+
 	/* Skip task abort in case previous aborts failed and report failure */
 	if (lrbp->req_abort_skip) {
 		err = -EIO;