diff options
| author | Subhash Jadavani <subhashj@codeaurora.org> | 2015-07-13 18:44:06 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:00:19 -0700 |
| commit | 029a8b38f67e5dc98befebbd74784bb1867becbd (patch) | |
| tree | 35048e32d75d491cafa974e91d1efbc4f64d169e | |
| parent | ec66dacb420defc1ec96d7b95a11d71453a5677f (diff) | |
scsi: ufs: skip devoting device ref_clk during clock gating
Voting/devoting device ref_clk source could be time consuming hence add
support to allow ufs variant to decide if it wants to control ref_clk
during aggressive clock gating or not. This clock should still be gated
off during runtime/system suspend.
Change-Id: Ibec8cc8b3689ff4e2418039e74dbf311e589157e
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
| -rw-r--r-- | drivers/scsi/ufs/ufs-qcom.c | 7 | ||||
| -rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/ufs/ufshcd.h | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 01ab9c65a20c..3101eca79823 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -1720,6 +1720,13 @@ static int ufs_qcom_init(struct ufs_hba *hba) host->hba = hba; ufshcd_set_variant(hba, host); + /* + * voting/devoting device ref_clk source is time consuming hence + * skip devoting it during aggressive clock gating. This clock + * will still be gated off during runtime suspend. + */ + hba->no_ref_clk_gating = true; + err = ufs_qcom_ice_get_dev(host); if (err == -EPROBE_DEFER) { /* diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 7b4955db1225..d1ffa9406baa 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -1270,7 +1270,7 @@ static void ufshcd_gate_work(struct work_struct *work) ufshcd_suspend_clkscaling(hba); - if (!ufshcd_is_link_active(hba)) + if (!ufshcd_is_link_active(hba) && !hba->no_ref_clk_gating) ufshcd_setup_clocks(hba, false); else /* If link is active, device ref_clk can't be switched off */ diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index eb2c1f3bdcb5..8e2c2f509039 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -841,6 +841,9 @@ struct ufs_hba { bool is_urgent_bkops_lvl_checked; struct rw_semaphore clk_scaling_lock; + + /* If set, don't gate device ref_clk during clock gating */ + bool no_ref_clk_gating; }; /* Returns true if clocks can be gated. Otherwise false */ |
