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

Commit 56ec2368 authored by Sahitya Tummala's avatar Sahitya Tummala
Browse files

scsi: ufshcd: suspend clock scaling before clocks are gated



Wait for pending clock scaling work to be done before clocks are
turned off in runtime suspend as scaling needs access to controller
registers.

Change-Id: I588544692fa6ceb75b8712b9116745f831586d68
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent 500bff85
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -5420,6 +5420,15 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
	ufshcd_vreg_set_lpm(hba);

disable_clks:
	/*
	 * The clock scaling needs access to controller registers. Hence, Wait
	 * for pending clock scaling work to be done before clocks are
	 * turned off.
	 */
	if (ufshcd_is_clkscaling_enabled(hba)) {
		devfreq_suspend_device(hba->devfreq);
		hba->clk_scaling.window_start_t = 0;
	}
	/*
	 * Call vendor specific suspend callback. As these callbacks may access
	 * vendor specific host controller register space call them before the
@@ -5452,10 +5461,6 @@ disable_clks:
	 */
	ufshcd_disable_irq(hba);

	if (ufshcd_is_clkscaling_enabled(hba)) {
		devfreq_suspend_device(hba->devfreq);
		hba->clk_scaling.window_start_t = 0;
	}
	goto out;

vops_resume: