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>
This commit is contained in:
parent
ec66dacb42
commit
029a8b38f6
3 changed files with 11 additions and 1 deletions
|
@ -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) {
|
||||
/*
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue