08 Jul, 2015

7 commits

  • It is common to have a linear extrapolation from
    the current sensor readings and the actual temperature
    value. This is specially the case when the sensor
    is in use to extrapolate hotspots.

    This patch adds slope and offset constants for
    single sensor linear extrapolation equation. Because
    the same sensor can be use in different locations,
    from board to board, these constants are added
    as part of thermal_zone_params.

    The constants are available through sysfs.

    It is up to the device driver to determine
    the usage of these values.

    Signed-off-by: Eduardo Valentin
    (cherry picked from commit 9d0be7f4810257a9b0fc78fff641f14409f14ab3)
    Signed-off-by: Kevin Hilman

    Eduardo Valentin
     
  • It's useful for tuning to be able to edit thermal_zone_parameters from
    userspace. Export them to the thermal_zone sysfs so that they can be
    easily changed.

    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Signed-off-by: Javi Merino
    Signed-off-by: Eduardo Valentin
    (cherry picked from commit 9f38271c6f82a577d9fdab27aaf2e1c55ae5cf73)
    Signed-off-by: Kevin Hilman

    Javi Merino
     
  • 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
    Cc: Eduardo Valentin
    Signed-off-by: Punit Agrawal
    Signed-off-by: Javi Merino
    Signed-off-by: Eduardo Valentin
    (cherry picked from commit 6b775e870c56c59c3e16531ea2307b797395f9f7)
    Signed-off-by: Kevin Hilman

    Javi Merino
     
  • Add a basic power model to the cpu cooling device to implement the
    power cooling device API. The power model uses the current frequency,
    current load and OPPs for the power calculations. The cpus must have
    registered their OPPs using the OPP library.

    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Signed-off-by: Kapileshwar Singh
    Signed-off-by: Punit Agrawal
    Signed-off-by: Javi Merino
    Signed-off-by: Eduardo Valentin
    (cherry picked from commit c36cf07176316fbe6a4bdbc23afcb0cbf7822bf2)
    Signed-off-by: Kevin Hilman

    Javi Merino
     
  • The fair share governor has the concept of weights, which is the
    influence of each cooling device in a thermal zone. The current
    implementation forces the weights of all cooling devices in a thermal
    zone to add up to a 100. This complicates setups, as you need to know
    in advance how many cooling devices you are going to have. If you bind a
    new cooling device, you have to modify all the other cooling devices
    weights, which is error prone. Furthermore, you can't specify a
    "default" weight for platforms since that default value depends on the
    number of cooling devices in the platform.

    This patch generalizes the concept of weight by allowing any number to
    be a "weight". Weights are now relative to each other. Platforms that
    don't specify weights get the same default value for all their cooling
    devices, so all their cdevs are considered to be equally influential.

    It's important to note that previous users of the weights don't need to
    alter the code: percentages continue to work as they used to. This
    patch just removes the constraint of all the weights in a thermal zone
    having to add up to a 100. If they do, you get the same behavior as
    before. If they don't, fair share now works for that platform.

    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Cc: Durgadoss R
    Acked-by: Durgadoss R
    Signed-off-by: Javi Merino
    Signed-off-by: Eduardo Valentin
    (cherry picked from commit bcdcbbc71125c37195f97314f453ca9a3a4eb758)
    Signed-off-by: Kevin Hilman

    Javi Merino
     
  • 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
    Cc: Eduardo Valentin
    Signed-off-by: Javi Merino
    Signed-off-by: Eduardo Valentin
    (cherry picked from commit db91651311c8b89978b17d27634582c28c33363e)
    Signed-off-by: Kevin Hilman

    Javi Merino
     
  • 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
    Cc: "Rafael J. Wysocki"
    Cc: Len Brown
    Cc: Peter Feuerer
    Cc: Darren Hart
    Cc: Eduardo Valentin
    Cc: Kukjin Kim
    Cc: Durgadoss R
    Signed-off-by: Kapileshwar Singh
    Signed-off-by: Eduardo Valentin
    (cherry picked from commit 6cd9e9f629f11b9412d4e9aa294c029dbb36b3cf)
    Signed-off-by: Kevin Hilman

    Kapileshwar Singh
     

07 Jan, 2015

1 commit

  • Commit 39d99cff76bf ("thermal: cpu_cooling: introduce
    of_cpufreq_cooling_register") taught the cpu cooling device to register
    devices that were linked to the device tree but didn't update the
    cpu-cooling-api documentation. Fix it.

    Cc: Amit Daniel Kachhap
    Cc: Jonathan Corbet
    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Signed-off-by: Javi Merino
    Signed-off-by: Eduardo Valentin

    Javi Merino
     

17 Jun, 2014

1 commit

  • Changes:
    - Change the maintainer's address (the labri address will expire soon);
    - Drop the note about not all families supporting all fan modes;
    - Add a note about the reported RPM not being accurate when driven outside
    the vbios-defined PWM range.

    Signed-off-by: Martin Peres
    Signed-off-by: Ben Skeggs

    Martin Peres
     

03 Sep, 2013

2 commits

  • 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
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Eduardo Valentin

    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
    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
    Suggested-by: Wei Ni
    Signed-off-by: Eduardo Valentin

    Eduardo Valentin
     

13 Aug, 2013

1 commit


12 Jul, 2013

1 commit

  • Pull thermal management updates from Zhang Rui:
    "There are not too many changes this time, except two new platform
    thermal drivers, ti-soc-thermal driver and x86_pkg_temp_thermal
    driver, and a couple of small fixes.

    Highlights:

    - move the ti-soc-thermal driver out of the staging tree to the
    thermal tree.

    - introduce the x86_pkg_temp_thermal driver. This driver registers
    CPU digital temperature package level sensor as a thermal zone.

    - small fixes/cleanups including removing redundant use of
    platform_set_drvdata() and of_match_ptr for all platform thermal
    drivers"

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (34 commits)
    thermal: cpu_cooling: fix stub function
    thermal: ti-soc-thermal: use standard GPIO DT bindings
    thermal: MAINTAINERS: Add git tree path for SoC specific updates
    thermal: fix x86_pkg_temp_thermal.c build and Kconfig
    Thermal: Documentation for x86 package temperature thermal driver
    Thermal: CPU Package temperature thermal
    thermal: consider emul_temperature while computing trend
    thermal: ti-soc-thermal: add DT example for DRA752 chip
    thermal: ti-soc-thermal: add dra752 chip to device table
    thermal: ti-soc-thermal: add thermal data for DRA752 chips
    thermal: ti-soc-thermal: remove usage of IS_ERR_OR_NULL
    thermal: ti-soc-thermal: freeze FSM while computing trend
    thermal: ti-soc-thermal: remove external heat while extrapolating hotspot
    thermal: ti-soc-thermal: update DT reference for OMAP5430
    x86, mcheck, therm_throt: Process package thresholds
    thermal: cpu_cooling: fix 'descend' check in get_property()
    Thermal: spear: Remove redundant use of of_match_ptr
    Thermal: kirkwood: Remove redundant use of of_match_ptr
    Thermal: dove: Remove redundant use of of_match_ptr
    Thermal: armada: Remove redundant use of of_match_ptr
    ...

    Linus Torvalds
     

18 Jun, 2013

1 commit


28 May, 2013

1 commit


27 Apr, 2013

1 commit


25 Apr, 2013

1 commit


14 Apr, 2013

1 commit

  • The thermal governors are part of the thermal framework,
    rather than a seperate feature/module.
    Because the generic thermal layer can not work without
    thermal governors, and it must load the thermal governors
    during its initialization.

    Build them into one module in this patch.

    This also fix a problem that the generic thermal layer does not
    work when CONFIG_THERMAL=m and CONFIG_THERMAL_GOV_XXX=y.

    Signed-off-by: Zhang Rui
    Acked-by: Eduardo Valentin
    Acked-by: Durgadoss R

    Zhang Rui
     

02 Apr, 2013

2 commits

  • Because this feature is for debuging purposes, it is highly
    recommended to do not enable this on production systems.
    This patch adds warnings for system integrators, so that
    people are aware of this potential security issue.

    Signed-off-by: Eduardo Valentin
    Signed-off-by: Zhang Rui

    Eduardo Valentin
     
  • This removes the driver specific sysfs support of the temperature
    emulation and uses the newly added core thermal framework for thermal
    emulation. An exynos platform specific handler is added to support this.

    In this patch, the exynos senor(tmu) related code and exynos framework
    related (thermal zone, cooling devices) code are intentionally kept separate.
    So an emulated function pointer is passed from sensor to framework. This is
    beneficial in adding more sensor support using the same framework code
    which is an ongoing work. The goal is to finally split them totally. Even
    the existing read_temperature also follows the same execution method.

    Acked-by: Kukjin Kim
    Signed-off-by: Amit Daniel Kachhap
    Signed-off-by: Zhang Rui

    Amit Daniel Kachhap
     

01 Mar, 2013

1 commit

  • Pull thermal management updates from Zhang Rui:
    "Highlights:

    - introduction of Dove thermal sensor driver.

    - introduction of Kirkwood thermal sensor driver.

    - introduction of intel_powerclamp thermal cooling device driver.

    - add interrupt and DT support for rcar thermal driver.

    - add thermal emulation support which allows platform thermal driver
    to do software/hardware emulation for thermal issues."

    * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (36 commits)
    thermal: rcar: remove __devinitconst
    thermal: return an error on failure to register thermal class
    Thermal: rename thermal governor Kconfig option to avoid generic naming
    thermal: exynos: Use the new thermal trend type for quick cooling action.
    Thermal: exynos: Add support for temperature falling interrupt.
    Thermal: Dove: Add Themal sensor support for Dove.
    thermal: Add support for the thermal sensor on Kirkwood SoCs
    thermal: rcar: add Device Tree support
    thermal: rcar: remove machine_power_off() from rcar_thermal_notify()
    thermal: rcar: add interrupt support
    thermal: rcar: add read/write functions for common/priv data
    thermal: rcar: multi channel support
    thermal: rcar: use mutex lock instead of spin lock
    thermal: rcar: enable CPCTL to use hardware TSC deciding
    thermal: rcar: use parenthesis on macro
    Thermal: fix a build warning when CONFIG_THERMAL_EMULATION cleared
    Thermal: fix a wrong comment
    thermal: sysfs: Add a new sysfs node emul_temp for thermal emulation
    PM: intel_powerclamp: off by one in start_power_clamp()
    thermal: exynos: Miscellaneous fixes to support falling threshold interrupt
    ...

    Linus Torvalds
     

20 Feb, 2013

2 commits


06 Feb, 2013

2 commits

  • This patch adds support to set the emulated temperature method in
    thermal zone (sensor). After setting this feature thermal zone may
    report this temperature and not the actual temperature. The emulation
    implementation may be based on sensor capability through platform
    specific handler or pure software emulation if no platform handler defined.

    This is useful in debugging different temperature threshold and its
    associated cooling action. Critical threshold's cannot be emulated.
    Writing 0 on this node should disable emulation.

    Signed-off-by: Amit Daniel Kachhap
    Acked-by: Kukjin Kim
    Signed-off-by: Zhang Rui

    Amit Daniel Kachhap
     
  • Intel PowerClamp driver performs synchronized idle injection across
    all online CPUs. The goal is to maintain a given package level C-state
    ratio.

    Compared to other throttling methods already exist in the kernel,
    such as ACPI PAD (taking CPUs offline) and clock modulation, this is often
    more efficient in terms of performance per watt.

    Please refer to Documentation/thermal/intel_powerclamp.txt for more details.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Jacob Pan
    Signed-off-by: Zhang Rui

    Jacob Pan
     

16 Jan, 2013

1 commit


04 Jan, 2013

1 commit

  • This patch supports exynos's emulation mode with newly created sysfs node.
    Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for thermal
    management unit. Thermal emulation mode supports software debug for TMU's
    operation. User can set temperature manually with software code and TMU
    will read current temperature from user value not from sensor's value.
    This patch includes also documentary placed under Documentation/thermal/.

    Signed-off-by: Jonghwa Lee
    Signed-off-by: Zhang Rui

    Jonghwa Lee
     

05 Nov, 2012

1 commit


24 Sep, 2012

3 commits

  • This movement is needed because the hwmon entries and corresponding sysfs
    interface is a duplicate of utilities already provided by
    driver/thermal/thermal_sys.c. The goal is to place it in thermal folder
    and add necessary functions to use the in-kernel thermal interfaces.

    Signed-off-by: Amit Daniel Kachhap
    Acked-by: Guenter Roeck
    Cc: SangWook Ju
    Cc: Durgadoss
    Cc: Len Brown
    Cc: Jean Delvare
    Cc: Kyungmin Park
    Cc: Kukjin Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Amit Daniel Kachhap
    Signed-off-by: Zhang Rui

    Amit Daniel Kachhap
     
  • This patchset introduces a new generic cooling device based on cpufreq
    that can be used on non-ACPI platforms. As a proof of concept, we have
    drivers for the following platforms using this mechanism now:

    * Samsung Exynos (Exynos4 and Exynos5) in the current patchset.
    * Freescale i.MX (git://git.linaro.org/people/amitdanielk/linux.git imx6q_thermal)

    There is a small change in cpufreq cooling registration APIs, so a minor
    change is needed for Freescale platforms.

    Brief Description:

    1) The generic cooling devices code is placed inside driver/thermal/*
    as placing inside acpi folder will need un-necessary enabling of acpi
    code. This code is architecture independent.

    2) This patchset adds generic cpu cooling low level implementation
    through frequency clipping. In future, other cpu related cooling
    devices may be added here. An ACPI version of this already exists
    (drivers/acpi/processor_thermal.c) .But this will be useful for
    platforms like ARM using the generic thermal interface along with the
    generic cpu cooling devices. The cooling device registration API's
    return cooling device pointers which can be easily binded with the
    thermal zone trip points. The important APIs exposed are,

    a) struct thermal_cooling_device *cpufreq_cooling_register(
    struct cpumask *clip_cpus)
    b) void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)

    3) Samsung exynos platform thermal implementation is done using the
    generic cpu cooling APIs and the new trip type. The temperature sensor
    driver present in the hwmon folder(registered as hwmon driver) is moved
    to thermal folder and registered as a thermal driver.

    A simple data/control flow diagrams is shown below,

    Core Linux thermal Exynos thermal interface
    Cc: Guenter Roeck
    Cc: SangWook Ju
    Cc: Durgadoss
    Cc: Len Brown
    Cc: Jean Delvare
    Cc: Kyungmin Park
    Cc: Kukjin Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Amit Daniel Kachhap
    Signed-off-by: Zhang Rui

    Amit Daniel Kachhap
     
  • set upper and lower limits when binding
    a thermal cooling device to a thermal zone device.

    Signed-off-by: Zhang Rui
    Reviewed-by: Rafael J. Wysocki
    Reviewed-by: Eduardo Valentin

    Zhang Rui
     

25 Jul, 2012

3 commits

  • With commit 6503e5df08008b9a47022b5e9ebba658c8fa69af,
    the value of /sys/class/thermal/thermal_zoneX/mode has been changed
    from user/kernel to enabled/disabled.
    Update the documentation so that users won't be confused.

    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown

    Zhang Rui
     
  • The Linux Thermal Framework does not support hysteresis
    attributes. Most thermal sensors, today, have a
    hysteresis value associated with trip points.

    This patch adds hysteresis attributes on a per-trip-point
    basis, to the Thermal Framework. These attributes are
    optionally writable.

    Signed-off-by: Durgadoss R
    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown

    Durgadoss R
     
  • Some of the thermal drivers using the Generic Thermal Framework
    require (all/some) trip points to be writeable. This patch makes
    the trip point temperatures writeable on a per-trip point basis,
    and modifies the required function call in thermal.c. This patch
    also updates the Documentation to reflect the new change.

    Signed-off-by: Durgadoss R
    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown

    Durgadoss R
     

23 Jan, 2012

1 commit

  • It doesn't seem right for the thermal subsystem to export a symbol
    named generate_netlink_event. This function is thermal-specific and
    its name should reflect that fact. Rename it to
    thermal_generate_netlink_event.

    Signed-off-by: Jean Delvare
    Acked-by: Rafael J. Wysocki
    Acked-by: R.Durgadoss
    Signed-off-by: Len Brown

    Jean Delvare
     

12 Jan, 2011

1 commit


06 Nov, 2009

3 commits


29 Apr, 2008

1 commit