From patchwork Fri May 19 09:28:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mian Yousaf Kaukab X-Patchwork-Id: 9736755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 27D2E6034C for ; Fri, 19 May 2017 09:29:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2578028649 for ; Fri, 19 May 2017 09:29:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 194CB288A9; Fri, 19 May 2017 09:29:33 +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=-6.9 required=2.0 tests=BAYES_00,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 8FDA928649 for ; Fri, 19 May 2017 09:29:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754793AbdESJ3a (ORCPT ); Fri, 19 May 2017 05:29:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:48034 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752816AbdESJ3Q (ORCPT ); Fri, 19 May 2017 05:29:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B6841ADD5; Fri, 19 May 2017 09:29:14 +0000 (UTC) From: Mian Yousaf Kaukab To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org, rafael.j.wysocki@intel.com Cc: sudeep.holla@arm.com, catalin.marinas@arm.com, lorenzo.pieralisi@arm.com, Mian Yousaf Kaukab Subject: [PATCH] ACPI: processor: fix LPI when built as module Date: Fri, 19 May 2017 11:28:37 +0200 Message-Id: <20170519092837.30991-1-yousaf.kaukab@suse.com> X-Mailer: git-send-email 2.11.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 Low Power Idle(LPI) support added acpi_processor_ffh_lpi_probe() and acpi_processor_ffh_lpi_enter() as __weak functions and arch code is supposed to provide the actual callbacks. This breaks if ACPI_PROCESSOR is configured as a module. Add CONFIG_ARCH_HAS_ACPI_LPI configuration option to fix this. Signed-off-by: Mian Yousaf Kaukab --- arch/arm64/Kconfig | 1 + arch/arm64/kernel/cpuidle.c | 2 ++ drivers/acpi/Kconfig | 3 +++ drivers/acpi/processor_idle.c | 9 +++++++-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 848a34116c67..de2f2779cdf5 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -10,6 +10,7 @@ config ARM64 select ARCH_HAS_DEBUG_VIRTUAL select ARCH_HAS_DEVMEM_IS_ALLOWED select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI + select ARCH_HAS_ACPI_LPI if ACPI select ARCH_HAS_ELF_RANDOMIZE select ARCH_HAS_GCOV_PROFILE_ALL select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA diff --git a/arch/arm64/kernel/cpuidle.c b/arch/arm64/kernel/cpuidle.c index fd691087dc9a..002d9cb890bd 100644 --- a/arch/arm64/kernel/cpuidle.c +++ b/arch/arm64/kernel/cpuidle.c @@ -51,9 +51,11 @@ int acpi_processor_ffh_lpi_probe(unsigned int cpu) { return arm_cpuidle_init(cpu); } +EXPORT_SYMBOL(acpi_processor_ffh_lpi_probe); int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi) { return CPU_PM_CPU_IDLE_ENTER(arm_cpuidle_suspend, lpi->index); } +EXPORT_SYMBOL(acpi_processor_ffh_lpi_enter); #endif diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 1ce52f84dc23..7e5a7bce9d72 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -224,6 +224,9 @@ config ACPI_PROCESSOR_IDLE bool select CPU_IDLE +config ARCH_HAS_ACPI_LPI + def_bool n + config ACPI_MCFG bool diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 5c8aa9cf62d7..321fe9acd8e8 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1211,15 +1211,20 @@ static int acpi_processor_get_lpi_info(struct acpi_processor *pr) return 0; } -int __weak acpi_processor_ffh_lpi_probe(unsigned int cpu) +#ifdef CONFIG_ARCH_HAS_ACPI_LPI +int acpi_processor_ffh_lpi_probe(unsigned int cpu); +int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi); +#else +static int acpi_processor_ffh_lpi_probe(unsigned int cpu) { return -ENODEV; } -int __weak acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi) +static int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi) { return -ENODEV; } +#endif /* CONFIG_ARCH_HAS_ACPI_LPI */ /** * acpi_idle_lpi_enter - enters an ACPI any LPI state