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

Commit 0961dd0d authored by Thomas Renninger's avatar Thomas Renninger Committed by Dave Jones
Browse files

[CPUFREQ] _PPC frequency change issues



BIOS might change frequency behind our back when BIOS changes allowed
frequencies via _PPC.  In this case cpufreq core got out of sync.
Ask driver for current freq and notify governors about a change

Signed-off-by: default avatarThomas Renninger <trenn@suse.de>
Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent c70ca00f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1429,6 +1429,14 @@ int cpufreq_update_policy(unsigned int cpu)
	policy.policy = data->user_policy.policy;
	policy.governor = data->user_policy.governor;

	/* BIOS might change freq behind our back
	  -> ask driver for current freq and notify governors about a change */
	if (cpufreq_driver->get) {
		policy.cur = cpufreq_driver->get(cpu);
		if (data->cur != policy.cur)
			cpufreq_out_of_sync(cpu, data->cur, policy.cur);
	}

	ret = __cpufreq_set_policy(data, &policy);

	mutex_unlock(&data->lock);