cpufreq: intel_pstate: Update max frequency on global turbo changes
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 26 Mar 2019 11:19:52 +0000 (12:19 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 8 Apr 2019 09:26:09 +0000 (11:26 +0200)
commit9083e4986124389e2a7c0ffca95630a4983887f0
tree8025aa0b9e8d68f10fccc83c1102870493ff7ff1
parent9eca544b1491df90ea7102a7ed14acc3c562d97b
cpufreq: intel_pstate: Update max frequency on global turbo changes

While the cpuinfo.max_freq value doesn't really matter for
intel_pstate in the active mode, in the passive mode it is used by
governors as the maximum physical frequency of the CPU and the
results of governor computations generally depend on it.  Also it
is made available to user space via sysfs and it should match the
current HW configuration.

For this reason, make intel_pstate update cpuinfo.max_freq for all
CPUs if it detects a global change of turbo frequency settings from
"disable" to "enable" or the other way associated with a _PPC change
notification from the platform firmware.

Note that policy_is_inactive(),  cpufreq_cpu_acquire(),
cpufreq_cpu_release(), and cpufreq_set_policy() need to be made
available to it for this purpose.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=200759
Reported-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.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
include/linux/cpufreq.h