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: 6758111 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 E5F189F380 for ; Thu, 9 Jul 2015 18:04:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0335820461 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 1ED7720647 for ; Thu, 9 Jul 2015 18:04:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753464AbbGISEt (ORCPT ); Thu, 9 Jul 2015 14:04:49 -0400 Received: from mail-qg0-f45.google.com ([209.85.192.45]:35230 "EHLO mail-qg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752950AbbGISEi (ORCPT ); Thu, 9 Jul 2015 14:04:38 -0400 Received: by qget71 with SMTP id t71so118787172qge.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=WQ0DS4UTpkhKifc7E4xjyexqGe34908jTbWBOsMlKT3WRRlg5Re6x8kjn9Qk+6x34D gZtpaiEEop9ahYYFKuYaDcHDG+26hZh9uAflg4rFxQzcCV08S5dz2CTZpCFedHDkqKLy /ThrubvuLe7g7DyE9HySv0HdKv780TVFLkSpdTH6MMMxz1Fit+9PbOe+69PVWKMz09J+ cykGkuiGptt01sIV4WUfyjpp4JbVLoFneoycoPAbSkPHEHyrrSJ/9T+kU5FKMLtjFNfs c8aV11Rlf0dLLomPc1suUmLMYuDcVUEHojmN52PzsOljlZGCBXLIZHhNxrEZZj/6Y8Tu 0EmA== X-Gm-Message-State: ALoCoQkIuQ/OE04KXZ8QBihG4IvWMkFf8KuZgjj4OTt71yod5qBGetL7UZuUJ11yvCsMG9DPnbP2 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-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=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 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);