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>
This commit is contained in:
Zang Leigang 2017-06-24 19:14:32 +08:00 committed by Martin K. Petersen
parent 578079fab3
commit 8dc0da7981

View File

@ -5809,7 +5809,8 @@ static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd)
do { do {
spin_lock_irqsave(hba->host->host_lock, flags); spin_lock_irqsave(hba->host->host_lock, flags);
if (!(work_pending(&hba->eh_work) || 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; break;
spin_unlock_irqrestore(hba->host->host_lock, flags); spin_unlock_irqrestore(hba->host->host_lock, flags);
dev_dbg(hba->dev, "%s: reset in progress\n", __func__); dev_dbg(hba->dev, "%s: reset in progress\n", __func__);