From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750994AbdFSOZX (ORCPT ); Mon, 19 Jun 2017 10:25:23 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:46785 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbdFSOZW (ORCPT ); Mon, 19 Jun 2017 10:25:22 -0400 From: "Rafael J. Wysocki" To: Len Brown Cc: X86 ML , Srinivas Pandruvada , "H. Peter Anvin" , Peter Zijlstra , "Rafael J. Wysocki" , Linux PM list , "linux-kernel@vger.kernel.org" , Len Brown Subject: Re: [PATCH 2/5] x86: use common aperfmperf_khz_on_cpu() to calculate KHz using APERF/MPERF Date: Mon, 19 Jun 2017 16:18:07 +0200 Message-ID: <4066164.lk5f1Ou666@aspire.rjw.lan> User-Agent: KMail/4.14.10 (Linux/4.12.0-rc1+; KDE/4.14.9; x86_64; ; ) In-Reply-To: <136184443.Dv0asqkIzm@aspire.rjw.lan> References: <1496889556-17923-1-git-send-email-lenb@kernel.org> <136184443.Dv0asqkIzm@aspire.rjw.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, June 19, 2017 02:28:21 PM Rafael J. Wysocki wrote: > On Friday, June 16, 2017 09:49:00 PM Len Brown wrote: > > On Fri, Jun 16, 2017 at 8:30 PM, Rafael J. Wysocki wrote: > > > On Wednesday, June 07, 2017 07:39:13 PM Len Brown wrote: > > >> From: Len Brown > > [cut] > > > > > > > I wonder if we could change intel_pstate_get() to simply return > > > aperfmperf_khz_on_cpu(cpu_num)? > > > > > > That would allow us to avoid the extra branch here and get rid of the > > > #ifdef x86 from the header. > > > > The reason I put the hook here is specifically so that the same > > code would always be called on the x86 architecture, > > no not matter what cpufreq driver is loaded. > > > > Yes, alternatively, all possible driver.get routines could be updated > > to call the same routine. That is acpi-cpufreq.c, intel_pstate.c, > > others? > > Just acpi-cpufreq.c and intel_pstate.c. > > Moreover, I wouldn't change the behavior on systems using acpi-cpufreq.c, > because why really? Actually, having thought a bit more about this, I see why that may be useful. Also the #ifdef CONFIG_X86 in the header is better than an arch header, at least for now, so I agree with the approach in your patch. Thanks, Rafael