summaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-08-17 20:28:40 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-08-17 20:28:39 -0700
commit53b57a765fc58247bc77d29600f5be88b6c94d6e (patch)
treeacf35d38fdcd5d801d514d87c21aa8728452191a /drivers/scsi/ufs
parent7232046f645289fc4917875c6170e5f351771493 (diff)
parent33ee9fb701814464930009c2a22b2bd36c6d91ee (diff)
Merge "scsi: ufs: disable ah8 during suspend and enable it on resume"
Diffstat (limited to 'drivers/scsi/ufs')
-rw-r--r--drivers/scsi/ufs/ufshcd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index d8c7ae3205c8..ab602d2ef392 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -7984,6 +7984,13 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
hba->clk_gating.is_suspended = true;
hba->hibern8_on_idle.is_suspended = true;
+ /*
+ * Disable auto hibern8 to prevent unnecessary hibern8 enter/exit
+ * during suspend path
+ */
+ if (ufshcd_is_auto_hibern8_supported(hba))
+ ufshcd_set_auto_hibern8_timer(hba, 0);
+
if (hba->clk_scaling.is_allowed) {
cancel_work_sync(&hba->clk_scaling.suspend_work);
cancel_work_sync(&hba->clk_scaling.resume_work);
@@ -8091,6 +8098,10 @@ enable_gating:
ufshcd_resume_clkscaling(hba);
hba->hibern8_on_idle.is_suspended = false;
hba->clk_gating.is_suspended = false;
+ /* Re-enable auto hibern8 in case of suspend failure */
+ if (ufshcd_is_auto_hibern8_supported(hba))
+ ufshcd_set_auto_hibern8_timer(hba,
+ hba->hibern8_on_idle.delay_ms);
ufshcd_release_all(hba);
out:
hba->pm_op_in_progress = 0;
@@ -8184,6 +8195,13 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
if (hba->clk_scaling.is_allowed)
ufshcd_resume_clkscaling(hba);
+ /*
+ * Enable auto hibern8 after successful resume to prevent
+ * unnecessary hibern8 enter/exit during resume path
+ */
+ if (ufshcd_is_auto_hibern8_supported(hba))
+ ufshcd_set_auto_hibern8_timer(hba,
+ hba->hibern8_on_idle.delay_ms);
/* Schedule clock gating in case of no access to UFS device yet */
ufshcd_release_all(hba);
goto out;