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

Commit 4709025f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: core: fix issue with devfreq clock scaling"

parents e0d6d013 d37b5850
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -773,6 +773,9 @@ EXPORT_SYMBOL(mmc_suspend_clk_scaling);
int mmc_resume_clk_scaling(struct mmc_host *host)
{
	int err = 0;
	u32 max_clk_idx = 0;
	u32 devfreq_max_clk = 0;
	u32 devfreq_min_clk = 0;

	if (!host) {
		WARN(1, "bad host parameter\n");
@@ -789,7 +792,15 @@ int mmc_resume_clk_scaling(struct mmc_host *host)
	}

	atomic_set(&host->clk_scaling.devfreq_abort, 0);
	host->clk_scaling.curr_freq = host->ios.clock;

	max_clk_idx = host->clk_scaling.freq_table_sz - 1;
	devfreq_max_clk = host->clk_scaling.freq_table[max_clk_idx];
	devfreq_min_clk = host->clk_scaling.freq_table[0];

	host->clk_scaling.curr_freq = devfreq_max_clk;
	if (host->ios.clock < host->card->clk_scaling_highest)
		host->clk_scaling.curr_freq = devfreq_min_clk;

	host->clk_scaling.clk_scaling_in_progress = false;
	host->clk_scaling.need_freq_change = false;