From patchwork Thu Jul 9 18:04:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashwin Chaugule X-Patchwork-Id: 6758031 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3C5D99F536 for ; Thu, 9 Jul 2015 18:04:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3204D20670 for ; Thu, 9 Jul 2015 18:04:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 332D02069A for ; Thu, 9 Jul 2015 18:04:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754635AbbGISEj (ORCPT ); Thu, 9 Jul 2015 14:04:39 -0400 Received: from mail-qk0-f175.google.com ([209.85.220.175]:35690 "EHLO mail-qk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753992AbbGISEe (ORCPT ); Thu, 9 Jul 2015 14:04:34 -0400 Received: by qkbp125 with SMTP id p125so191103023qkb.2 for ; Thu, 09 Jul 2015 11:04:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=gr4y5u3U/mz3LzxBki5ffKv9i7wWiG5pBsHhaADRn9Q=; b=M/aXEJfZX6TOoxjzea7asrlgG5id+EwGpRzWDiUdk0kGRHgD7zXgyFTUB1JznNp68y nyxYdgfLwLpRVgBlw1LKlEifZhDT5PyPSNMm2DJ/eSYfIWq6gpM7PQ8n6EjzguSumeQu 4qm1eudI3aVBDaNjuosrzqgI5BMot9XvBQOeT0Om0RQOAbdYzCMtZiZGO2ELeLBPxPug hiMlhPvFQUztvLrdMd9TpFh75/5QTp/0In3kPcNvtuZe0posQnL7bZgLKjViIGctU5zi 1oVIfei4GMpJWCMLCAYTIynTMYpJfyYOZjW5Llmet1OSc8XHvtXE+tyhCveKtjGZXO1Q 4rkg== X-Gm-Message-State: ALoCoQkFZHSzawdU8S/Y7bwhNsuhi8pf6YE6Hq+tN3v079vLOlYd/XYB8eDdLtEwRgQStbqLQruq X-Received: by 10.55.25.30 with SMTP id k30mr26114208qkh.26.1436465074065; Thu, 09 Jul 2015 11:04:34 -0700 (PDT) Received: from esagroth.qualcomm.com (rrcs-67-52-130-30.west.biz.rr.com. [67.52.130.30]) by smtp.gmail.com with ESMTPSA id x79sm3969918qha.10.2015.07.09.11.04.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 11:04:33 -0700 (PDT) From: Ashwin Chaugule To: rjw@rjwysocki.net, jaswinder.singh@linaro.org Cc: linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, linaro-acpi@lists.linaro.org, patches@linaro.org, viresh.kumar@linaro.org, sudeep.holla@arm.com, Ashwin Chaugule Subject: [PATCH v7 3/8] ACPI: Decouple ACPI idle and ACPI processor drivers Date: Thu, 9 Jul 2015 14:04:19 -0400 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces a new Kconfig symbol, ACPI_PROCESSOR_IDLE, which is auto selected by architectures which support the ACPI based C states for CPU Idle management. The processor_idle driver in its present form contains declarations specific to X86 and IA64. Since there are no reasonable defaults for other architectures e.g. ARM64, the driver is selected only by the arch/x86/Kconfig. This helps in decoupling the ACPI processor_driver from the ACPI processor_idle driver which is useful for the upcoming alternative patchwork for controlling CPU Performance (CPPC) and CPU Idle (LPI). Signed-off-by: Ashwin Chaugule --- drivers/acpi/Kconfig | 6 +++++- drivers/acpi/Makefile | 3 ++- include/acpi/processor.h | 26 ++++++++++++++++++++++++-- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 00748dc..8a60b6e 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -177,9 +177,13 @@ config ACPI_CPU_FREQ_PSS monitoring. It is required by several flavors of cpufreq performance-state drivers. +config ACPI_PROCESSOR_IDLE + def_bool y + depends on X86 || IA64 + config ACPI_PROCESSOR tristate "Processor" - select CPU_IDLE + select CPU_IDLE if ACPI_PROCESSOR_IDLE depends on X86 || IA64 default y help diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 62e32bd..0633af6 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -82,7 +82,8 @@ obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o obj-$(CONFIG_ACPI_BGRT) += bgrt.o # processor has its own "processor." module_param namespace -processor-y := processor_driver.o processor_idle.o +processor-y := processor_driver.o +processor-$(CONFIG_ACPI_PROCESSOR_IDLE) += processor_idle.o processor-$(CONFIG_ACPI_CPU_FREQ_PSS) += processor_perflib.o \ processor_throttling.o processor_thermal.o diff --git a/include/acpi/processor.h b/include/acpi/processor.h index bedcab3..c071a92 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -369,13 +369,35 @@ static inline void acpi_processor_throttling_init(void) {} #endif /* CONFIG_ACPI_CPU_FREQ_PSS */ /* in processor_idle.c */ +extern struct cpuidle_driver acpi_idle_driver; +#ifdef CONFIG_ACPI_PROCESSOR_IDLE int acpi_processor_power_init(struct acpi_processor *pr); int acpi_processor_power_exit(struct acpi_processor *pr); int acpi_processor_cst_has_changed(struct acpi_processor *pr); int acpi_processor_hotplug(struct acpi_processor *pr); -extern struct cpuidle_driver acpi_idle_driver; +#else +static inline int acpi_processor_power_init(struct acpi_processor *pr) +{ + return -ENODEV; +} + +static inline int acpi_processor_power_exit(struct acpi_processor *pr) +{ + return -ENODEV; +} + +static inline int acpi_processor_cst_has_changed(struct acpi_processor *pr) +{ + return -ENODEV; +} + +static inline int acpi_processor_hotplug(struct acpi_processor *pr) +{ + return -ENODEV; +} +#endif /* CONFIG_ACPI_PROCESSOR_IDLE */ -#ifdef CONFIG_PM_SLEEP +#if defined(CONFIG_PM_SLEEP) & defined(CONFIG_ACPI_PROCESSOR_IDLE) void acpi_processor_syscore_init(void); void acpi_processor_syscore_exit(void); #else