summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilad Broner <gbroner@codeaurora.org>2014-11-14 11:43:14 +0200
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 10:58:08 -0700
commit2fe969df93082fc0a047d508e78d1ce70c1852ee (patch)
treea906aae6cd65869bb854e13abbe4d623a6fdf6dd
parent48ef425125760d89138c9d5b27b900b3a8dc47af (diff)
scsi: ufs: suspend clock scaling for failed runtime_resume
During runtime resume operation, clock scaling may get indirectly resumed via call to ufshcd_set_dev_pwr_mode(): Start/Stop Unit command times out and SCSI error handling ultimately calls the host reset handler to recover, during which clock scaling is resumed. Error case exit path of runtime resume will disable clocks. As clock scaling was already resumed, it will get scheduled later on and try to access UFS registers while clocks are disabled, resulting in NOC error. Change-Id: I3faf46109420ac54404c18b209b4d42982e963b2 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
-rw-r--r--drivers/scsi/ufs/ufshcd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 3e582de99615..c132206b06ab 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -7061,6 +7061,7 @@ static void ufshcd_hba_exit(struct ufs_hba *hba)
if (hba->is_powered) {
ufshcd_variant_hba_exit(hba);
ufshcd_setup_vreg(hba, false);
+ ufshcd_suspend_clkscaling(hba);
ufshcd_setup_clocks(hba, false);
ufshcd_setup_hba_vreg(hba, false);
hba->is_powered = false;
@@ -7399,6 +7400,7 @@ disable_clks:
vops_resume:
ufshcd_vops_resume(hba, pm_op);
set_link_active:
+ ufshcd_resume_clkscaling(hba);
ufshcd_vreg_set_hpm(hba);
if (ufshcd_is_link_hibern8(hba) && !ufshcd_uic_hibern8_exit(hba)) {
ufshcd_set_link_active(hba);
@@ -7534,6 +7536,7 @@ disable_vreg:
ufshcd_vreg_set_lpm(hba);
disable_irq_and_vops_clks:
ufshcd_disable_irq(hba);
+ ufshcd_suspend_clkscaling(hba);
ufshcd_setup_clocks(hba, false);
out:
hba->pm_op_in_progress = 0;