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-next>] [day] [month] [year] [list]
Date: Fri, 8 Mar 2024 14:59:21 +0800
From: PoShao Chen <poshao.chen@...iatek.com>
To: <linux-kernel@...r.kernel.org>, <linux-pm@...r.kernel.org>
CC: <lukasz.luba@....com>, <dietmar.eggemann@....com>, <rafael@...nel.org>,
	<mingo@...nel.org>, <rafael.j.wysocki@...el.com>, <rui.zhang@...el.com>,
	<vincent.guittot@...aro.org>, <daniel.lezcano@...aro.org>,
	<viresh.kumar@...aro.org>, <amit.kachhap@...il.com>,
	<clive.lin@...iatek.com>, <ccj.yeh@...iatek.com>,
	<ching-hao.hsu@...iatek.com>, <poshao.chen@...iatek.com>
Subject: [PATCH 1/2] PM: EM: Add macro em_is_microwatts()

This patch adds a new macro, em_is_microwatts(), which checks if
the EM_PERF_DOMAIN_MICROWATTS flag is set for a given Energy Model.
This macro enables other parts of the kernel, such as cooling
devices, to easily determine the unit of power used by the Energy
Model and to perform the necessary conversions if the values
are provided in microwatts.

Signed-off-by: PoShao Chen <poshao.chen@...iatek.com>
---
 include/linux/energy_model.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h
index 770755df852f..68145b4368d1 100644
--- a/include/linux/energy_model.h
+++ b/include/linux/energy_model.h
@@ -92,6 +92,7 @@ struct em_perf_domain {
 
 #define em_span_cpus(em) (to_cpumask((em)->cpus))
 #define em_is_artificial(em) ((em)->flags & EM_PERF_DOMAIN_ARTIFICIAL)
+#define em_is_microwatts(em) ((em)->flags & EM_PERF_DOMAIN_MICROWATTS)
 
 #ifdef CONFIG_ENERGY_MODEL
 /*
-- 
2.18.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ