Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2e8be93 authored by Subhash Jadavani's avatar Subhash Jadavani
Browse files

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: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent 403e3c04
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1719,6 +1719,13 @@ static int ufs_qcom_init(struct ufs_hba *hba)
	host->hba = hba;
	ufshcd_bind_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) {
		/*
+1 −1
Original line number Diff line number Diff line
@@ -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 */
+3 −0
Original line number Diff line number Diff line
@@ -840,6 +840,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 */