cpufreq: scmi: Fix frequency invariance in slow path
Subsystems (2)
PATCH 1/1 cpufreq: scmi: Fix frequency invariance in slow path
The scmi-cpufreq driver calls the arch_set_freq_scale() callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a broken freq_scale factor.
Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table.
message protocol")
--- drivers/cpufreq/scmi-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cpufreq/scmi-cpufreq.c +2 -2
@@ -52,9 +52,9 @@ scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)int ret;struct scmi_data *priv = policy->driver_data;struct scmi_perf_ops *perf_ops = handle->perf_ops; -u64 freq = policy->freq_table[index].frequency *1000 ; +u64 freq = policy->freq_table[index].frequency; - ret = perf_ops->freq_set (handle, priv->domain_id, freq, false); + ret = perf_ops->freq_set (handle, priv->domain_id, freq *1000 , false);if (!ret)arch_set_freq_scale (policy->related_cpus, freq, policy->cpuinfo.max_freq);
Signature · 1 line
2.20.1
Quoted 22 lines · Quentin Perret
The scmi-cpufreq driver calls the
arch_set_freq_scale()callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a brokenfreq_scalefactor.Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table.
Fixes 99d6bdf33877 ("cpufreq: add support for CPU DVFS based on SCMImessage protocol")
Signed-off-by Quentin Perret <[email protected]>--- drivers/cpufreq/scmi-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/cpufreq/scmi-cpufreq.c +0
-0@@ -52,9 +52,9 @@ scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)int ret;
drivers/cpufreq/scmi-cpufreq.c scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) · line 60
Quoted 10 lines
drivers/cpufreq/scmi-cpufreq.c +2
-2struct scmi_data *priv = policy->driver_data;struct scmi_perf_ops *perf_ops = handle->perf_ops; -u64 freq = policy->freq_table[index].frequency *1000 ; +u64 freq = policy->freq_table[index].frequency; - ret = perf_ops->freq_set (handle, priv->domain_id, freq, false); + ret = perf_ops->freq_set (handle, priv->domain_id, freq *1000 , false);if (!ret)arch_set_freq_scale (policy->related_cpus, freq, policy->cpuinfo.max_freq);
Signature · 1 line
viresh
Quoted 28 lines · CET Viresh Kumar
Quoted 27 lines · Quentin Perret
The scmi-cpufreq driver calls the
arch_set_freq_scale()callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a brokenfreq_scalefactor.Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table.
Fixes 99d6bdf33877 ("cpufreq: add support for CPU DVFS based on SCMImessage protocol")
Signed-off-by Quentin Perret <[email protected]>--- drivers/cpufreq/scmi-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/cpufreq/scmi-cpufreq.c +1
-1@@ -52,9 +52,9 @@ scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)int ret;struct scmi_data *priv = policy->driver_data;struct scmi_perf_ops *perf_ops = handle->perf_ops; -u64 freq = policy->freq_table[index].frequency *1000 ; +u64 freq = policy->freq_table[index].frequency;
Quoted 7 lines
drivers/cpufreq/scmi-cpufreq.c scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) · line 60
Quoted 5 lines
drivers/cpufreq/scmi-cpufreq.c +1
-1- ret = perf_ops->freq_set (handle, priv->domain_id, freq, false); + ret = perf_ops->freq_set (handle, priv->domain_id, freq *1000 , false);if (!ret)arch_set_freq_scale (policy->related_cpus, freq, policy->cpuinfo.max_freq);Acked-by Viresh Kumar <[email protected]>
This would be stable-candidate I guess?
Quoted 37 lines · Rafael J. Wysocki
Quoted 28 lines · CET Viresh Kumar
Quoted 27 lines · Quentin Perret
The scmi-cpufreq driver calls the
arch_set_freq_scale()callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a brokenfreq_scalefactor.Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table.
Fixes 99d6bdf33877 ("cpufreq: add support for CPU DVFS based on SCMImessage protocol")
Signed-off-by Quentin Perret <[email protected]>--- drivers/cpufreq/scmi-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/cpufreq/scmi-cpufreq.c +1
-1@@ -52,9 +52,9 @@ scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)int ret;struct scmi_data *priv = policy->driver_data;struct scmi_perf_ops *perf_ops = handle->perf_ops; -u64 freq = policy->freq_table[index].frequency *1000 ; +u64 freq = policy->freq_table[index].frequency;Quoted 7 lines
drivers/cpufreq/scmi-cpufreq.c scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) · line 60
Quoted 5 lines
drivers/cpufreq/scmi-cpufreq.c +1
-1- ret = perf_ops->freq_set (handle, priv->domain_id, freq, false); + ret = perf_ops->freq_set (handle, priv->domain_id, freq *1000 , false);if (!ret)arch_set_freq_scale (policy->related_cpus, freq, policy->cpuinfo.max_freq);Acked-by Viresh Kumar <[email protected]>
Quoted 1 line
This would be stable-candidate I guess?
I think so yes. I was hoping the 'Fixes:' tag would be enough ? Or do I still need to CC stable too ?
Thanks,
Quentin
Quoted 38 lines · CET Quentin Perret
Quoted 37 lines · Rafael J. Wysocki
Quoted 35 lines · CET Viresh Kumar
Quoted 22 lines · Quentin Perret
The scmi-cpufreq driver calls the
arch_set_freq_scale()callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a brokenfreq_scalefactor.Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table.
Fixes 99d6bdf33877 ("cpufreq: add support for CPU DVFS based on SCMImessage protocol")
Signed-off-by Quentin Perret <[email protected]>--- drivers/cpufreq/scmi-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/cpufreq/scmi-cpufreq.c +0
-0@@ -52,9 +52,9 @@ scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)int ret;drivers/cpufreq/scmi-cpufreq.c scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) · line 60
Quoted 10 lines
drivers/cpufreq/scmi-cpufreq.c +2
-2struct scmi_data *priv = policy->driver_data;struct scmi_perf_ops *perf_ops = handle->perf_ops; -u64 freq = policy->freq_table[index].frequency *1000 ; +u64 freq = policy->freq_table[index].frequency; - ret = perf_ops->freq_set (handle, priv->domain_id, freq, false); + ret = perf_ops->freq_set (handle, priv->domain_id, freq *1000 , false);if (!ret)arch_set_freq_scale (policy->related_cpus, freq, policy->cpuinfo.max_freq);Acked-by Viresh Kumar <[email protected]>
Quoted 3 lines
Quoted 1 line
This would be stable-candidate I guess?
I think so yes. I was hoping the 'Fixes:' tag would be enough ?
It doesn't cause -stable to pick up commits automatically if that's what you're asking about.
Quoted 1 line
Or do I still need to CC stable too ?
No, you don't need to (and should not) CC -stable yourself.
You can, however, add a Cc: <stable..> tag to the patch which helps maintainers a bit.
Quoted 46 lines · Rafael J. Wysocki
Quoted 38 lines · CET Quentin Perret
Quoted 37 lines · Rafael J. Wysocki
Quoted 35 lines · CET Viresh Kumar
Quoted 22 lines · Quentin Perret
The scmi-cpufreq driver calls the
arch_set_freq_scale()callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a brokenfreq_scalefactor.Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table.
Fixes 99d6bdf33877 ("cpufreq: add support for CPU DVFS based on SCMImessage protocol")
Signed-off-by Quentin Perret <[email protected]>--- drivers/cpufreq/scmi-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/cpufreq/scmi-cpufreq.c +0
-0@@ -52,9 +52,9 @@ scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)int ret;drivers/cpufreq/scmi-cpufreq.c scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) · line 60
Quoted 10 lines
drivers/cpufreq/scmi-cpufreq.c +2
-2struct scmi_data *priv = policy->driver_data;struct scmi_perf_ops *perf_ops = handle->perf_ops; -u64 freq = policy->freq_table[index].frequency *1000 ; +u64 freq = policy->freq_table[index].frequency; - ret = perf_ops->freq_set (handle, priv->domain_id, freq, false); + ret = perf_ops->freq_set (handle, priv->domain_id, freq *1000 , false);if (!ret)arch_set_freq_scale (policy->related_cpus, freq, policy->cpuinfo.max_freq);Acked-by Viresh Kumar <[email protected]>Quoted 3 lines
Quoted 1 line
This would be stable-candidate I guess?
I think so yes. I was hoping the 'Fixes:' tag would be enough ?
It doesn't cause -stable to pick up commits automatically if that's what you're asking about.
Quoted 6 lines
Quoted 1 line
Or do I still need to CC stable too ?
No, you don't need to (and should not) CC -stable yourself.
You can, however, add a Cc: <stable..> tag to the patch which helps maintainers a bit.
OK, will do from now on.
Thanks !
Quentin
Viresh Kumar
maintainerQuoted 37 lines · Rafael J. Wysocki
Quoted 28 lines · CET Viresh Kumar
Quoted 27 lines · Quentin Perret
The scmi-cpufreq driver calls the
arch_set_freq_scale()callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a brokenfreq_scalefactor.Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table.
Fixes 99d6bdf33877 ("cpufreq: add support for CPU DVFS based on SCMImessage protocol")
Signed-off-by Quentin Perret <[email protected]>--- drivers/cpufreq/scmi-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/cpufreq/scmi-cpufreq.c +1
-1@@ -52,9 +52,9 @@ scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)int ret;struct scmi_data *priv = policy->driver_data;struct scmi_perf_ops *perf_ops = handle->perf_ops; -u64 freq = policy->freq_table[index].frequency *1000 ; +u64 freq = policy->freq_table[index].frequency;Quoted 7 lines
drivers/cpufreq/scmi-cpufreq.c scmi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) · line 60
Quoted 5 lines
drivers/cpufreq/scmi-cpufreq.c +1
-1- ret = perf_ops->freq_set (handle, priv->domain_id, freq, false); + ret = perf_ops->freq_set (handle, priv->domain_id, freq *1000 , false);if (!ret)arch_set_freq_scale (policy->related_cpus, freq, policy->cpuinfo.max_freq);Acked-by Viresh Kumar <[email protected]>
Quoted 1 line
This would be stable-candidate I guess?
Signature · 1 line
viresh
Quoted 11 lines · Quentin Perret
The scmi-cpufreq driver calls the
arch_set_freq_scale()callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a brokenfreq_scalefactor.Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table.
Fixes 99d6bdf33877 ("cpufreq: add support for CPU DVFS based on SCMImessage protocol")
Good find.
--
Regards,
Sudeep
Rafael J. Wysocki
AppliedQuoted 10 lines · CET Sudeep Holla
Quoted 9 lines · Quentin Perret
The scmi-cpufreq driver calls the
arch_set_freq_scale()callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a brokenfreq_scalefactor.Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table.
Quoted 6 lines
Quoted 2 lines
Fixes 99d6bdf33877 ("cpufreq: add support for CPU DVFS based on SCMImessage protocol")
Good find.
Acked-by Sudeep Holla <[email protected]>
Applied, thanks!