From: hgchu Date: Fri, 12 Jan 2018 04:24:38 +0000 (+0900) Subject: [COMMON] ufs: exynos: fix race of error recovery X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=57579a4a2a81634c0189b7e0df1c7766fd1b605b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [COMMON] ufs: exynos: fix race of error recovery There are some race condition.when hci sfr dump starts in error handler, if hibernation exit function send uic cmd with uic errors then race happens. Therefore we make hibernation exit skip to send uic cmd when uic errors happens. Change-Id: I261f1cecca4210ddda6088d784790923373ae18d Signed-off-by: hgchu --- diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 7df4c38ecdfe..ae6b90659e32 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3910,7 +3910,14 @@ static int ufshcd_link_hibern8_ctrl(struct ufs_hba *hba, bool en) ret = ufshcd_uic_hibern8_enter(hba); else ret = ufshcd_uic_hibern8_exit(hba); - if (ret) + + if (ret || (hba->saved_err & INT_FATAL_ERRORS) || + ((hba->saved_err & UIC_ERROR) && + ((hba->saved_uic_err & UFSHCD_UIC_DL_PA_INIT_ERROR) || + (hba->saved_uic_err & UFSHCD_UIC_DL_ERROR)))) { + + if (!ret) + ret = hba->saved_err; goto out; } if (hba->vops && hba->vops->hibern8_notify)