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

Commit 403e3c04 authored by Subhash Jadavani's avatar Subhash Jadavani
Browse files

scsi: ufs: core power collapse after clock gating



Currently we power collapse UFS controller core only during runtime suspend
but we could also power collapse it during clock gating as power collapse
latencies are only few microseconds. This change adds this aggressive power
collapse to save power.

Change-Id: Id550bcbcd044670cec08a6abb7225cb9386993b5
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent b9ae0269
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -371,6 +371,8 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba);
static void ufshcd_resume_clkscaling(struct ufs_hba *hba);
static void ufshcd_suspend_clkscaling(struct ufs_hba *hba);
static void ufshcd_release_all(struct ufs_hba *hba);
static void ufshcd_hba_vreg_set_lpm(struct ufs_hba *hba);
static void ufshcd_hba_vreg_set_hpm(struct ufs_hba *hba);

static inline bool ufshcd_valid_tag(struct ufs_hba *hba, int tag)
{
@@ -1133,6 +1135,7 @@ static void ufshcd_ungate_work(struct work_struct *work)
	}

	spin_unlock_irqrestore(hba->host->host_lock, flags);
	ufshcd_hba_vreg_set_hpm(hba);
	ufshcd_setup_clocks(hba, true);

	/* Exit from hibern8 */
@@ -1273,6 +1276,9 @@ static void ufshcd_gate_work(struct work_struct *work)
		/* If link is active, device ref_clk can't be switched off */
		__ufshcd_setup_clocks(hba, false, true);

	/* Put the host controller in low power mode if possible */
	ufshcd_hba_vreg_set_lpm(hba);

	/*
	 * In case you are here to cancel this work the gating state
	 * would be marked as REQ_CLKS_ON. In this case keep the state