1. 11 6月, 2015 3 次提交
    • V
      cpufreq: Call cpufreq_policy_put_kobj() from cpufreq_policy_free() · 3654c5cc
      Viresh Kumar 提交于
      cpufreq_policy_put_kobj() is actually part of freeing the policy and can
      be called from cpufreq_policy_free() directly instead of a separate
      call.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3654c5cc
    • V
      cpufreq: Initialize policy->kobj while allocating policy · 2fc3384d
      Viresh Kumar 提交于
      policy->kobj is required to be initialized once in the lifetime of a
      policy.  Currently we are initializing it from __cpufreq_add_dev() and
      that doesn't look to be the best place for doing so as we have to do
      this on special cases (like: !recover_policy).
      
      We can initialize it from a more obvious place cpufreq_policy_alloc()
      and that will make code look cleaner, specially the error handling part.
      
      The error handling part of __cpufreq_add_dev() was doing almost the same
      thing while recover_policy is true or false. Fix that as well by always
      calling cpufreq_policy_put_kobj() with an additional parameter to skip
      notification part of it.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2fc3384d
    • V
      cpufreq: Stop migrating sysfs files on hotplug · 87549141
      Viresh Kumar 提交于
      When we hot-unplug a cpu, we remove its sysfs cpufreq directory and if
      the outgoing cpu was the owner of policy->kobj earlier then we migrate
      the sysfs directory to under another online cpu.
      
      There are few disadvantages this brings:
      - Code Complexity
      - Slower hotplug/suspend/resume
      - sysfs file permissions are reset after all policy->cpus are offlined
      - CPUFreq stats history lost after all policy->cpus are offlined
      - Special management of sysfs stuff during suspend/resume
      
      To overcome these, this patch modifies the way sysfs directories are
      managed:
      - Select sysfs kobjects owner while initializing policy and don't change
        it during hotplugs. Track it with kobj_cpu created earlier.
      
      - Create symlinks for all related CPUs (can be offline) instead of
        affected CPUs on policy initialization and remove them only when the
        policy is freed.
      
      - Free policy structure only on the removal of cpufreq-driver and not
        during hotplug/suspend/resume, detected by checking 'struct
        subsys_interface *' (Valid only when called from
        subsys_interface_unregister() while unregistering driver).
      
      Apart from this, special care is taken to handle physical hoplug of CPUs
      as we wouldn't remove sysfs links or remove policies on logical
      hotplugs. Physical hotplug happens in the following sequence.
      
      Hot removal:
      - CPU is offlined first, ~ 'echo 0 >
        /sys/devices/system/cpu/cpuX/online'
      - Then its device is removed along with all sysfs files, cpufreq core
        notified with cpufreq_remove_dev() callback from subsys-interface..
      
      Hot addition:
      - First the device along with its sysfs files is added, cpufreq core
        notified with cpufreq_add_dev() callback from subsys-interface..
      - CPU is onlined, ~ 'echo 1 > /sys/devices/system/cpu/cpuX/online'
      
      We call the same routines with both hotplug and subsys callbacks, and we
      sense physical hotplug with cpu_offline() check in subsys callback. We
      can handle most of the stuff with regular hotplug callback paths and
      add/remove cpufreq sysfs links or free policy from subsys callbacks.
      Original-by: NSaravana Kannan <skannan@codeaurora.org>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      87549141
  2. 10 6月, 2015 3 次提交
  3. 23 5月, 2015 2 次提交
  4. 15 5月, 2015 7 次提交
  5. 13 5月, 2015 1 次提交
  6. 08 5月, 2015 5 次提交
  7. 05 5月, 2015 5 次提交
  8. 16 4月, 2015 2 次提交
  9. 11 4月, 2015 3 次提交
  10. 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
  11. 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
  12. 19 3月, 2015 2 次提交
  13. 04 3月, 2015 1 次提交
  14. 02 3月, 2015 1 次提交
  15. 19 2月, 2015 2 次提交