summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSahitya Tummala <stummala@codeaurora.org>2013-12-18 13:49:27 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 10:56:24 -0700
commitb55d16cd6bf0fdbd68607a5797c70fcbbb68f219 (patch)
tree4fd5ca476c29ba171bdd2acd1aad180d30d7966f
parentc6aef9984dc4e57ca0f61f70604fa658361792ed (diff)
scsi: ufs-msm: Fix hba variant host op init and setup_clocks
Handle the case where vops->setup_clocks is called before vops->init() from ufshcd driver. Change-Id: I4754b658c1f37db6418560321f5dfe7a4650692b Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
-rw-r--r--drivers/scsi/ufs/ufs-msm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufs-msm.c b/drivers/scsi/ufs/ufs-msm.c
index 837500703b84..772956eb731d 100644
--- a/drivers/scsi/ufs/ufs-msm.c
+++ b/drivers/scsi/ufs/ufs-msm.c
@@ -1788,6 +1788,14 @@ static int msm_ufs_setup_clocks(struct ufs_hba *hba, bool on)
int err;
int vote;
+ /*
+ * In case msm_ufs_init() is not yet done, simply ignore.
+ * This msm_ufs_setup_clocks() shall be called from
+ * msm_ufs_init() after init is done.
+ */
+ if (!host)
+ return 0;
+
if (on) {
vote = host->bus_vote.saved_vote;
if (vote == host->bus_vote.min_bw_vote)
@@ -1946,6 +1954,7 @@ static int msm_ufs_init(struct ufs_hba *hba)
hba->spm_lvl = UFS_PM_LVL_3;
}
+ msm_ufs_setup_clocks(hba, true);
goto out;
out_disable_phy: