Browse Source

scsi: ufs: flush eh_work when eh_work scheduled.

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

Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Zang Leigang 8 years ago
parent
commit
8dc0da7981
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/scsi/ufs/ufshcd.c

+ 2 - 1
drivers/scsi/ufs/ufshcd.c

@@ -5809,7 +5809,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__);