diff mbox

scsi: ufs: flush eh_work when eh_work scheduled.

Message ID 20170624111432.11852-1-zangleigang@hisilicon.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Zang Leigang June 24, 2017, 11:14 a.m. UTC
Forget a condition: eh_work scheduled but do not start to work.

Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>

Comments

subhashj@codeaurora.org June 28, 2017, 11:45 p.m. UTC | #1
On 2017-06-24 04:14, Zang Leigang wrote:
> Forget a condition: eh_work scheduled but do not start to work.
> 
> Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index e050dcea1bea..a2dff12713fc 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -5807,7 +5807,8 @@ static int ufshcd_eh_host_reset_handler(struct
> scsi_cmnd *cmd)
>  	do {
>  		spin_lock_irqsave(hba->host->host_lock, flags);
>  		if (!(work_pending(&hba->eh_work) ||
> -				hba->ufshcd_state == UFSHCD_STATE_RESET))
> +			    hba->ufshcd_state == UFSHCD_STATE_RESET ||
> +			    hba->ufshcd_state == UFSHCD_STATE_EH_SCHEDULED))
>  			break;
>  		spin_unlock_irqrestore(hba->host->host_lock, flags);
>  		dev_dbg(hba->dev, "%s: reset in progress\n", __func__);

Looks good to me.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Martin K. Petersen July 1, 2017, 8:51 p.m. UTC | #2
Zang,

> Forget a condition: eh_work scheduled but do not start to work.

Applied to 4.13/scsi-queue.
diff mbox

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index e050dcea1bea..a2dff12713fc 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5807,7 +5807,8 @@  static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd)
 	do {
 		spin_lock_irqsave(hba->host->host_lock, flags);
 		if (!(work_pending(&hba->eh_work) ||
-				hba->ufshcd_state == UFSHCD_STATE_RESET))
+			    hba->ufshcd_state == UFSHCD_STATE_RESET ||
+			    hba->ufshcd_state == UFSHCD_STATE_EH_SCHEDULED))
 			break;
 		spin_unlock_irqrestore(hba->host->host_lock, flags);
 		dev_dbg(hba->dev, "%s: reset in progress\n", __func__);