[DO NOT RELEASE][COMMON] ufs: Add reset for DL error
authorhgchu <hg.chu@samsung.com>
Fri, 12 Jan 2018 11:14:16 +0000 (20:14 +0900)
committerJaeHun Jung <jh0801.jung@samsung.com>
Tue, 8 May 2018 08:20:54 +0000 (17:20 +0900)
Change-Id: I75ce1ad29316b95ca1a2bd04cb332c36480d1c64
Signed-off-by: hgchu <hg.chu@samsung.com>
drivers/scsi/ufs/ufshcd.c

index 40b8e499e7a708f0e669a6810cc108b2f0ffef28..b1ed0f6e87744d2fc1f54182f8b412531794ade4 100644 (file)
@@ -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: