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: 6758041 Return-Path: X-Original-To: patchwork-linux-pm@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 106539F9C4 for ; Thu, 9 Jul 2015 18:04:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AA7220461 for ; Thu, 9 Jul 2015 18:04:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33BA1206C7 for ; Thu, 9 Jul 2015 18:04:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754636AbbGISEj (ORCPT ); Thu, 9 Jul 2015 14:04:39 -0400 Received: from mail-qk0-f180.google.com ([209.85.220.180]:32946 "EHLO mail-qk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754133AbbGISEe (ORCPT ); Thu, 9 Jul 2015 14:04:34 -0400 Received: by qkhu186 with SMTP id u186so191376550qkh.0 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=TctP2u/Uo/GHSvCnbBlCySuRynAULuOlQNk/YciSTCDHvcqoNBixdWYW4vCiZxpWMV CtJ5Hdkb4qrIGj1lmnNFfAaTZ880ObT/Pe/iIPSsSGtDwRcL+e6+GijiKi0PTd6zww4b 71N9YVa2nEGlhod/OltJisGjqUptpWNKxwMuEjA6vCgps7X8oeq4AWK2MK4F5ZitdhRq Y7K9cIFd/hbcfAhS1S5Ww/+XbcKqUXs/8or6CA85UnYiQMDMlOuikg6RiyjbEfgygPD9 KW+Og7KhdmXPy3DndQK7Gs9fuubCh59o4XNuF7wvrjpZbGL/Z7gmbbA9RLUYiHmWBLjK qUQQ== X-Gm-Message-State: ALoCoQnsEQQfIRIhdlbw2Lgz2s6uJBb3N/pMS3WdfCd3Hyf3lc9hsGS7u6PBIsWciNZPC4nT4B3Z 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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=unavailable 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