[PATCH 2/2] cpufreq: arm_scmi: Set fast_switch_possible conditionally

From: Nicola Mazzucato
Date: Wed Jun 17 2020 - 05:44:20 EST


Currently the fast_switch_possible flag is set unconditionally
to true. Based on this, schedutil does not create a
thread for frequency switching and would always use the
fast switch path.
However, if the platform does not support frequency
fast switch, this may cause the governor to attempt an
operation that is not supported by the platform.

Fix this by correctly retrieve the fast_switch capability
from the driver which knows if the platform can support
this feature.

Suggested-by: Lukasz Luba <lukasz.luba@xxxxxxx>
Signed-off-by: Nicola Mazzucato <nicola.mazzucato@xxxxxxx>
---
drivers/cpufreq/scmi-cpufreq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index 61623e2ff149..1cf688fcb56b 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -198,7 +198,8 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)

policy->cpuinfo.transition_latency = latency;

- policy->fast_switch_possible = true;
+ policy->fast_switch_possible =
+ handle->perf_ops->fast_switch_possible(handle, cpu_dev);

em_register_perf_domain(policy->cpus, nr_opp, &em_cb);

--
2.27.0