5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lifeng Zheng [ Upstream commit 77cf053b041fe13d1fdd2e572e16ee7776ff687d ] In cpufreq_boost_trigger_state(), if none of the the policies support boost, policy_set_boost() will not be called and this function will return 0. But it is better to return an error to indicate that the platform doesn't support boost. Signed-off-by: Lifeng Zheng Acked-by: Viresh Kumar Reviewed-by: Jie Zhan [ rjw: Subject and changelog edits ] Link: https://patch.msgid.link/20251202072727.1368285-2-zhenglifeng1@huawei.com Signed-off-by: Rafael J. Wysocki Stable-dep-of: a0cde2b601bc ("cpufreq: Preserve global boost state on failed updates") Signed-off-by: Sasha Levin --- drivers/cpufreq/cpufreq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 585ad335f1c31..232243d8b8ce9 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2640,7 +2640,7 @@ int cpufreq_boost_trigger_state(int state) { struct cpufreq_policy *policy; unsigned long flags; - int ret = 0; + int ret = -EOPNOTSUPP; /* * Don't compare 'cpufreq_driver->boost_enabled' with 'state' here to @@ -2657,6 +2657,10 @@ int cpufreq_boost_trigger_state(int state) if (ret) goto err_reset_state; } + + if (ret) + goto err_reset_state; + cpus_read_unlock(); return 0; -- 2.53.0