Skip to content
Commit b4a11fa3 authored by Wyes Karny's avatar Wyes Karny Committed by Rafael J. Wysocki
Browse files

cpufreq: Fail driver register if it has adjust_perf without fast_switch



If fast_switch_possible flag is set by the scaling driver, the governor
is free to select fast_switch function even if adjust_perf is set.  Some
scaling drivers which use adjust_perf don't set fast_switch thinking
that the governor would never fall back to fast_switch. But the governor
can fall back to fast_switch even in runtime if frequency invariance is
disabled due to some reason. This could crash the kernel if the driver
didn't set the fast_switch function pointer.

Therefore, fail driver registration if it has adjust_perf without
fast_switch.

Suggested-by: default avatarRafael J. Wysocki <rafael@kernel.org>
Suggested-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarWyes Karny <wyes.karny@amd.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 858fd168
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment