Re: [PATCH v5 3/6] cpufreq: Centralize boost freq QoS requests

From: Pierre Gondois

Date: Tue Mar 17 2026 - 06:39:41 EST



On 3/13/26 10:22, Viresh Kumar wrote:
On 25-02-26, 09:49, Pierre Gondois wrote:
policy_set_boost() calls the cpufreq set_boost callback.
Update the newly added boost_freq_req request from there:
- whenever boost is toggled
- to cover all possible paths

Signed-off-by: Pierre Gondois<pierre.gondois@xxxxxxx>
---
drivers/cpufreq/cpufreq.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 50467b938668a..42de32488f422 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -603,10 +603,19 @@ static int policy_set_boost(struct cpufreq_policy *policy, bool enable)
policy->boost_enabled = enable;
ret = cpufreq_driver->set_boost(policy, enable);
- if (ret)
+ if (ret) {
policy->boost_enabled = !policy->boost_enabled;
+ return ret;
+ }
- return ret;
+ ret = freq_qos_update_request(policy->boost_freq_req, policy->cpuinfo.max_freq);
+ if (ret < 0) {
+ policy->boost_enabled = !policy->boost_enabled;
+ cpufreq_driver->set_boost(policy, policy->boost_enabled);
+ return ret;
+ }
+
+ return 0;
This can be:

return ret;

Actually the caller expects 0 for success and
freq_qos_update_request() can return a positive value for success, so the code above should be used I think.

and you can then drop 'return ret' from the if block.

And yes, merge with prev patch as Rafael suggested.