From: "Rafael J. Wysocki" Subject: Re: [PATCH v9 1/5] ACPI: Introduce CPU performance controls using CPPC Date: Fri, 02 Oct 2015 00:02:05 +0200 Message-ID: <2003142.IBZn391liD@vostro.rjw.lan> References: <14309818.LXTR0vLlii@vostro.rjw.lan> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7Bit Return-path: Received: from v094114.home.net.pl ([79.96.170.134]:55959 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750762AbbJAVdn (ORCPT ); Thu, 1 Oct 2015 17:33:43 -0400 In-Reply-To: Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Ashwin Chaugule Cc: Sudeep Holla , "linux-pm@vger.kernel.org" , linux acpi , Linaro ACPI Mailman List , Patch Tracking , Viresh Kumar , "rwells@codeaurora.org" On Thursday, October 01, 2015 06:20:50 AM Ashwin Chaugule wrote: > Hi Rafael, > > On 28 September 2015 at 09:36, Rafael J. Wysocki wrote: > > On Sunday, September 27, 2015 01:15:20 PM Ashwin Chaugule wrote: > >> On 25 September 2015 at 20:05, Rafael J. Wysocki wrote: > >> > On Wednesday, September 09, 2015 04:27:04 PM Ashwin Chaugule wrote: > >> >> +int cppc_get_perf_ctrs(int cpunum, struct cppc_perf_fb_ctrs *perf_fb_ctrs) > >> >> +{ > >> >> + struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum); > >> >> + struct cpc_register_resource *delivered_reg, *reference_reg; > >> >> + u64 delivered, reference; > >> >> + int ret = 0; > >> >> + > >> >> + if (!cpc_desc) { > >> >> + pr_debug("No CPC descriptor for CPU:%d\n", cpunum); > >> >> + return -ENODEV; > >> >> + } > >> >> + > >> >> + delivered_reg = &cpc_desc->cpc_regs[DELIVERED_CTR]; > >> >> + reference_reg = &cpc_desc->cpc_regs[REFERENCE_CTR]; > >> >> + > >> >> + spin_lock(&pcc_lock); > >> > > >> > I still have the question about this lock. > >> > > >> > Why does it have to be a spinlock? > >> > >> The idea is to let CPUs send in their requests as quickly as possible. > >> The PCC transaction only relays the request. So the CPUs don't really > >> wait for all the clk + voltage toggling etc. I think any other > >> primitive, might cause unnecessary delays in sending requests. > > > > It might if there was contention. > > > >> Also FWIW, this is another thing I was influenced by from the pcc-cpufreq.c > >> driver. :) > > > > OK, so this sounds like an optimization, which is fine. > > > > Great. Would you prefer a git pull request No pull requests, please. > with the kernel doc + compiler warning fix, or should I send V10 ? You can simply update the patches that need to be updated. Thanks, Rafael