1. 14 10月, 2014 1 次提交
  2. 27 8月, 2014 1 次提交
    • P
      thermal: Added Bang-bang thermal governor · e4dbf98f
      Peter Feuerer 提交于
      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: NPeter Feuerer <peter@piie.net>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      e4dbf98f
  3. 29 7月, 2014 3 次提交
  4. 03 3月, 2014 2 次提交
    • Z
      Thermal: thermal zone governor fix · f2234bcd
      Zhang Rui 提交于
      This patch does a cleanup about the thermal zone govenor,
      setting and make the following rule.
      1. For thermal zone devices that are registered w/o tz->tzp,
         they can use the default thermal governor only.
      2. For thermal zone devices w/ governor name specified in
         tz->tzp->governor_name, we will use the default govenor
         if the governor specified is not available at the moment,
         and update tz->governor when the matched governor is registered.
      
      This also fixes a problem that OF registered thermal zones
      are running with no governor.
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      Acked-by: NJavi Merino <javi.merino@arm.com>
      f2234bcd
    • N
      Thermal: Allow first update of cooling device state · 5ca0cce5
      Ni Wade 提交于
      In initialization, if the cooling device is initialized at
      max cooling state, and the thermal zone temperature is below
      the first trip point, then the cooling state can't be updated
      to the right state, untill the first trip point be triggered.
      
      To fix this issue, allow first update of cooling device state
      during registration, initialized "updated" device field as
      "false" (instead of "true").
      Signed-off-by: NWei Ni <wni@nvidia.com>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      5ca0cce5
  5. 03 1月, 2014 1 次提交
  6. 02 1月, 2014 1 次提交
    • A
      thermal: debug: add debug statement for core and step_wise · 06475b55
      Aaron Lu 提交于
      To ease debugging thermal problem, add these dynamic debug statements
      so that user do not need rebuild kernel to see these info.
      
      Based on a patch from Zhang Rui for debugging on bugzilla:
      https://bugzilla.kernel.org/attachment.cgi?id=98671
      
      A sample output after we turn on dynamic debug with the following cmd:
      # echo 'module thermal_sys +fp' > /sys/kernel/debug/dynamic_debug/control
      is like:
      
      [  355.147627] update_temperature: thermal thermal_zone0: last_temperature=52000, current_temperature=55000
      [  355.147636] thermal_zone_trip_update: thermal thermal_zone0: Trip1[type=1,temp=79000]:trend=2,throttle=0
      [  355.147644] get_target_state: thermal cooling_device8: cur_state=0
      [  355.147647] thermal_zone_trip_update: thermal cooling_device8: old_target=-1, target=-1
      [  355.147652] get_target_state: thermal cooling_device7: cur_state=0
      [  355.147655] thermal_zone_trip_update: thermal cooling_device7: old_target=-1, target=-1
      [  355.147660] get_target_state: thermal cooling_device6: cur_state=0
      [  355.147663] thermal_zone_trip_update: thermal cooling_device6: old_target=-1, target=-1
      [  355.147668] get_target_state: thermal cooling_device5: cur_state=0
      [  355.147671] thermal_zone_trip_update: thermal cooling_device5: old_target=-1, target=-1
      [  355.147678] thermal_zone_trip_update: thermal thermal_zone0: Trip2[type=0,temp=90000]:trend=1,throttle=0
      [  355.147776] get_target_state: thermal cooling_device0: cur_state=0
      [  355.147783] thermal_zone_trip_update: thermal cooling_device0: old_target=-1, target=-1
      [  355.147792] thermal_zone_trip_update: thermal thermal_zone0: Trip3[type=0,temp=80000]:trend=1,throttle=0
      [  355.147845] get_target_state: thermal cooling_device1: cur_state=0
      [  355.147849] thermal_zone_trip_update: thermal cooling_device1: old_target=-1, target=-1
      [  355.147856] thermal_zone_trip_update: thermal thermal_zone0: Trip4[type=0,temp=70000]:trend=1,throttle=0
      [  355.147904] get_target_state: thermal cooling_device2: cur_state=0
      [  355.147908] thermal_zone_trip_update: thermal cooling_device2: old_target=-1, target=-1
      [  355.147915] thermal_zone_trip_update: thermal thermal_zone0: Trip5[type=0,temp=60000]:trend=1,throttle=0
      [  355.147963] get_target_state: thermal cooling_device3: cur_state=0
      [  355.147967] thermal_zone_trip_update: thermal cooling_device3: old_target=-1, target=-1
      [  355.147973] thermal_zone_trip_update: thermal thermal_zone0: Trip6[type=0,temp=55000]:trend=1,throttle=1
      [  355.148022] get_target_state: thermal cooling_device4: cur_state=0
      [  355.148025] thermal_zone_trip_update: thermal cooling_device4: old_target=-1, target=1
      [  355.148036] thermal_cdev_update: thermal cooling_device4: zone0->target=1
      [  355.169279] thermal_cdev_update: thermal cooling_device4: set to state 1
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Acked-by: NEduardo Valentin <eduardo.valentin@ti.com>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      06475b55
  7. 04 12月, 2013 3 次提交
    • E
      thermal: core: introduce thermal_of_cooling_device_register · a116b5d4
      Eduardo Valentin 提交于
      This patch adds a new API to allow registering cooling devices
      in the thermal framework derived from device tree nodes.
      
      This API links the cooling device with the device tree node
      so that binding with thermal zones is possible, given
      that thermal zones are pointing to cooling device
      device tree nodes.
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: linux-pm@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NEduardo Valentin <eduardo.valentin@ti.com>
      a116b5d4
    • E
      thermal: introduce device tree parser · 4e5e4705
      Eduardo Valentin 提交于
      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: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NEduardo Valentin <eduardo.valentin@ti.com>
      4e5e4705
    • E
      thermal: allow registering without .get_temp · 81bd4e1c
      Eduardo Valentin 提交于
      This patch changes the thermal core driver to allow
      registration of thermal zones without the .get_temp callback.
      
      The idea behind this change is to allow lazy registration
      of sensor callbacks.
      
      The thermal zone will be disabled whenever the ops
      does not contain a .get_temp callback. The sysfs interface
      will be returning -EINVAL on any temperature read operation.
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: linux-pm@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NEduardo Valentin <eduardo.valentin@ti.com>
      81bd4e1c
  8. 20 11月, 2013 2 次提交
  9. 06 11月, 2013 1 次提交
  10. 14 10月, 2013 1 次提交
    • D
      Thermal: Check for validity before doing kfree · 732e4c8d
      durgadoss.r@intel.com 提交于
      The thermal_release function is called whenever
      any device belonging to 'thermal' class unregisters.
      This function performs kfree(cdev) without any check.
      In cases where there are more device registrations
      other than just 'thermal_zone' and 'cooling_device'
      this might accidently free memory allocated them
      silently; and cause memory errors.
      
      This patch changes this behavior by doing
      kfree(cdev) only when the device pointer belongs
      to a real cdev i.e. cooling_device.
      Signed-off-by: NDurgadoss R <durgadoss.r@intel.com>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      732e4c8d
  11. 03 9月, 2013 3 次提交
    • E
      thermal: thermal_core: allow binding with limits on bind_params · a8892d83
      Eduardo Valentin 提交于
      When registering a thermal zone device using platform information
      via bind_params, the thermal framework will always perform the
      cdev binding using the lowest and highest limits (THERMAL_NO_LIMIT).
      
      This patch changes the data structures so that it is possible
      to inform what are the desired limits for each trip point
      inside a bind_param. The way the binding is performed is also
      changed so that it uses the new data structure.
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: linux-pm@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NEduardo Valentin <eduardo.valentin@ti.com>
      a8892d83
    • E
      drivers: thermal: make usage of CONFIG_THERMAL_HWMON optional · ccba4ffd
      Eduardo Valentin 提交于
      When registering a new thermal_device, the thermal framework
      will always add a hwmon sysfs interface.
      
      This patch adds a flag to make this behavior optional. Now
      when registering a new thermal device, the caller can
      optionally inform if hwmon interface is desirable. This can
      be done by means of passing a thermal_zone_params.no_hwmon == true.
      
      In order to keep same behavior as of today, all current
      calls will by default create the hwmon interface.
      
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: linux-acpi@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-pm@vger.kernel.org
      Cc: Zhang Rui <rui.zhang@intel.com>
      Suggested-by: NWei Ni <wni@nvidia.com>
      Signed-off-by: NEduardo Valentin <eduardo.valentin@ti.com>
      ccba4ffd
    • E
      thermal: hwmon: move hwmon support to single file · 0dd88793
      Eduardo Valentin 提交于
      In order to improve code organization, this patch
      moves the hwmon sysfs support to a file named
      thermal_hwmon. This helps to add extra support
      for hwmon without scrambling the code.
      
      In order to do this move, the hwmon list head is now
      using its own locking. Before, the list used
      the global thermal locking. Also, some minor changes
      in the code were required, as recommended by checkpatch.pl.
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: linux-pm@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Acked-by: NDurgadoss R <durgadoss.r@intel.com>
      Signed-off-by: NEduardo Valentin <eduardo.valentin@ti.com>
      0dd88793
  12. 13 6月, 2013 1 次提交
    • E
      thermal: consider emul_temperature while computing trend · 0c872507
      Eduardo Valentin 提交于
      In case emulated temperature is in use, using the trend
      provided by driver layer can lead to bogus situation.
      In this case, debugger user would set a temperature value,
      but the trend would be from driver computation.
      
      To avoid this situation, this patch changes the get_tz_trend()
      to consider the emulated temperature whenever that is in use.
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
      Cc: Durgadoss R <durgadoss.r@intel.com>
      Cc: linux-pm@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NEduardo Valentin <eduardo.valentin@ti.com>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      0c872507
  13. 28 5月, 2013 2 次提交
  14. 27 4月, 2013 1 次提交
    • E
      thermal: thermal_core: remove usage of IS_ERR_OR_NULL · 9b19ec39
      Eduardo Valentin 提交于
      This patch changes the driver to avoid the usage of IS_ERR_OR_NULL()
      macro. This macro can lead to dangerous results, like returning
      success (0) during a failure scenario (NULL pointer handling).
      
      The case present in this patch has simply be translated to
      normal check for NULL and if the pointer has an error code.
      The later case is needed because functions like
      thermal_zone_get_zone_by_name() could return an ERR_PTR().
      
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: linux-pm@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NEduardo Valentin <eduardo.valentin@ti.com>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      9b19ec39
  15. 25 4月, 2013 9 次提交
  16. 15 4月, 2013 2 次提交
  17. 14 4月, 2013 2 次提交
  18. 28 2月, 2013 1 次提交
  19. 22 2月, 2013 1 次提交
  20. 06 2月, 2013 2 次提交