From patchwork Wed Sep 9 20:27:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashwin Chaugule X-Patchwork-Id: 7148631 X-Patchwork-Delegate: rjw@sisk.pl 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 C384BBF036 for ; Wed, 9 Sep 2015 20:27:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0F1F2066B for ; Wed, 9 Sep 2015 20:27:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 19B7B209D2 for ; Wed, 9 Sep 2015 20:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754565AbbIIU12 (ORCPT ); Wed, 9 Sep 2015 16:27:28 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:33073 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754409AbbIIU10 (ORCPT ); Wed, 9 Sep 2015 16:27:26 -0400 Received: by pacex6 with SMTP id ex6so20027296pac.0 for ; Wed, 09 Sep 2015 13:27:26 -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=ALFKfd4RdmVtDKM6Ru+OG0Vw/vfSWT9Q5Lrl5K40mDA=; b=VfVj2+wN5kBLdiizXqcLrQLvTjpfOwDbrkccfVezxY27vNi9beupdvQlRSCdh/jMUK DfbvQdE3q1CA1zYnBGWEi/2nys+am5OKbxDgnXWWtgg0SkZPxXHjWfJTT8qZp2Iar/pv YHGLk9cG3VQiGPZxZ/PHmzfC+8cc1sl37Vj9rVLdIOUxC3GytIOnMlpi6QDEPk0PZkon fg0X7OAP0Sl2D3Gel58EQPRy3onSzGdCoMhrzC7PPqI12lIZm8duLb7z7ezXsL5y9CbG TVTJEdxjYBoKLdCQj4LhtQAjajhHz2y1nACc/TaO/gz7Iws+tQTD1p+Jf5VxLPxFaodz 3tpA== X-Gm-Message-State: ALoCoQkrUjiybfkoB0sLEiJ9r77NKKAN9dFQANesTlqWZSo28Y1vdED2gshej+YBgHT/m7dWv4Ej X-Received: by 10.67.5.228 with SMTP id cp4mr66565293pad.120.1441830446577; Wed, 09 Sep 2015 13:27:26 -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 md10sm7992049pdb.0.2015.09.09.13.27.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Sep 2015 13:27:25 -0700 (PDT) From: Ashwin Chaugule To: rjw@rjwysocki.net 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 v9 4/5] CPPC: Probe for CPPC tables for each ACPI Processor object Date: Wed, 9 Sep 2015 16:27:07 -0400 Message-Id: <69ca1142f09949fbbdaf27fe120941f93706fb9b.1441830300.git.ashwin.chaugule@linaro.org> 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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 --- drivers/acpi/processor_driver.c | 6 ++++++ include/acpi/processor.h | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 16d44ad..6519c22 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); @@ -291,6 +295,8 @@ static int acpi_processor_stop(struct device *dev) acpi_pss_perf_exit(pr, device); + acpi_cppc_processor_exit(pr); + return 0; } diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 2c4e7a9..43ee1bf 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -314,6 +314,20 @@ 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); +extern void acpi_cppc_processor_exit(struct acpi_processor *pr); +#else +static inline int acpi_cppc_processor_probe(struct acpi_processor *pr) +{ + return 0; +} +static inline void acpi_cppc_processor_exit(struct acpi_processor *pr) +{ + return; +} +#endif /* CONFIG_ACPI_CPPC_LIB */ + /* in processor_pdc.c */ void acpi_processor_set_pdc(acpi_handle handle);