lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1588929064-30270-2-git-send-email-wangxiongfeng2@huawei.com>
Date:   Fri, 8 May 2020 17:11:02 +0800
From:   Xiongfeng Wang <wangxiongfeng2@...wei.com>
To:     <rjw@...ysocki.net>, <viresh.kumar@...aro.org>,
        <Souvik.Chakravarty@....com>, <Thanu.Rangarajan@....com>
CC:     <Sudeep.Holla@....com>, <guohanjun@...wei.com>,
        <john.garry@...wei.com>, <jonathan.cameron@...wei.com>,
        <linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <wangxiongfeng2@...wei.com>
Subject: [RFC PATCH 1/3] cpufreq: fix the return value in 'cpufreq_boost_set_sw()'

When I try to add SW BOOST support for CPPC, I got the following error:
cpufreq: cpufreq_boost_trigger_state: Cannot enable BOOST
cpufreq: store_boost: Cannot enable BOOST!

It is because return value 1 of 'freq_qos_update_request()' means the
effective constraint value has changed, not a error code on failures.
But for 'cpufreq_driver.set_boost()', a nonzero return value means
failure. So change 'ret' to zero when 'freq_qos_update_request()'
returns a positive value.

Signed-off-by: Xiongfeng Wang <wangxiongfeng2@...wei.com>
---
 drivers/cpufreq/cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 4adac3a..475fb1b 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2522,6 +2522,8 @@ static int cpufreq_boost_set_sw(int state)
 		ret = freq_qos_update_request(policy->max_freq_req, policy->max);
 		if (ret < 0)
 			break;
+		else
+			ret = 0;
 	}
 
 	return ret;
-- 
1.7.12.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ