Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1691035 > unrolled thread

Re: [PATCH] selftests: cpufreq: Check cpuinfo_cur_freq set as expected

Started byViresh Kumar <viresh.kumar@linaro.org>
First post2017-07-19 09:00 +0200
Last post2017-07-19 15:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] selftests: cpufreq: Check cpuinfo_cur_freq set as  expected Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-19 09:00 +0200
    Re: [PATCH] selftests: cpufreq: Check cpuinfo_cur_freq set as expected "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-19 15:00 +0200

#1691035 — Re: [PATCH] selftests: cpufreq: Check cpuinfo_cur_freq set as expected

FromViresh Kumar <viresh.kumar@linaro.org>
Date2017-07-19 09:00 +0200
SubjectRe: [PATCH] selftests: cpufreq: Check cpuinfo_cur_freq set as expected
Message-ID<u4R7J-4R3-11@gated-at.bofh.it>
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.

-- 
viresh

[toc] | [next] | [standalone]


#1691665 — Re: [PATCH] selftests: cpufreq: Check cpuinfo_cur_freq set as expected

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2017-07-19 15:00 +0200
SubjectRe: [PATCH] selftests: cpufreq: Check cpuinfo_cur_freq set as expected
Message-ID<u4WK7-fH-45@gated-at.bofh.it>
In reply to#1691035
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web