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: <20220207073036.14901-3-lukasz.luba@arm.com>
Date:   Mon,  7 Feb 2022 07:30:36 +0000
From:   Lukasz Luba <lukasz.luba@....com>
To:     linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Cc:     amit.kachhap@...il.com, daniel.lezcano@...aro.org,
        viresh.kumar@...aro.org, rafael@...nel.org, amitk@...nel.org,
        rui.zhang@...el.com, dietmar.eggemann@....com, lukasz.luba@....com,
        Pierre.Gondois@....com
Subject: [PATCH 2/2] powercap: DTPM: Check Energy Model type for power values scale

The Energy Model power values might be in an abstract scale. In such case
it's safe to bail out during the registration, since the PowerCap
framework supports only micro-Watts.

Signed-off-by: Lukasz Luba <lukasz.luba@....com>
---
 drivers/powercap/dtpm_cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c
index b740866b228d..e6bcde081de4 100644
--- a/drivers/powercap/dtpm_cpu.c
+++ b/drivers/powercap/dtpm_cpu.c
@@ -188,7 +188,7 @@ static int cpuhp_dtpm_cpu_online(unsigned int cpu)
 		return 0;
 
 	pd = em_cpu_get(cpu);
-	if (!pd)
+	if (!pd || !(pd->flags & EM_PERF_DOMAIN_MILLIWATTS))
 		return -EINVAL;
 
 	dtpm_cpu = per_cpu(dtpm_per_cpu, cpu);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ