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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Jun 2023 07:26:21 +0000 (09:26 +0200)
commit55ce796e9b0a36926e4ab8c4cb2f03c4533f2a22
treea14d7602fa8d780d4cd3ba1244dfd661175b6719
parentc18f6919b4e7175747f67c9a085549c2c03fff20
cpufreq: amd-pstate: Add ->fast_switch() callback

commit 4badf2eb1e986bdbf34dd2f5d4c979553a86fe54 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpufreq/amd-pstate.c