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: 53335 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id B966C22B19 for ; Wed, 9 Sep 2015 20:27:40 +0000 (UTC) Received: by lamp12 with SMTP id p12sf7612609lam.2 for ; Wed, 09 Sep 2015 13:27: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=ALFKfd4RdmVtDKM6Ru+OG0Vw/vfSWT9Q5Lrl5K40mDA=; b=JfpDiA4CA8396rfqxgbB3dyjkhxZCDM8JdW7J3UmmgYKE4IlzW1zZxNdgrQ8SWWWKr 9jk2laofrBA0esqZ2SXZf2pZp4IO6N+7gTzS00cYZQOYmCWZWJIMoEqk7aMXeFiv+DCI PTgjQleOYmOXstA4cvYXgKGwp1HM0fR1W32YJDR3bRU0ZSHbTbr3MKU8dCVFurJIOxZN 9Ko1ZJ8kFaye8bqEF3iIX9rqccMhQ+JneC/twqhSaGUX9BwDjzdjcbixZPDLB69NwgmT MwhJxfBFAEAFehz07Xy8Y1ah+/Fub5opptuuu1rtaPihEFv3YNBPr8zOghLH4Z80cIH0 0IYQ== X-Gm-Message-State: ALoCoQnVXuRmyyfXv1fEqKNMS3XWhgxYmzhqIaqS/tJm30V03rHwTNCjKiQ7H60eR2CkDC5pHdau X-Received: by 10.180.12.205 with SMTP id a13mr8738235wic.4.1441830459018; Wed, 09 Sep 2015 13:27:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.40 with SMTP id kv8ls107145lac.94.gmail; Wed, 09 Sep 2015 13:27:38 -0700 (PDT) X-Received: by 10.153.7.75 with SMTP id da11mr15607390lad.103.1441830458854; Wed, 09 Sep 2015 13:27:38 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id ms1si7795605lbb.159.2015.09.09.13.27.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Sep 2015 13:27:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lanb10 with SMTP id b10so14570712lan.3 for ; Wed, 09 Sep 2015 13:27:38 -0700 (PDT) X-Received: by 10.112.125.134 with SMTP id mq6mr20082893lbb.19.1441830458757; Wed, 09 Sep 2015 13:27:38 -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.59.35 with SMTP id w3csp542020lbq; Wed, 9 Sep 2015 13:27:37 -0700 (PDT) X-Received: by 10.66.141.135 with SMTP id ro7mr15197032pab.115.1441830447488; Wed, 09 Sep 2015 13:27:27 -0700 (PDT) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com. [209.85.220.51]) by mx.google.com with ESMTPS id oo8si13352345pbc.101.2015.09.09.13.27.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Sep 2015 13:27:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ashwin.chaugule@linaro.org designates 209.85.220.51 as permitted sender) client-ip=209.85.220.51; Received: by padhk3 with SMTP id hk3so19834440pad.3 for ; Wed, 09 Sep 2015 13:27:26 -0700 (PDT) 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: 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.215.42 as permitted sender) smtp.mailfrom=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: , 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);