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: 7148641 Return-Path: X-Original-To: patchwork-linux-pm@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 A1B0FBEEC1 for ; Wed, 9 Sep 2015 20:27:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CD9E82066B for ; Wed, 9 Sep 2015 20:27:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1C3A2066C for ; Wed, 9 Sep 2015 20:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754600AbbIIU12 (ORCPT ); Wed, 9 Sep 2015 16:27:28 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34802 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754562AbbIIU10 (ORCPT ); Wed, 9 Sep 2015 16:27:26 -0400 Received: by padhy16 with SMTP id hy16so19991141pad.1 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=W8lOeGORH0vlhDpRkAbouZPuTUGVjgHRaYRnnSjU4MzMZgQnUVnwcqZqAZv6iNfYuH Sajt3JGz8w1oVwKlZvWOrAL9AncnIxWSAgeFWC62W6FyzWcowmU5yeRbyrkQHlkCa9zD vMpBtzU/nOdoik1VYTS8hi9SmBj/9hGzjVzBpU5pZOIm9vvB8EjajXDWxkcM3VROZlbT 6LJuKEIxz/VDzX+tLgtFzSOIqoRYEV0JrAqWSCZQrfkcSPcrGu7Wm7h02A8e00B0uMeK fYyXZNA+qkPbIzMbifdXX/2Qg/8DCrvoIsL/MOkzFtyBhfT6Ju5jSLCdbqIPTF/U1N3x rjSQ== X-Gm-Message-State: ALoCoQkJ6czih/4ad0Wws9zBUSA9ezQy7AVMrIrnWHHX9ZaHSNsXPx0eEj2G7gSspvlX9fMW4lLX 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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);