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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1412754534-14068-3-git-send-email-mturquette@linaro.org>
Date:	Wed,  8 Oct 2014 00:48:54 -0700
From:	Mike Turquette <mturquette@...aro.org>
To:	viresh.kumar@...aro.org
Cc:	thomas.petazzoni@...e-electrons.com, rjw@...ysocki.net,
	linaro-kernel@...ts.linaro.org, linux-pm@...r.kernel.org,
	shawn.guo@...aro.org, sboyd@...eaurora.org,
	linux-arm-msm@...r.kernel.org, spk.linux@...il.com,
	pramod.gurav@...rtplayin.com, rob.herring@...aro.org,
	ezequiel.garcia@...e-electrons.com, tawfik@...vell.com,
	nadavh@...vell.com, alior@...vell.com, morten.rasmussen@....com,
	dietmar.eggemann@....com, vincent.guittot@...aro.org,
	nicolas.pitre@...aro.org, linux-kernel@...r.kernel.org,
	tuukka.tikkanen@...aro.org, Mike Turquette <mturquette@...aro.org>
Subject: [PATCH 2/2] cpufreq: new function to query driver for flags

There are cases for CPUfreq driver flags to be exposed outside of the
CPUfreq core code. In particular the CPUFREQ_NO_SLEEP flag can be used
by CPUfreq governors to optimize when and how they call that drivers
.target callback. In fact this knowledge is a requirement for the
on-going work to initiate cpu frequency transitions from the scheduler.

This patch implements a simple function to return the CPUfreq driver
flags. While currently the flags are a u8, that could grow at a future
date and cpufreq_driver_get_flags returns an int. Additionally the
function needs to return an error in case no driver is registered.

Signed-off-by: Mike Turquette <mturquette@...aro.org>
---
 drivers/cpufreq/cpufreq.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 9b471b2..f3b9042 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1980,6 +1980,15 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
 }
 EXPORT_SYMBOL_GPL(cpufreq_driver_target);
 
+int cpufreq_driver_get_flags(void)
+{
+	if (!cpufreq_driver)
+		return -ENODEV;
+
+	return cpufreq_driver->flags;
+}
+EXPORT_SYMBOL_GPL(cpufreq_driver_get_flags);
+
 /*
  * when "event" is CPUFREQ_GOV_LIMITS
  */
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ