mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-27 04:22:58 +00:00
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: Rafael J. Wysocki <rafael@kernel.org> Suggested-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Wyes Karny <wyes.karny@amd.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
858fd168a9
commit
b4a11fa333
@@ -340,7 +340,10 @@ struct cpufreq_driver {
|
||||
/*
|
||||
* ->fast_switch() replacement for drivers that use an internal
|
||||
* representation of performance levels and can pass hints other than
|
||||
* the target performance level to the hardware.
|
||||
* the target performance level to the hardware. This can only be set
|
||||
* if ->fast_switch is set too, because in those cases (under specific
|
||||
* conditions) scale invariance can be disabled, which causes the
|
||||
* schedutil governor to fall back to the latter.
|
||||
*/
|
||||
void (*adjust_perf)(unsigned int cpu,
|
||||
unsigned long min_perf,
|
||||
|
||||
Reference in New Issue
Block a user