From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753936AbdGSMzv (ORCPT ); Wed, 19 Jul 2017 08:55:51 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:46847 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753641AbdGSMzW (ORCPT ); Wed, 19 Jul 2017 08:55:22 -0400 From: "Rafael J. Wysocki" To: Viresh Kumar Cc: Leonard Crestez , Shuah Khan , linux-kselftest@vger.kernel.org, Octavian Purdila , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests: cpufreq: Check cpuinfo_cur_freq set as expected Date: Wed, 19 Jul 2017 14:47:30 +0200 Message-ID: <3568375.ceg5RryLQe@aspire.rjw.lan> User-Agent: KMail/4.14.10 (Linux/4.12.0-rc1+; KDE/4.14.9; x86_64; ; ) In-Reply-To: <20170719065406.GE352@vireshk-i7> References: <704cfb6696840b3838576ea583b8ab8ed2265aaf.1499858779.git.leonard.crestez@nxp.com> <1500406459.11874.1.camel@nxp.com> <20170719065406.GE352@vireshk-i7> 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 Wednesday, July 19, 2017 12:24:06 PM Viresh Kumar wrote: > On 18-07-17, 22:34, Leonard Crestez wrote: > > The semantics of scaling_cur_freq and cpuinfo_cur_freq are not very > > clear to me. > > cpuinfo_cur_freq reads the frequency right from hardware all the time > and so can be slow. It can only be read by root if I remember > correctly. > > Whereas scaling_cur_freq tries to read the cached frequency. But it > has changed a bit with the below mentioned patch. > > > In my particular case I need to check cpuinfo_cur_freq because this is > > what ends up returning the rate of the arm clk. Otherwise > > scaling_cur_freq just returns policy->cur > > Yeah, we may actually need to use cpuinfo_cur_freq as that is what > ends up giving the real freq. > > > unless the driver has a > > setpolicy function (I don't understand that condition). > > That's because the core doesn't know the cached freq for setpolicy > drivers and so we need to call the ->get() callback. But for non > setpolicy drivers, core already has the cached value. Please remember that cpuinfo_cur_freq may not be present. Thanks, Rafael