From patchwork Thu Apr 11 12:47:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qian Cai X-Patchwork-Id: 10895947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2AB761669 for ; Thu, 11 Apr 2019 12:48:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1146928D09 for ; Thu, 11 Apr 2019 12:48:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F21728D27; Thu, 11 Apr 2019 12:48:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7075D28D09 for ; Thu, 11 Apr 2019 12:48:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727164AbfDKMsR (ORCPT ); Thu, 11 Apr 2019 08:48:17 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:44284 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfDKMsQ (ORCPT ); Thu, 11 Apr 2019 08:48:16 -0400 Received: by mail-qk1-f193.google.com with SMTP id y5so3315805qkc.11 for ; Thu, 11 Apr 2019 05:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v8YRfd9/nj3nRdlwjpQLHs10suvZojy3m14ocFvDPe4=; b=Y9VX6vF2V1EJfosrzQrn4ay9uuwewLljC4/FiNawTYohOkPKfDhpyfVWKSE4wRsPcE r/61hfBw4a8V/rSNVObB863dCOJQlGBjm3Ukcj46RHvOhvQ1yzfxIJjB8sSCipRh/7v3 8uBYQ5+QtmQX+pN54gNHpmdwcMSJXV2pcNOaPCecMRlPSEFOzccuh++bB0Qj84I+1PxT Rkd397UkPCcbZCniuV9cigeB2KfAPfwKyrsdiOrwoILojl07jnOAy/D0gQpHJ5Tx+Rt4 q+CaAq3pY/1lq8YuFqrc1DIl8VC0rvFZAdLHkWZ1+5t4rHR7UCw4+e8U9LW2nzNtDsDe UBOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=v8YRfd9/nj3nRdlwjpQLHs10suvZojy3m14ocFvDPe4=; b=MatmuMXX9zUlRZ/cRUzRdcJqMoiNXKAKI4jpw0o0yrJcH2hORShcaXCi6m2Cr/nAPS BfdAmoR3l8fCDspJGYrnwoYTB0fPeL3B/Ap5c8DDnqqsNCw5s4dZEdP1mbeGbgvAkI33 OckSt3qtE7TU/BYtZPkHNxH/iIj77KBsENWx5EEbrfGRoDmlJYHsCmAL7hCUwxgkQSX8 SsODvAAy3OvE3y47i7F5b2aWgPEifyUrrZMsjp543kMpn8pZYNU0ZxtmCyMqskbMFdxJ P+IRZU1q7CG6I6PALvxgrd/uhd+MUnHS6fycMH5TPWWHnRch1Ub3ORvcgYZ/dRZeFTvt e6/g== X-Gm-Message-State: APjAAAVCeNOBvZlMNGTz9+tyHyHjHIqnByxLe+lEccxdEmohJrpx+653 dU4QYK5hBMmDqM2vPITfDFV8Gw== X-Google-Smtp-Source: APXvYqzJO6AqlihTSDk0OKRS6AaYTxiEL6t84h+G7QNTt9KrjNL6e4bxpTt8yZFhioQyHIrDxrJoyQ== X-Received: by 2002:ae9:e002:: with SMTP id m2mr38822766qkk.178.1554986895974; Thu, 11 Apr 2019 05:48:15 -0700 (PDT) Received: from Qians-MBP.fios-router.home (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id q6sm24745152qkj.87.2019.04.11.05.48.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 05:48:15 -0700 (PDT) From: Qian Cai To: gregkh@linuxfoundation.org Cc: rjw@rjwysocki.net, khilman@kernel.org, ulf.hansson@linaro.org, pavel@ucw.cz, len.brown@intel.com, lina.iyer@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Qian Cai Subject: [PATCH -next] power/domain_governor: fix a compilation error Date: Thu, 11 Apr 2019 08:47:39 -0400 Message-Id: <20190411124739.5542-1-cai@lca.pw> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; + } } }