]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: intel_pstate: Fix fast-switch fallback path
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 29 Dec 2020 17:08:18 +0000 (18:08 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 30 Dec 2020 17:22:17 +0000 (18:22 +0100)
commitac0f568bddc68ca9b0d3ebd29dc55ef5006825f7
treecd5401910c4378f5ad3951fbbe32dfc6b7eba854
parent2af7ba1dc0ac24f9c1b6fbed627077d8df258132
cpufreq: intel_pstate: Fix fast-switch fallback path

When sugov_update_single_perf() falls back to the "frequency"
path due to the missing scale-invariance, it will call
cpufreq_driver_fast_switch() via sugov_fast_switch()
and the driver's ->fast_switch() callback will be invoked,
so it must not be NULL.

However, after commit 5526a46f2408 ("cpufreq: intel_pstate: Implement
the ->adjust_perf() callback") intel_pstate sets ->fast_switch() to
NULL when it is going to use intel_cpufreq_adjust_perf(), which is a
mistake, because on x86 the scale-invariance may be turned off
dynamically, so modify it to retain the original ->adjust_perf()
callback pointer.

Fixes: 5526a46f2408 ("cpufreq: intel_pstate: Implement the ->adjust_perf() callback")
Reported-by: Kenneth R. Crudup <kenny@panix.com>
Tested-by: Kenneth R. Crudup <kenny@panix.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c