cpufreq: intel_pstate: Enable HWP during system resume on CPU0
authorChen Yu <yu.c.chen@intel.com>
Mon, 29 Jan 2018 02:27:57 +0000 (10:27 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 8 Feb 2018 09:21:38 +0000 (10:21 +0100)
When maxcpus=1 is in the kernel command line, the BP is responsible
for re-enabling the HWP - because currently only the APs invoke
intel_pstate_hwp_enable() during their online process - which might
put the system into unstable state after resume.

Fix this by enabling the HWP explicitly on BP during resume.

Reported-by: Doug Smythies <dsmythies@telus.net>
Suggested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Yu Chen <yu.c.chen@intel.com>
[ rjw: Subject/changelog, minor modifications ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c

index 7edf7a0e5a96ac988b546476c06077e2aca483ae..6d084c61ee2532e44d05df2dcc57bdb32d0d793f 100644 (file)
@@ -779,6 +779,8 @@ static int intel_pstate_hwp_save_state(struct cpufreq_policy *policy)
        return 0;
 }
 
+static void intel_pstate_hwp_enable(struct cpudata *cpudata);
+
 static int intel_pstate_resume(struct cpufreq_policy *policy)
 {
        if (!hwp_active)
@@ -786,6 +788,9 @@ static int intel_pstate_resume(struct cpufreq_policy *policy)
 
        mutex_lock(&intel_pstate_limits_lock);
 
+       if (policy->cpu == 0)
+               intel_pstate_hwp_enable(all_cpu_data[policy->cpu]);
+
        all_cpu_data[policy->cpu]->epp_policy = 0;
        intel_pstate_hwp_set(policy->cpu);