From c8440432a50cfa287cd0ec64395321d6daed1412 Mon Sep 17 00:00:00 2001 From: hgchu Date: Fri, 12 Jan 2018 20:14:16 +0900 Subject: [PATCH] [DO NOT RELEASE][COMMON] ufs: Add reset for DL error Change-Id: I75ce1ad29316b95ca1a2bd04cb332c36480d1c64 Signed-off-by: hgchu --- drivers/scsi/ufs/ufshcd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 40b8e499e7a7..b1ed0f6e8774 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3932,7 +3932,7 @@ static int __ufshcd_uic_hibern8_enter(struct ufs_hba *hba) if (ret) { dev_err(hba->dev, "%s: hibern8 enter failed. ret = %d\n", __func__, ret); - + ssleep(2); /* * If link recovery fails then return error so that caller * don't retry the hibern8 enter again. @@ -5459,6 +5459,7 @@ static void ufshcd_err_handler(struct work_struct *work) if ((hba->saved_err & INT_FATAL_ERRORS) || ((hba->saved_err & UIC_ERROR) && (hba->saved_uic_err & (UFSHCD_UIC_DL_PA_INIT_ERROR | + UFSHCD_UIC_DL_ERROR | UFSHCD_UIC_DL_NAC_RECEIVED_ERROR | UFSHCD_UIC_DL_TCx_REPLAY_ERROR)))) needs_reset = true; @@ -8100,6 +8101,9 @@ disable_clks: set_link_active: if (hba->clk_scaling.is_allowed) ufshcd_resume_clkscaling(hba); + + if (ufshcd_is_shutdown_pm(pm_op)) + goto out; if (ufshcd_is_link_hibern8(hba)) { ufshcd_set_link_trans_active(hba); if (!ufshcd_link_hibern8_ctrl(hba, false)) @@ -8109,6 +8113,9 @@ set_link_active: } else if (ufshcd_is_link_off(hba)) ufshcd_host_reset_and_restore(hba); set_dev_active: + if (ufshcd_is_shutdown_pm(pm_op)) + goto out; + if (!ufshcd_set_dev_pwr_mode(hba, UFS_ACTIVE_PWR_MODE)) ufshcd_disable_auto_bkops(hba); enable_gating: -- 2.20.1