cpufreq: intel_pstate: Fix HWP on boot CPU after system resume
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 2 May 2016 00:27:19 +0000 (02:27 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 2 May 2016 11:48:15 +0000 (13:48 +0200)
commitba41e1bc28bd862089b0fc00e8136aa258a62b21
tree25806e401a76ee786cc923733ed05c17125a1e40
parent2482bc31ca8096241b8fa97610ef23154ce55f45
cpufreq: intel_pstate: Fix HWP on boot CPU after system resume

Commit 41cfd64cf49fc "Update frequencies of policy->cpus only from
->set_policy()" changed the way the intel_pstate driver's ->set_policy
callback updates the HWP (hardware-managed P-states) settings.
A side effect of it is that if those settings are modified on the
boot CPU during system suspend and wakeup, they will never be
restored during subsequent system resume.

To address this problem, allow cpufreq drivers that don't provide
->target or ->target_index callbacks to use ->suspend and ->resume
callbacks and add a ->resume callback to intel_pstate to restore
the HWP settings on the CPUs that belong to the given policy.

Fixes: 41cfd64cf49fc "Update frequencies of policy->cpus only from ->set_policy()"
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/cpufreq.c
drivers/cpufreq/intel_pstate.c