1. 08 5月, 2015 4 次提交
  2. 05 5月, 2015 5 次提交
  3. 16 4月, 2015 2 次提交
  4. 11 4月, 2015 3 次提交
  5. 03 4月, 2015 1 次提交
    • V
      cpufreq: Schedule work for the first-online CPU on resume · c75de0ac
      Viresh Kumar 提交于
      All CPUs leaving the first-online CPU are hotplugged out on suspend and
      and cpufreq core stops managing them.
      
      On resume, we need to call cpufreq_update_policy() for this CPU's policy
      to make sure its frequency is in sync with cpufreq's cached value, as it
      might have got updated by hardware during suspend/resume.
      
      The policies are always added to the top of the policy-list. So, in
      normal circumstances, CPU 0's policy will be the last one in the list.
      And so the code checks for the last policy.
      
      But there are cases where it will fail. Consider quad-core system, with
      policy-per core. If CPU0 is hotplugged out and added back again, the
      last policy will be on CPU1 :(
      
      To fix this in a proper way, always look for the policy of the first
      online CPU. That way we will be sure that we are calling
      cpufreq_update_policy() for the only CPU that wasn't hotplugged out.
      
      Cc: 3.15+ <stable@vger.kernel.org> # 3.15+
      Fixes: 2f0aea93 ("cpufreq: suspend governors on system suspend/hibernate")
      Reported-by: NSaravana Kannan <skannan@codeaurora.org>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Acked-by: NSaravana Kannan <skannan@codeaurora.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c75de0ac
  6. 02 4月, 2015 2 次提交
    • L
      cpufreq: hisilicon: add acpu driver · 5acb972f
      Leo Yan 提交于
      Add acpu driver for hisilicon SoC, acpu is application processor
      subsystem. Currently the acpu has the coupled clock domain for two
      clusters, so this driver will directly use cpufreq-dt driver as
      backend.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5acb972f
    • S
      cpufreq: powernv: Report cpu frequency throttling · 09a972d1
      Shilpasri G Bhat 提交于
      The power and thermal safety of the system is taken care by an
      On-Chip-Controller (OCC) which is real-time subsystem embedded within
      the POWER8 processor. OCC continuously monitors the memory and core
      temperature, the total system power, state of power supply and fan.
      
      The cpu frequency can be throttled by OCC for the following reasons:
      1)If a processor crosses its power and temperature limit then OCC will
        lower its Pmax to reduce the frequency and voltage.
      2)If OCC crashes then the system is forced to Psafe frequency.
      3)If OCC fails to recover then the kernel is not allowed to do any
        further frequency changes and the chip will remain in Psafe.
      
      The user can see a drop in performance when frequency is throttled and
      is unaware of throttling. So detect and report such a condition, so
      the user can check the OCC status to reboot the system or check for
      power supply or fan failures.
      
      The current status of the core is read from Power Management Status
      Register(PMSR) to check if any of the throttling condition is occurred
      and the appropriate throttling message is reported.
      Signed-off-by: NShilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
      Reviewed-by: NPreeti U Murthy <preeti@linux.vnet.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      09a972d1
  7. 19 3月, 2015 2 次提交
  8. 04 3月, 2015 1 次提交
  9. 02 3月, 2015 1 次提交
  10. 19 2月, 2015 2 次提交
  11. 12 2月, 2015 1 次提交
    • M
      cpufreq: speedstep-smi: enable interrupts when waiting · d4d4eda2
      Mikulas Patocka 提交于
      On Dell Latitude C600 laptop with Pentium 3 850MHz processor, the
      speedstep-smi driver sometimes loads and sometimes doesn't load with
      "change to state X failed" message.
      
      The hardware sometimes refuses to change frequency and in this case, we
      need to retry later. I found out that we need to enable interrupts while
      waiting. When we enable interrupts, the hardware blockage that prevents
      frequency transition resolves and the transition is possible. With
      disabled interrupts, the blockage doesn't resolve (no matter how long do
      we wait). The exact reasons for this hardware behavior are unknown.
      
      This patch enables interrupts in the function speedstep_set_state that can
      be called with disabled interrupts. However, this function is called with
      disabled interrupts only from speedstep_get_freqs, so it shouldn't cause
      any problem.
      
      Signed-off-by: Mikulas Patocka <mpatocka@redhat.com
      Cc: All applicable <stable@vger.kernel.org>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d4d4eda2
  12. 07 2月, 2015 1 次提交
  13. 04 2月, 2015 4 次提交
  14. 03 2月, 2015 1 次提交
    • V
      cpufreq: Set cpufreq_cpu_data to NULL before putting kobject · 6ffae8c0
      Viresh Kumar 提交于
      In __cpufreq_remove_dev_finish(), per-cpu 'cpufreq_cpu_data' needs
      to be cleared before calling kobject_put(&policy->kobj) and under
      cpufreq_driver_lock. Otherwise, if someone else calls cpufreq_cpu_get()
      in parallel with it, they can obtain a non-NULL policy from that after
      kobject_put(&policy->kobj) was executed.
      
      Consider this case:
      
      Thread A				Thread B
      cpufreq_cpu_get()
        acquire cpufreq_driver_lock
        read-per-cpu cpufreq_cpu_data
      					kobject_put(&policy->kobj);
        kobject_get(&policy->kobj);
      					...
      					per_cpu(&cpufreq_cpu_data, cpu) = NULL
      
      And this will result in a warning like this one:
      
       ------------[ cut here ]------------
       WARNING: CPU: 0 PID: 4 at include/linux/kref.h:47
       kobject_get+0x41/0x50()
       Modules linked in: acpi_cpufreq(+) nfsd auth_rpcgss nfs_acl
       lockd grace sunrpc xfs libcrc32c sd_mod ixgbe igb mdio ahci hwmon
       ...
       Call Trace:
        [<ffffffff81661b14>] dump_stack+0x46/0x58
        [<ffffffff81072b61>] warn_slowpath_common+0x81/0xa0
        [<ffffffff81072c7a>] warn_slowpath_null+0x1a/0x20
        [<ffffffff812e16d1>] kobject_get+0x41/0x50
        [<ffffffff815262a5>] cpufreq_cpu_get+0x75/0xc0
        [<ffffffff81527c3e>] cpufreq_update_policy+0x2e/0x1f0
        [<ffffffff810b8cb2>] ? up+0x32/0x50
        [<ffffffff81381aa9>] ? acpi_ns_get_node+0xcb/0xf2
        [<ffffffff81381efd>] ? acpi_evaluate_object+0x22c/0x252
        [<ffffffff813824f6>] ? acpi_get_handle+0x95/0xc0
        [<ffffffff81360967>] ? acpi_has_method+0x25/0x40
        [<ffffffff81391e08>] acpi_processor_ppc_has_changed+0x77/0x82
        [<ffffffff81089566>] ? move_linked_works+0x66/0x90
        [<ffffffff8138e8ed>] acpi_processor_notify+0x58/0xe7
        [<ffffffff8137410c>] acpi_ev_notify_dispatch+0x44/0x5c
        [<ffffffff8135f293>] acpi_os_execute_deferred+0x15/0x22
        [<ffffffff8108c910>] process_one_work+0x160/0x410
        [<ffffffff8108d05b>] worker_thread+0x11b/0x520
        [<ffffffff8108cf40>] ? rescuer_thread+0x380/0x380
        [<ffffffff81092421>] kthread+0xe1/0x100
        [<ffffffff81092340>] ? kthread_create_on_node+0x1b0/0x1b0
        [<ffffffff81669ebc>] ret_from_fork+0x7c/0xb0
        [<ffffffff81092340>] ? kthread_create_on_node+0x1b0/0x1b0
       ---[ end trace 89e66eb9795efdf7 ]---
      
      The actual code flow is as follows:
      
       Thread A: Workqueue: kacpi_notify
      
       acpi_processor_notify()
         acpi_processor_ppc_has_changed()
               cpufreq_update_policy()
                 cpufreq_cpu_get()
                   kobject_get()
      
       Thread B: xenbus_thread()
      
       xenbus_thread()
         msg->u.watch.handle->callback()
           handle_vcpu_hotplug_event()
             vcpu_hotplug()
               cpu_down()
                 __cpu_notify(CPU_POST_DEAD..)
                   cpufreq_cpu_callback()
                     __cpufreq_remove_dev_finish()
                       cpufreq_policy_put_kobj()
                         kobject_put()
      
      cpufreq_cpu_get() gets the policy from per-cpu variable cpufreq_cpu_data
      under cpufreq_driver_lock, and once it gets a valid policy it expects it
      to not be freed until cpufreq_cpu_put() is called.
      
      But the race happens when another thread puts the kobject first and updates
      cpufreq_cpu_data before or later. And so the first thread gets a valid policy
      structure and before it does kobject_get() on it, the second one has already
      done kobject_put().
      
      Fix this by setting cpufreq_cpu_data to NULL before putting the kobject and that
      too under locks.
      Reported-by: NEthan Zhao <ethan.zhao@oracle.com>
      Reported-by: NSantosh Shilimkar <santosh.shilimkar@oracle.com>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Cc: 3.12+ <stable@vger.kernel.org> # 3.12+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6ffae8c0
  15. 01 2月, 2015 1 次提交
    • A
      cpufreq: exynos: allow modular build · 8b2b4a4e
      Arnd Bergmann 提交于
      The exynos cpufreq driver code recently gained a dependency on the
      cooling code, which may be a loadable module. This breaks an ARM
      allmodconfig build:
      
      drivers/built-in.o: In function `exynos_cpufreq_probe':
      :(.text+0x1748e8): undefined reference to `of_cpufreq_cooling_register'
      
      To avoid this problem, change cpufreq Kconfig to allow the drivers
      to be loadable modules as well and enforce a dependency on the
      thermal module.
      
      This change, in order to allow module builds on this cpufreq
      driver, properly constructs the driver into a single module,
      instead of several modules. The change also keeps the proper
      platform dependency, and therefore, it wont load in platforms
      that are not supposed to be loaded. The user will be able to
      build the support for all platforms, or select which platforms
      (s)he wants (as originally), except that now it can be a module,
      instead.
      
      Besides, it will still keep the driver only on those configs
      that expect it to be on. And it won't compile/load on platforms
      that it is not supposed to. It brings the config ARM_EXYNOS_CPU_FREQ_BOOST_SW
      closer to this driver, so it looks better in the menuconfig.
      
      We intentionally change ARM_EXYNOS5440_CPUFREQ to be tristate too, to
      avoid future troubles.
      
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: Kukjin Kim <kgene@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-pm@vger.kernel.org
      Cc: linux-samsung-soc@vger.kernel.org
      Fixes: e725d26c ("cpufreq: exynos: Use device tree to determine if cpufreq cooling should be registered")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NEduardo Valentin <edubezval@gmail.com>
      8b2b4a4e
  16. 30 1月, 2015 5 次提交
  17. 25 1月, 2015 1 次提交
  18. 24 1月, 2015 3 次提交