cpufreq: intel_pstate: Implement QoS supported freq constraints
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 9 Aug 2019 02:22:49 +0000 (07:52 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 20 Aug 2019 22:34:05 +0000 (00:34 +0200)
commitda5c504c7aae96db68c4b38e2564a88e91842d89
tree6030156f5da8adb9bac05c37b7bd2bfff8f32f97
parent62c23a89fd269f0308226b63ac4a427339b6f945
cpufreq: intel_pstate: Implement QoS supported freq constraints

Intel pstate driver exposes min_perf_pct and max_perf_pct sysfs files,
which can be used to force a limit on the min/max P state of the driver.
Though these files eventually control the min/max frequencies that the
CPUs will run at, they don't make a change to policy->min/max values.

When the values of these files are changed (in passive mode of the
driver), it leads to calling ->limits() callback of the cpufreq
governors, like schedutil. On a call to it the governors shall
forcefully update the frequency to come within the limits. Since the
limits, i.e.  policy->min/max, aren't updated by the driver, the
governors fails to get the target freq within limit and sometimes aborts
the update believing that the frequency is already set to the target
value.

This patch implements the QoS supported frequency constraints to update
policy->min/max values whenever min_perf_pct or max_perf_pct files are
updated. This is only done for the passive mode as of now, as the driver
is already working fine in active mode.

Fixes: ecd288429126 ("cpufreq: schedutil: Don't set next_freq to UINT_MAX")
Reported-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c