From patchwork Wed Aug 5 13:40:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashwin Chaugule X-Patchwork-Id: 51947 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 1F90722A15 for ; Wed, 5 Aug 2015 13:41:07 +0000 (UTC) Received: by lbcjj5 with SMTP id jj5sf13443872lbc.1 for ; Wed, 05 Aug 2015 06:41:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=eV+ipyVIXhP7DOBl9WKqD+4jiW20on01ZyC8ganDbME=; b=dPLZ6op99eNK93qP+jMI9bW8yJjpZhmsWwcOwwEgSLfRxTgTRbFOZYubDg7jv8I2kA HwlqRPCSVZlNFY9Rn1T2+5Q4RSzC6dEn5O3Z1GMhcVy97463vNhIQ0JoAnsnXVvd9th3 LXx04O9TwgfjmgLEUOOO4nsOUEeWhUIYksZ+bVulsqEBj27mnP2IzR1nvcse9XYLz9va 1TB3+0B5qwhY+QlihsEEuN3mDBlYtKJNTWYNy0hLyau5HwY6xtf8RgjHx5EscvpB1aLB 35jJPJE/3P/XsZmtAl8v7jtgF+k+DZlJxzPLTmjLDMKe6hI25UH/cb411L0FzdmrHhGa 9P8A== X-Gm-Message-State: ALoCoQm1d7pwRxKognD3gcFBedYS06kQHQHoaxVNO/aknCd5RhJBBhWJ1lU1MIluu6KHeCye2NS8 X-Received: by 10.152.182.226 with SMTP id eh2mr2785055lac.0.1438782066046; Wed, 05 Aug 2015 06:41:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.224.162 with SMTP id rd2ls175461lac.84.gmail; Wed, 05 Aug 2015 06:41:05 -0700 (PDT) X-Received: by 10.152.37.196 with SMTP id a4mr9494907lak.59.1438782065756; Wed, 05 Aug 2015 06:41:05 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id n4si2223440laj.18.2015.08.05.06.41.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Aug 2015 06:41:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by labjt7 with SMTP id jt7so11392406lab.0 for ; Wed, 05 Aug 2015 06:41:05 -0700 (PDT) X-Received: by 10.112.160.42 with SMTP id xh10mr9318863lbb.88.1438782065481; Wed, 05 Aug 2015 06:41:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.7.198 with SMTP id l6csp380414lba; Wed, 5 Aug 2015 06:41:04 -0700 (PDT) X-Received: by 10.13.203.143 with SMTP id n137mr9205159ywd.109.1438782056588; Wed, 05 Aug 2015 06:40:56 -0700 (PDT) Received: from mail-yk0-f173.google.com (mail-yk0-f173.google.com. [209.85.160.173]) by mx.google.com with ESMTPS id e125si1791255ywf.83.2015.08.05.06.40.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Aug 2015 06:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of ashwin.chaugule@linaro.org designates 209.85.160.173 as permitted sender) client-ip=209.85.160.173; Received: by ykeo23 with SMTP id o23so35158272yke.3 for ; Wed, 05 Aug 2015 06:40:56 -0700 (PDT) X-Received: by 10.129.114.69 with SMTP id n66mr9012590ywc.102.1438782055935; Wed, 05 Aug 2015 06:40:55 -0700 (PDT) Received: from esagroth.lan ([98.122.160.202]) by smtp.gmail.com with ESMTPSA id g187sm2768031ywf.35.2015.08.05.06.40.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Aug 2015 06:40:54 -0700 (PDT) From: Ashwin Chaugule To: rjw@rjwysocki.net, jaswinder.singh@linaro.org Cc: sudeep.holla@arm.com, linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, linaro-acpi@lists.linaro.org, patches@linaro.org, viresh.kumar@linaro.org, rwells@codeaurora.org, Ashwin Chaugule Subject: [PATCH v8 3/9] ACPI: Decouple ACPI idle and ACPI processor drivers Date: Wed, 5 Aug 2015 09:40:26 -0400 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ashwin.chaugule@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 for X86 or IA64. 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 d6e2a86..54e9729 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -193,10 +193,14 @@ config ACPI_CPU_FREQ_PSS bool select THERMAL +config ACPI_PROCESSOR_IDLE + bool + select CPU_IDLE + config ACPI_PROCESSOR tristate "Processor" depends on X86 || IA64 - select CPU_IDLE + select ACPI_PROCESSOR_IDLE select ACPI_CPU_FREQ_PSS default y help diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 7e97aef..3ea59ae 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -80,7 +80,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_throttling.o \ processor_thermal.o processor-$(CONFIG_CPU_FREQ) += processor_perflib.o diff --git a/include/acpi/processor.h b/include/acpi/processor.h index b6c9178..2c4e7a9 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -355,13 +355,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