1. 30 May, 2018 1 commit
  2. 22 May, 2018 1 commit
    • Viresh Kumar's avatar
      thermal: Shorten name of sysfs callbacks · 33e678d4
      Viresh Kumar authored
      The naming isn't consistent across all sysfs callbacks in the thermal
      core, some have a short name like type_show() and others have long names
      like thermal_cooling_device_weight_show(). This patch tries to make it
      consistent by shortening the name of sysfs callbacks.
      
      Some of the sysfs files are named similarly for both thermal zone and
      cooling device (like: type) and to avoid name clash between their
      show/store routines, the cooling device specific sysfs callbacks are
      prefixed with "cdev_".
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
      33e678d4
  3. 02 Apr, 2018 1 commit
    • Viresh Kumar's avatar
      thermal: Add cooling device's statistics in sysfs · 8ea22951
      Viresh Kumar authored
      This extends the sysfs interface for thermal cooling devices and exposes
      some pretty useful statistics. These statistics have proven to be quite
      useful specially while doing benchmarks related to the task scheduler,
      where we want to make sure that nothing has disrupted the test,
      specially the cooling device which may have put constraints on the CPUs.
      The information exposed here tells us to what extent the CPUs were
      constrained by the thermal framework.
      
      The write-only "reset" file is used to reset the statistics.
      
      The read-only "time_in_state_ms" file shows the time (in msec) spent by the
      device in the respective cooling states, and it prints one line per
      cooling state.
      
      The read-only "total_trans" file shows single positive integer value
      showing the total number of cooling state transitions the device has
      gone through since the time the cooling device is registered or the time
      when statistics were reset last.
      
      The read-only "trans_table" file shows a two dimensional matrix, where
      an entry <i,j> (row i, column j) represents the number of transitions
      from State_i to State_j.
      
      This is how the directory structure looks like for a single cooling
      device:
      
      $ ls -R /sys/class/thermal/cooling_device0/
      /sys/class/thermal/cooling_device0/:
      cur_state  max_state  power  stats  subsystem  type  uevent
      
      /sys/class/thermal/cooling_device0/power:
      autosuspend_delay_ms  runtime_active_time  runtime_suspended_time
      control               runtime_status
      
      /sys/class/thermal/cooling_device0/stats:
      reset  time_in_state_ms  total_trans  trans_table
      
      This is tested on ARM 64-bit Hisilicon hikey620 board running Ubuntu and
      ARM 64-bit Hisilicon hikey960 board running Android.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
      8ea22951
  4. 11 Aug, 2017 1 commit
  5. 23 Nov, 2016 7 commits
  6. 29 Dec, 2015 1 commit
  7. 05 May, 2015 3 commits
    • Javi Merino's avatar
      thermal: introduce the Power Allocator governor · 6b775e87
      Javi Merino authored
      The power allocator governor is a thermal governor that controls system
      and device power allocation to control temperature.  Conceptually, the
      implementation divides the sustainable power of a thermal zone among
      all the heat sources in that zone.
      
      This governor relies on "power actors", entities that represent heat
      sources.  They can report current and maximum power consumption and
      can set a given maximum power consumption, usually via a cooling
      device.
      
      The governor uses a Proportional Integral Derivative (PID) controller
      driven by the temperature of the thermal zone.  The output of the
      controller is a power budget that is then allocated to each power
      actor that can have bearing on the temperature we are trying to
      control.  It decides how much power to give each cooling device based
      on the performance they are requesting.  The PID controller ensures
      that the total power budget does not exceed the control temperature.
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Eduardo Valentin <edubezval@gmail.com>
      Signed-off-by: default avatarPunit Agrawal <punit.agrawal@arm.com>
      Signed-off-by: default avatarJavi Merino <javi.merino@arm.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      6b775e87
    • Javi Merino's avatar
      thermal: export weight to sysfs · db916513
      Javi Merino authored
      It's useful to have access to the weights for the cooling devices for
      thermal zones and change them if needed.  Export them to sysfs.
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Eduardo Valentin <edubezval@gmail.com>
      Signed-off-by: default avatarJavi Merino <javi.merino@arm.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      db916513
    • Kapileshwar Singh's avatar
      thermal: of: fix cooling device weights in device tree · 6cd9e9f6
      Kapileshwar Singh authored
      Currently you can specify the weight of the cooling device in the device
      tree but that information is not populated to the
      thermal_bind_params where the fair share governor expects it to
      be.  The of thermal zone device doesn't have a thermal_bind_params
      structure and arguably it's better to pass the weight inside the
      thermal_instance as it is specific to the bind of a cooling device to a
      thermal zone parameter.
      
      Core thermal code is fixed to populate the weight in the instance from
      the thermal_bind_params, so platform code that was passing the weight
      inside the thermal_bind_params continue to work seamlessly.
      
      While we are at it, create a default value for the weight parameter for
      those thermal zones that currently don't define it and remove the
      hardcoded default in of-thermal.
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Peter Feuerer <peter@piie.net>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Eduardo Valentin <edubezval@gmail.com>
      Cc: Kukjin Kim <kgene@kernel.org>
      Cc: Durgadoss R <durgadoss.r@intel.com>
      Signed-off-by: default avatarKapileshwar Singh <kapileshwar.singh@arm.com>
      Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
      6cd9e9f6
  8. 01 May, 2015 1 commit
  9. 05 Jan, 2015 1 commit
  10. 08 Dec, 2014 3 commits
  11. 27 Aug, 2014 1 commit
    • Peter Feuerer's avatar
      thermal: Added Bang-bang thermal governor · e4dbf98f
      Peter Feuerer authored
      The bang-bang thermal governor uses a hysteresis to switch abruptly on
      or off a cooling device.  It is intended to control fans, which can
      not be throttled but just switched on or off.
      Bang-bang cannot be set as default governor as it is intended for
      special devices only.  For those special devices the driver needs to
      explicitely request it.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Andreas Mohr <andi@lisas.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Javi Merino <javi.merino@arm.com>
      Cc: linux-pm@vger.kernel.org
      Signed-off-by: default avatarPeter Feuerer <peter@piie.net>
      Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
      e4dbf98f
  12. 04 Dec, 2013 1 commit
    • Eduardo Valentin's avatar
      thermal: introduce device tree parser · 4e5e4705
      Eduardo Valentin authored
      This patch introduces a device tree bindings for
      describing the hardware thermal behavior and limits.
      Also a parser to read and interpret the data and feed
      it in the thermal framework is presented.
      
      This patch introduces a thermal data parser for device
      tree. The parsed data is used to build thermal zones
      and thermal binding parameters. The output data
      can then be used to deploy thermal policies.
      
      This patch adds also documentation regarding this
      API and how to define tree nodes to use
      this infrastructure.
      
      Note that, in order to be able to have control
      on the sensor registration on the DT thermal zone,
      it was required to allow changing the thermal zone
      .get_temp callback. For this reason, this patch
      also removes the 'const' modifier from the .ops
      field of thermal zone devices.
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: linux-pm@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarEduardo Valentin <eduardo.valentin@ti.com>
      4e5e4705
  13. 14 Apr, 2013 1 commit
  14. 05 Nov, 2012 1 commit