From patchwork Thu Jul 9 18:04:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashwin Chaugule X-Patchwork-Id: 6758121 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CE775C05AC for ; Thu, 9 Jul 2015 18:04:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0B8720461 for ; Thu, 9 Jul 2015 18:04:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F82B20670 for ; Thu, 9 Jul 2015 18:04:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754143AbbGISEt (ORCPT ); Thu, 9 Jul 2015 14:04:49 -0400 Received: from mail-qg0-f44.google.com ([209.85.192.44]:35230 "EHLO mail-qg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753242AbbGISEi (ORCPT ); Thu, 9 Jul 2015 14:04:38 -0400 Received: by qget71 with SMTP id t71so118787174qge.2 for ; Thu, 09 Jul 2015 11:04:38 -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=iPQAdaQKQEFRsK+BTL9krBQdR/Kg5zYT0mMxTloUMRE=; b=U6+uudZTexTK3oYpt8p5Qg6YIgCIlHSA1Cv6ylBxBNYtQkh6FZxXdk6GSpM7lRoMll KWzAqFMZUOgbXA234zkRi7OvrK01pMMQ9FSt0PYGOYX2MJA3ew+sPWwUT1ywIothWlMz YlY/mjVWtbmywkCQKXCOkhmq+3/EVlrIVWZ+d5GGs7E6C75fm3de4P2sX+T/DEH9848L rTeRmcj7MpFZ1oank0auBD6vRmnMpziOI2pIbKrAJ4nXdtMA5IW1N8g9+l97dj1DtDqM Yid+493G0/xogjPqrhbq/1LiruWHanP7co6fBdWxGem46d2MKoI5s6YGOxn7l4GkYbRI JntA== X-Gm-Message-State: ALoCoQnS8+3WwK8PFNcy5q5Q0Hf6sIIQ3FunW+PYUifXM/SihLfSkWlPMP1b0/NKRoN9LllSaTRf X-Received: by 10.55.20.166 with SMTP id 38mr26758179qku.12.1436465077977; Thu, 09 Jul 2015 11:04:37 -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.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 11:04:37 -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 7/8] CPPC: Probe for CPPC tables for each ACPI Processor object Date: Thu, 9 Jul 2015 14:04:23 -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=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 For each detected ACPI Processor object (ACPI0007), search its device handle for CPPC specific tables (i.e. _CPC) and extract CPU specific performance capabilities. Signed-off-by: Ashwin Chaugule Reviewed-by: Al Stone --- arch/arm64/Kconfig | 1 + drivers/acpi/Kconfig | 2 +- drivers/acpi/processor_driver.c | 4 ++++ include/acpi/processor.h | 9 +++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7796af4..feff114 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -83,6 +83,7 @@ config ARM64 select SPARSE_IRQ select SYSCTL_EXCEPTION_TRACE select HAVE_CONTEXT_TRACKING + select ACPI_CPPC_LIB if ACPI help ARM 64-bit (AArch64) Linux support. diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 54d73bb..097c02a 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -198,7 +198,7 @@ config ACPI_CPPC_LIB config ACPI_PROCESSOR tristate "Processor" select CPU_IDLE if ACPI_PROCESSOR_IDLE - depends on X86 || IA64 + depends on X86 || IA64 || ARM64 default y help This driver adds support for the ACPI Processor package. It is required diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 16d44ad..ac3dd51 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -246,6 +246,10 @@ static int __acpi_processor_start(struct acpi_device *device) if (pr->flags.need_hotplug_init) return 0; + result = acpi_cppc_processor_probe(pr); + if (result) + return -ENODEV; + if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver) acpi_processor_power_init(pr); diff --git a/include/acpi/processor.h b/include/acpi/processor.h index c071a92..6e53b5e 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -328,6 +328,15 @@ phys_cpuid_t acpi_get_phys_id(acpi_handle, int type, u32 acpi_id); int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id); int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id); +#ifdef CONFIG_ACPI_CPPC_LIB +extern int acpi_cppc_processor_probe(struct acpi_processor *pr); +#else +static inline int acpi_cppc_processor_probe(struct acpi_processor *pr) +{ + return 0; +} +#endif /* CONFIG_ACPI_CPPC_LIB */ + /* in processor_pdc.c */ void acpi_processor_set_pdc(acpi_handle handle);