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]
Message-Id: <20190411124739.5542-1-cai@lca.pw>
Date:   Thu, 11 Apr 2019 08:47:39 -0400
From:   Qian Cai <cai@....pw>
To:     gregkh@...uxfoundation.org
Cc:     rjw@...ysocki.net, khilman@...nel.org, ulf.hansson@...aro.org,
        pavel@....cz, len.brown@...el.com, lina.iyer@...aro.org,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Qian Cai <cai@....pw>
Subject: [PATCH -next] power/domain_governor: fix a compilation error

The commit 50899f7d5078 ("PM / Domains: Add genpd governor for CPUs")
introduced a compilation error on arm64 with CONFIG_CPU_IDLE=n because
cpuidle_devices is undefined there.

drivers/base/power/domain_governor.o: In function `cpu_power_down_ok':
drivers/base/power/domain_governor.c:263: undefined reference to
'cpuidle_devices' ld: drivers/base/power/domain_governor.o: relocation
R_AARCH64_ADR_PREL_PG_HI21 against symbol 'cpuidle_devices' which may
bind externally can not be used when making a shared object; recompile
with -fPIC
drivers/base/power/domain_governor.c:263:(.text+0x638): dangerous
relocation: unsupported relocation
drivers/base/power/domain_governor.c:263: undefined reference to
'cpuidle_devices'
make: *** [Makefile:1047: vmlinux] Error 1

Signed-off-by: Qian Cai <cai@....pw>
---
 drivers/base/power/domain_governor.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/base/power/domain_governor.c b/drivers/base/power/domain_governor.c
index 39c8a699cb53..252d88fcf760 100644
--- a/drivers/base/power/domain_governor.c
+++ b/drivers/base/power/domain_governor.c
@@ -270,11 +270,13 @@ static bool cpu_power_down_ok(struct dev_pm_domain *pd)
 	 */
 	domain_wakeup = ktime_set(KTIME_SEC_MAX, 0);
 	for_each_cpu_and(cpu, genpd->cpus, cpu_online_mask) {
-		dev = per_cpu(cpuidle_devices, cpu);
-		if (dev) {
-			next_hrtimer = READ_ONCE(dev->next_hrtimer);
-			if (ktime_before(next_hrtimer, domain_wakeup))
-				domain_wakeup = next_hrtimer;
+		if (IS_ENABLED(CONFIG_CPU_IDLE)) {
+			dev = per_cpu(cpuidle_devices, cpu);
+			if (dev) {
+				next_hrtimer = READ_ONCE(dev->next_hrtimer);
+				if (ktime_before(next_hrtimer, domain_wakeup))
+					domain_wakeup = next_hrtimer;
+			}
 		}
 	}
 
-- 
2.20.1 (Apple Git-117)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ