1. 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
  2. 20 11月, 2013 2 次提交
  3. 06 11月, 2013 1 次提交
  4. 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
  5. 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
  6. 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
  7. 28 5月, 2013 2 次提交
  8. 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
  9. 25 4月, 2013 9 次提交
  10. 15 4月, 2013 2 次提交
  11. 14 4月, 2013 2 次提交
  12. 28 2月, 2013 1 次提交
  13. 22 2月, 2013 1 次提交
  14. 06 2月, 2013 2 次提交
  15. 17 1月, 2013 1 次提交
  16. 16 1月, 2013 3 次提交
  17. 12 12月, 2012 1 次提交
    • Z
      Thermal: fix a NULL pointer dereference when generic thermal layer is built as a module · d567c686
      Zhang Rui 提交于
      [   12.761956] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
      [   12.762016] IP: [<ffffffffa0005277>] handle_thermal_trip+0x47/0x130 [thermal_sys]
      [   12.762060] PGD 1fec74067 PUD 1fee5b067 PMD 0
      [   12.762127] Oops: 0000 [#1] SMP
      [   12.762177] Modules linked in: hid_generic crc32c_intel usbhid hid firewire_ohci(+) e1000e(+) firewire_core crc_itu_t xhci_hcd(+) thermal(+) fan thermal_sys hwmon
      [   12.762423] CPU 1
      [   12.762443] Pid: 187, comm: modprobe Tainted: G       A     3.7.0-thermal-module+ #25                  /DH77DF
      [   12.762496] RIP: 0010:[<ffffffffa0005277>]  [<ffffffffa0005277>] handle_thermal_trip+0x47/0x130 [thermal_sys]
      [   12.762682] RSP: 0018:ffff8801fe7ddc18  EFLAGS: 00010282
      [   12.762704] RAX: 0000000000000000 RBX: ffff8801ff3e9c00 RCX: ffff8801fdc39800
      [   12.762728] RDX: ffff8801fe7ddc24 RSI: 0000000000000001 RDI: ffff8801ff3e9c00
      [   12.762764] RBP: ffff8801fe7ddc48 R08: 0000000004000000 R09: ffffffffa001f568
      [   12.762797] R10: ffffffff81363083 R11: 0000000000000001 R12: 0000000000000001
      [   12.762832] R13: 0000000000000000 R14: 0000000000000001 R15: ffff8801fde73e68
      [   12.762866] FS:  00007f5548516700(0000) GS:ffff88021f240000(0000) knlGS:0000000000000000
      [   12.762912] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   12.762946] CR2: 0000000000000018 CR3: 00000001fefe2000 CR4: 00000000001407e0
      [   12.762979] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   12.763014] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [   12.763048] Process modprobe (pid: 187, threadinfo ffff8801fe7dc000, task ffff8801fe5bdb40)
      [   12.763095] Stack:
      [   12.763122]  0000000000019640 00000000fdc39800 ffff8801fe7ddc48 ffff8801ff3e9c00
      [   12.763225]  0000000000000002 0000000000000000 ffff8801fe7ddc78 ffffffffa00053e7
      [   12.763338]  ffff8801ff3e9c00 0000000000006c98 ffffffffa0007480 ffff8801ff3e9c00
      [   12.763440] Call Trace:
      [   12.763470]  [<ffffffffa00053e7>] thermal_zone_device_update+0x77/0xa0 [thermal_sys]
      [   12.763515]  [<ffffffffa0006d38>] thermal_zone_device_register+0x788/0xa88 [thermal_sys]
      [   12.763562]  [<ffffffffa001f394>] acpi_thermal_add+0x360/0x4c8 [thermal]
      [   12.763598]  [<ffffffff8133902a>] acpi_device_probe+0x50/0x190
      [   12.763632]  [<ffffffff811bd793>] ? sysfs_create_link+0x13/0x20
      [   12.763666]  [<ffffffff813cc41b>] driver_probe_device+0x7b/0x240
      [   12.763699]  [<ffffffff813cc68b>] __driver_attach+0xab/0xb0
      [   12.763732]  [<ffffffff813cc5e0>] ? driver_probe_device+0x240/0x240
      [   12.763766]  [<ffffffff813ca836>] bus_for_each_dev+0x56/0x90
      [   12.763799]  [<ffffffff813cbf4e>] driver_attach+0x1e/0x20
      [   12.763831]  [<ffffffff813cbac0>] bus_add_driver+0x190/0x290
      [   12.763864]  [<ffffffffa0022000>] ? 0xffffffffa0021fff
      [   12.763896]  [<ffffffff813ccbea>] driver_register+0x7a/0x160
      [   12.763928]  [<ffffffffa0022000>] ? 0xffffffffa0021fff
      [   12.763960]  [<ffffffff813399fb>] acpi_bus_register_driver+0x43/0x45
      [   12.763995]  [<ffffffffa002203a>] acpi_thermal_init+0x3a/0x42 [thermal]
      [   12.764029]  [<ffffffff8100207f>] do_one_initcall+0x3f/0x170
      [   12.764063]  [<ffffffff810b1a5f>] sys_init_module+0x8f/0x200
      [   12.764097]  [<ffffffff815ff259>] system_call_fastpath+0x16/0x1b
      [   12.764129] Code: 48 8b 87 c8 02 00 00 41 89 f4 48 8d 55 dc ff 50 28 44 8b 6d dc 41 8d 45 fe 83 f8 01 76 5e 48 8b 83 d8 02 00 00 44 89 e6 48 89 df <ff> 50 18 4c 8d a3 10 03 00 00 4c 89 e7 e8 87 f1 5e e1 8b 83 bc
      [   12.765164] RIP  [<ffffffffa0005277>] handle_thermal_trip+0x47/0x130 [thermal_sys]
      [   12.765223]  RSP <ffff8801fe7ddc18>
      [   12.765252] CR2: 0000000000000018
      [   12.765284] ---[ end trace 7723294cdfb00d2a ]---
      
      This is because thermal_zone_device_update() is invoked before
      any thermal governors being registered.
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      d567c686
  18. 05 11月, 2012 4 次提交