1. 14 10月, 2016 1 次提交
  2. 13 10月, 2016 3 次提交
  3. 10 10月, 2016 2 次提交
    • R
      cpufreq: intel_pstate: Clarify comment in get_target_pstate_use_performance() · f00593a4
      Rafael J. Wysocki 提交于
      Make the comment explaining the meaning of the perf_scaled variable
      in get_target_pstate_use_performance() more straightforward.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f00593a4
    • S
      cpufreq: intel_pstate: Fix unsafe HWP MSR access · f9f4872d
      Srinivas Pandruvada 提交于
      This is a requirement that MSR MSR_PM_ENABLE must be set to 0x01 before
      reading MSR_HWP_CAPABILITIES on a given CPU. If cpufreq init() is
      scheduled on a CPU which is not same as policy->cpu or migrates to a
      different CPU before calling msr read for MSR_HWP_CAPABILITIES, it
      is possible that MSR_PM_ENABLE was not to set to 0x01 on that CPU.
      This will cause GP fault. So like other places in this path
      rdmsrl_on_cpu should be used instead of rdmsrl.
      
      Moreover the scope of MSR_HWP_CAPABILITIES is on per thread basis, so it
      should be read from the same CPU, for which MSR MSR_HWP_REQUEST is
      getting set.
      
      dmesg dump or warning:
      
      [   22.014488] WARNING: CPU: 139 PID: 1 at arch/x86/mm/extable.c:50 ex_handler_rdmsr_unsafe+0x68/0x70
      [   22.014492] unchecked MSR access error: RDMSR from 0x771
      [   22.014493] Modules linked in:
      [   22.014507] CPU: 139 PID: 1 Comm: swapper/0 Not tainted 4.7.5+ #1
      ...
      ...
      [   22.014516] Call Trace:
      [   22.014542]  [<ffffffff813d7dd1>] dump_stack+0x63/0x82
      [   22.014558]  [<ffffffff8107bc8b>] __warn+0xcb/0xf0
      [   22.014561]  [<ffffffff8107bcff>] warn_slowpath_fmt+0x4f/0x60
      [   22.014563]  [<ffffffff810676f8>] ex_handler_rdmsr_unsafe+0x68/0x70
      [   22.014564]  [<ffffffff810677d9>] fixup_exception+0x39/0x50
      [   22.014604]  [<ffffffff8102e400>] do_general_protection+0x80/0x150
      [   22.014610]  [<ffffffff817f9ec8>] general_protection+0x28/0x30
      [   22.014635]  [<ffffffff81687940>] ? get_target_pstate_use_performance+0xb0/0xb0
      [   22.014642]  [<ffffffff810600c7>] ? native_read_msr+0x7/0x40
      [   22.014657]  [<ffffffff81688123>] intel_pstate_hwp_set+0x23/0x130
      [   22.014660]  [<ffffffff81688406>] intel_pstate_set_policy+0x1b6/0x340
      [   22.014662]  [<ffffffff816829bb>] cpufreq_set_policy+0xeb/0x2c0
      [   22.014664]  [<ffffffff81682f39>] cpufreq_init_policy+0x79/0xe0
      [   22.014666]  [<ffffffff81682cb0>] ? cpufreq_update_policy+0x120/0x120
      [   22.014669]  [<ffffffff816833a6>] cpufreq_online+0x406/0x820
      [   22.014671]  [<ffffffff8168381f>] cpufreq_add_dev+0x5f/0x90
      [   22.014717]  [<ffffffff81530ac8>] subsys_interface_register+0xb8/0x100
      [   22.014719]  [<ffffffff816821bc>] cpufreq_register_driver+0x14c/0x210
      [   22.014749]  [<ffffffff81fe1d90>] intel_pstate_init+0x39d/0x4d5
      [   22.014751]  [<ffffffff81fe13f2>] ? cpufreq_gov_dbs_init+0x12/0x12
      
      Cc: 4.3+ <stable@vger.kernel.org> # 4.3+
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f9f4872d
  4. 26 9月, 2016 2 次提交
  5. 17 9月, 2016 3 次提交
  6. 14 9月, 2016 1 次提交
  7. 13 9月, 2016 7 次提交
    • A
      cpufreq: CPPC: Force reporting values in KHz to fix user space interface · ad38677d
      Al Stone 提交于
      When CPPC is being used by ACPI on arm64, user space tools such as
      cpupower report CPU frequency values from sysfs that are incorrect.
      
      What the driver was doing was reporting the values given by ACPI tables
      in whatever scale was used to provide them.  However, the ACPI spec
      defines the CPPC values as unitless abstract numbers.  Internal kernel
      structures such as struct perf_cap, in contrast, expect these values
      to be in KHz.  When these struct values get reported via sysfs, the
      user space tools also assume they are in KHz, causing them to report
      incorrect values (for example, reporting a CPU frequency of 1MHz when
      it should be 1.8GHz).
      
      The downside is that this approach has some assumptions:
      
         (1) It relies on SMBIOS3 being used, *and* that the Max Frequency
         value for a processor is set to a non-zero value.
      
         (2) It assumes that all processors run at the same speed, or that
         the CPPC values have all been scaled to reflect relative speed.
         This patch retrieves the largest CPU Max Frequency from a type 4 DMI
         record that it can find.  This may not be an issue, however, as a
         sampling of DMI data on x86 and arm64 indicates there is often only
         one such record regardless.  Since CPPC is relatively new, it is
         unclear if the ACPI ASL will always be written to reflect any sort
         of relative performance of processors of differing speeds.
      
         (3) It assumes that performance and frequency both scale linearly.
      
      For arm64 servers, this may be sufficient, but it does rely on
      firmware values being set correctly.  Hence, other approaches will
      be considered in the future.
      
      This has been tested on three arm64 servers, with and without DMI, with
      and without CPPC support.
      Signed-off-by: NAl Stone <ahs3@redhat.com>
      Signed-off-by: NPrashanth Prakash <pprakash@codeaurora.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ad38677d
    • V
      cpufreq: create link to policy only for registered CPUs · 26619804
      Viresh Kumar 提交于
      If a cpufreq driver is registered very early in the boot stage (e.g.
      registered from postcore_initcall()), then cpufreq core may generate
      kernel warnings for it.
      
      In this case, the CPUs are brought online, then the cpufreq driver is
      registered, and then the CPU topology devices are registered. However,
      by the time cpufreq_add_dev() gets called, the cpu device isn't stored
      in the per-cpu variable (cpu_sys_devices,) which is read by
      get_cpu_device().
      
      So the cpufreq core fails to get device for the CPU, for which
      cpufreq_add_dev() was called in the first place and we will hit a
      WARN_ON(!cpu_dev).
      
      Even if we reuse the 'dev' parameter passed to cpufreq_add_dev() to
      avoid that warning, there might be other CPUs online that share the
      policy with the cpu for which cpufreq_add_dev() is called. Eventually
      get_cpu_device() will return NULL for them as well, and we will hit the
      same WARN_ON() again.
      
      In order to fix these issues, change cpufreq core to create links to the
      policy for a cpu only when cpufreq_add_dev() is called for that CPU.
      
      Reuse the 'real_cpus' mask to track that as well.
      
      Note that cpufreq_remove_dev() already handles removal of the links for
      individual CPUs and cpufreq_add_dev() has aligned with that now.
      Reported-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Tested-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      26619804
    • J
      intel_pstate: constify local structures · 42ce8921
      Julia Lawall 提交于
      For structure types defined in the same file or local header files, find
      top-level static structure declarations that have the following
      properties:
      1. Never reassigned.
      2. Address never taken
      3. Not passed to a top-level macro call
      4. No pointer or array-typed field passed to a function or stored in a
      variable.
      Declare structures having all of these properties as const.
      
      Done using Coccinelle.
      Based on a suggestion by Joe Perches <joe@perches.com>.
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      42ce8921
    • V
      cpufreq: dt: Support governor tunables per policy · 297a6622
      Viresh Kumar 提交于
      The cpufreq-dt driver is also used for systems with multiple
      clock/voltage domains for CPUs, i.e. multiple cpufreq policies in a
      system.
      
      And in such cases the platform users may want to enable "governor
      tunables per policy". Support that via platform data, as not all users
      of the driver would want that behavior.
      Reported-by: NJuri Lelli <Juri.Lelli@arm.com>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      297a6622
    • V
      cpufreq: dt: Update kconfig description · 33cc4fc1
      Viresh Kumar 提交于
      The cpufreq DT driver also supports systems that have multiple
      clock/voltage domains for CPUs, i.e. multiple policy systems.
      
      The description of the Kconfig entry was never updated after the driver
      was modified to support such systems, fix it.
      Reported-by: NJuri Lelli <Juri.Lelli@arm.com>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      33cc4fc1
    • V
      cpufreq: dt: Remove unused code · e86eee6b
      Viresh Kumar 提交于
      This is leftover from an earlier patch which removed the usage of
      platform data but forgot to remove this line. Remove it now.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e86eee6b
    • G
      cpufreq: dt: Add support for r8a7792 · ffdf8b86
      Geert Uytterhoeven 提交于
      Add the compatible string for supporting the generic cpufreq driver on
      the Renesas R-Car V2H (r8a7792) SoC.
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ffdf8b86
  8. 01 9月, 2016 1 次提交
  9. 31 8月, 2016 1 次提交
  10. 18 8月, 2016 1 次提交
  11. 17 8月, 2016 1 次提交
    • R
      cpufreq / sched: Pass flags to cpufreq_update_util() · 58919e83
      Rafael J. Wysocki 提交于
      It is useful to know the reason why cpufreq_update_util() has just
      been called and that can be passed as flags to cpufreq_update_util()
      and to the ->func() callback in struct update_util_data.  However,
      doing that in addition to passing the util and max arguments they
      already take would be clumsy, so avoid it.
      
      Instead, use the observation that the schedutil governor is part
      of the scheduler proper, so it can access scheduler data directly.
      This allows the util and max arguments of cpufreq_update_util()
      and the ->func() callback in struct update_util_data to be replaced
      with a flags one, but schedutil has to be modified to follow.
      
      Thus make the schedutil governor obtain the CFS utilization
      information from the scheduler and use the "RT" and "DL" flags
      instead of the special utilization value of ULONG_MAX to track
      updates from the RT and DL sched classes.  Make it non-modular
      too to avoid having to export scheduler variables to modules at
      large.
      
      Next, update all of the other users of cpufreq_update_util()
      and the ->func() callback in struct update_util_data accordingly.
      Suggested-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      58919e83
  12. 16 8月, 2016 1 次提交
  13. 06 8月, 2016 1 次提交
    • A
      cpufreq: powernv: Fix crash in gpstate_timer_handler() · 8e859467
      Akshay Adiga 提交于
      Commit 09ca4c9b (cpufreq: powernv: Replacing pstate_id with
      frequency table index) changes calc_global_pstate() to use
      cpufreq_table index instead of pstate_id.
      
      But in gpstate_timer_handler(), pstate_id was being passed instead
      of cpufreq_table index, which caused index_to_pstate() to access
      out of bound indices, leading to this crash.
      
      Adding sanity check for index and pstate, to ensure only valid pstate
      and index values are returned.
      
      Call Trace:
      [c00000078d66b130] [c00000000011d224] __free_irq+0x234/0x360
      (unreliable)
      [c00000078d66b1c0] [c00000000011d44c] free_irq+0x6c/0xa0
      [c00000078d66b1f0] [c00000000006c4f8] opal_event_shutdown+0x88/0xd0
      [c00000078d66b230] [c000000000067a4c] opal_shutdown+0x1c/0x90
      [c00000078d66b260] [c000000000063a00] pnv_shutdown+0x20/0x40
      [c00000078d66b280] [c000000000021538] machine_restart+0x38/0x90
      [c0000000078d66b310] [c000000000965ea0] panic+0x284/0x300
      [c00000078d66b3a0] [c00000000001f508] die+0x388/0x450
      [c00000078d66b430] [c000000000045a50] bad_page_fault+0xd0/0x140
      [c00000078d66b4a0] [c000000000008964] handle_page_fault+0x2c/0x30
         interrupt: 300 at gpstate_timer_handler+0x150/0x260
          LR = gpstate_timer_handler+0x130/0x260
      [c00000078d66b7f0] [c000000000132b58] call_timer_fn+0x58/0x1c0
      [c00000078d66b880] [c000000000132e20] expire_timers+0x130/0x1d0
      [c00000078d66b8f0] [c000000000133068] run_timer_softirq+0x1a8/0x230
      [c00000078d66b980] [c0000000000b535c] __do_softirq+0x18c/0x400
      [c00000078d66ba70] [c0000000000b5828] irq_exit+0xc8/0x100
      [c00000078d66ba90] [c00000000001e214] timer_interrupt+0xa4/0xe0
      [c00000078d66bac0] [c0000000000027d0] decrementer_common+0x150/0x180
         interrupt: 901 at arch_local_irq_restore+0x74/0x90
        0] [c000000000106b34] call_cpuidle+0x44/0x90
      [c00000078d66be50] [c00000000010708c] cpu_startup_entry+0x38c/0x460
      [c00000078d66bf20] [c00000000003d930] start_secondary+0x330/0x380
      [c00000078d66bf90] [c000000000008e6c] start_secondary_prolog+0x10/0x14
      
      Fixes: 09ca4c9b (cpufreq: powernv: Replacing pstate_id with frequency table index)
      Reported-by: NMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: NAkshay Adiga <akshay.adiga@linux.vnet.ibm.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Tested-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8e859467
  14. 03 8月, 2016 1 次提交
  15. 29 7月, 2016 1 次提交
  16. 23 7月, 2016 1 次提交
    • A
      Revert "cpufreq: pcc-cpufreq: update default value of cpuinfo_transition_latency" · da7d3abe
      Andreas Herrmann 提交于
      This reverts commit 790d849b.
      
      Using a v4.7-rc7 kernel on a HP ProLiant triggered following messages
      
       pcc-cpufreq: (v1.10.00) driver loaded with frequency limits: 1200 MHz, 2800 MHz
       cpufreq: ondemand governor failed, too long transition latency of HW, fallback to performance governor
      
      The last line was shown for each CPU in the system.
      Testing v4.5 (where commit 790d849b was integrated) triggered
      similar messages. Same behaviour on a 2nd HP Proliant system.
      
      So commit 790d849b (cpufreq: pcc-cpufreq: update default value of
      cpuinfo_transition_latency) causes the system to use performance
      governor which, I guess, was not the intention of the patch.
      
      Enabling debug output in pcc-cpufreq provides following verbose output:
      
       pcc-cpufreq: (v1.10.00) driver loaded with frequency limits: 1200 MHz, 2800 MHz
       pcc_get_offset: for CPU 0: pcc_cpu_data input_offset: 0x44, pcc_cpu_data output_offset: 0x48
       init: policy->max is 2800000, policy->min is 1200000
       get: get_freq for CPU 0
       get: SUCCESS: (virtual) output_offset for cpu 0 is 0xffffc9000d7c0048, contains a value of: 0xff06. Speed is: 168000 MHz
       cpufreq: ondemand governor failed, too long transition latency of HW, fallback to performance governor
       target: CPU 0 should go to target freq: 2800000 (virtual) input_offset is 0xffffc9000d7c0044
       target: was SUCCESSFUL for cpu 0
      
      I am asking to revert 790d849b to re-enable usage of ondemand
      governor with pcc-cpufreq.
      
      Fixes: 790d849b (cpufreq: pcc-cpufreq: update default value of cpuinfo_transition_latency)
      CC: <stable@vger.kernel.org> # 4.5+
      Signed-off-by: NAndreas Herrmann <aherrmann@suse.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      da7d3abe
  17. 22 7月, 2016 3 次提交
  18. 21 7月, 2016 4 次提交
  19. 12 7月, 2016 1 次提交
  20. 11 7月, 2016 1 次提交
  21. 07 7月, 2016 3 次提交