cpufreq: amd-pstate: Add ->fast_switch() callback
authorGautham R. Shenoy <gautham.shenoy@amd.com>
Wed, 17 May 2023 16:28:15 +0000 (16:28 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 May 2023 17:39:16 +0000 (19:39 +0200)
commit4badf2eb1e986bdbf34dd2f5d4c979553a86fe54
treefc40941961ae5b05d2cb8f950168d3d6f16169f6
parent44c026a73be8038f03dbdeef028b642880cf1511
cpufreq: amd-pstate: Add ->fast_switch() callback

Schedutil normally calls the adjust_perf callback for drivers with
adjust_perf callback available and fast_switch_possible flag set.
However, when frequency invariance is disabled and schedutil tries to
invoke fast_switch. So, there is a chance of kernel crash if this
function pointer is not set. To protect against this scenario add
fast_switch callback to amd_pstate driver.

Fixes: 1d215f0319c2 ("cpufreq: amd-pstate: Add fast switch function for AMD P-State")
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Signed-off-by: Wyes Karny <wyes.karny@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/amd-pstate.c