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


Groups > linux.kernel > #1695886

Re: [PATCH] cpufreq: intel_pstate: Fix cpuinfo_cur_freq after performance governor changes

From "Rafael J. Wysocki" <rjw@rjwysocki.net>
Newsgroups linux.kernel
Subject Re: [PATCH] cpufreq: intel_pstate: Fix cpuinfo_cur_freq after performance governor changes
Date 2017-07-25 17:50 +0200
Message-ID <u7afV-4DI-53@gated-at.bofh.it> (permalink)
References <u6EpI-Fb-3@gated-at.bofh.it> <u6YeJ-5ys-3@gated-at.bofh.it> <u6YeJ-5ys-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Monday, July 24, 2017 07:57:45 PM Srinivas Pandruvada wrote:
> On Tue, 2017-07-25 at 01:46 +0000, Huaisheng HS1 Ye wrote:
> > Hi Rafael,
> > 
> > If you delete "get" function implement within intel_pstate, the 
> > sysfs interface cpuinfo_cur_freq will display <unknown> all the
> > time. 
> cpuinfo_cur_freq by definition should show actual frequency HW
> frequency. 

Right.

> Unless I missed something. So Len Brown's patch should also
> take care of this to get from arch specific function is available.
> So in addition to Rafael's change, what about this?
> 
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 9bf97a3..29ec687 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -689,8 +689,13 @@ store_one(scaling_max_freq, max);
>  static ssize_t show_cpuinfo_cur_freq(struct cpufreq_policy *policy,
>                                         char *buf)
>  {
> -       unsigned int cur_freq = __cpufreq_get(policy);
> +       unsigned int cur_freq;
>  
> +       cur_freq = arch_freq_get_on_cpu(policy->cpu);
> +       if (cur_freq)
> +               return sprintf(buf, "%u\n", cur_freq);
> +
> +       cur_freq = __cpufreq_get(policy);
>         if (cur_freq)
>                 return sprintf(buf, "%u\n", cur_freq);
> 

So also by definition cpuinfo_cur_freq should not return the same thing as
scaling_cur_freq.

I actually would like cpuinfo_cur_freq to not be present at all, I need to
check why it still shows up if ->get is not present.

Thanks,
Rafael

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] cpufreq: intel_pstate: Fix cpuinfo_cur_freq after performance  governor changes Huaisheng HS1 Ye <yehs1@lenovo.com> - 2017-07-24 07:50 +0200
  Re: [PATCH] cpufreq: intel_pstate: Fix cpuinfo_cur_freq after performance governor changes "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-24 13:50 +0200
    Re: [PATCH] cpufreq: intel_pstate: Fix cpuinfo_cur_freq after performance governor changes "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-25 02:10 +0200
      Re: [PATCH] cpufreq: intel_pstate: Fix cpuinfo_cur_freq after  performance governor changes Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2017-07-25 05:00 +0200
        Re: [PATCH] cpufreq: intel_pstate: Fix cpuinfo_cur_freq after  performance governor changes Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2017-07-25 16:40 +0200
        Re: [PATCH] cpufreq: intel_pstate: Fix cpuinfo_cur_freq after performance governor changes "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-25 17:50 +0200
          [PATCH] cpufreq: intel_pstate: Drop ->get from intel_pstate structure "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-26 01:00 +0200
            Re: [PATCH] cpufreq: intel_pstate: Drop ->get from intel_pstate  structure Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-27 05:50 +0200
        Re: [PATCH] cpufreq: intel_pstate: Fix cpuinfo_cur_freq after performance governor changes "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-26 00:00 +0200

csiph-web