From: Zang Leigang Date: Sat, 24 Jun 2017 11:14:32 +0000 (+0800) Subject: scsi: ufs: flush eh_work when eh_work scheduled. X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=8dc0da7981a3f9680c873e92e3ec17308377e3b9;p=openwrt%2Fstaging%2Fblogic.git 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 Reviewed-by: Subhash Jadavani Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 88ccd63f83c1..5bc9dc14e075 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/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__);