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: 50983 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 134F7213FD for ; Thu, 9 Jul 2015 18:04:40 +0000 (UTC) Received: by wipp2 with SMTP id p2sf62227123wip.2 for ; Thu, 09 Jul 2015 11:04:39 -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=gr4y5u3U/mz3LzxBki5ffKv9i7wWiG5pBsHhaADRn9Q=; b=XJ42nHZVGeOqNuI/uoK3XpzfObjty/Fz6aE0bhIFCXHl+wNfkZ3yxWl44A4DiOosqR /QVWUWIhYx5y+qlEMID/wViyKZTI2KVquygI8KkUlCTNOFXGpiRIzLUSzPy4hcwtp17i iUcjmRVBjJEh98Y3JJx9j41Z1Sbku4CVIwYu8kt9e9/puJlR6KRX7B9z9Di5YglgrFlk VK71Zcug1hYDElzHHATFYIn6F5crClBWwqA1Er6hZaQCIZCgF+tXKHf4OENppzSwoniy Fbfn3TUtAdVrnr3ZSAlhna7PDkREgFW/gm+M0lWRj6skdSpTaYvma7nUOJWXFeBx9lge Nucg== X-Gm-Message-State: ALoCoQn/RrfJGze2iPg1eoZ7L2QkOtA+IlLtLOl13K4S/MraTcXCUe/ItLMqJGEA0lcX1nlROEsS X-Received: by 10.180.87.201 with SMTP id ba9mr24440475wib.3.1436465079421; Thu, 09 Jul 2015 11:04:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.204 with SMTP id jq12ls1138850lab.4.gmail; Thu, 09 Jul 2015 11:04:39 -0700 (PDT) X-Received: by 10.152.120.135 with SMTP id lc7mr15691423lab.107.1436465079232; Thu, 09 Jul 2015 11:04:39 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id n3si2008474lbg.156.2015.07.09.11.04.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 11:04:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lblf12 with SMTP id f12so10117017lbl.2 for ; Thu, 09 Jul 2015 11:04:39 -0700 (PDT) X-Received: by 10.152.4.163 with SMTP id l3mr16287197lal.35.1436465079134; Thu, 09 Jul 2015 11:04:39 -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.108.230 with SMTP id hn6csp828459lbb; Thu, 9 Jul 2015 11:04:38 -0700 (PDT) X-Received: by 10.140.84.137 with SMTP id l9mr26671416qgd.94.1436465074713; Thu, 09 Jul 2015 11:04:34 -0700 (PDT) Received: from mail-qk0-f177.google.com (mail-qk0-f177.google.com. [209.85.220.177]) by mx.google.com with ESMTPS id c73si6949310qka.81.2015.07.09.11.04.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 11:04:34 -0700 (PDT) Received-SPF: pass (google.com: domain of ashwin.chaugule@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by qkcl188 with SMTP id l188so7923525qkc.1 for ; Thu, 09 Jul 2015 11:04:34 -0700 (PDT) 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: 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.217.173 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 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