]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: Fix up cpufreq_boost_set_sw()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 18 May 2020 10:49:45 +0000 (12:49 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 18 May 2020 11:01:28 +0000 (13:01 +0200)
commite41165f0800e54467cfa0f214e1cb737b3ef8aa5
tree9a616ad8be8fac9c19cb1a3a21dea684077f8458
parent27de53b1d10b8efebc22f6d35b674f6baeaa4d4f
cpufreq: Fix up cpufreq_boost_set_sw()

After commit e30e2ec2413b ("cpufreq: Add QoS requests for userspace
constraints") the return value of freq_qos_update_request(), that can
be 1, passed by cpufreq_boost_set_sw() to its caller sometimes
confuses the latter, which only expects to see 0 or negative error
codes, so notice that cpufreq_boost_set_sw() can return an error code
(which should not be -EINVAL for that matter) as soon as the first
policy without a frequency table is found (because either all policies
have a frequency table or none of them have it) and rework it to meet
its caller's expectations.

Fixes: e30e2ec2413b ("cpufreq: Add QoS requests for userspace constraints")
Reported-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Reported-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 5.3+ <stable@vger.kernel.org> # 5.3+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c