13 May, 2017

1 commit

  • Pull thermal management updates from Zhang Rui:

    - Fix a problem where orderly_shutdown() is called for multiple times
    due to multiple critical overheating events raised in a short period
    by platform thermal driver. (Keerthy)

    - Introduce a backup thermal shutdown mechanism, which invokes
    kernel_power_off()/emergency_restart() directly, after
    orderly_shutdown() being issued for certain amount of time(specified
    via Kconfig). This is useful in certain conditions that userspace may
    be unable to power off the system in a clean manner and leaves the
    system in a critical state, like in the middle of driver probing
    phase. (Keerthy)

    - Introduce a new interface in thermal devfreq_cooling code so that the
    driver can provide more precise data regarding actual power to the
    thermal governor every time the power budget is calculated. (Lukasz
    Luba)

    - Introduce BCM 2835 soc thermal driver and northstar thermal driver,
    within a new sub-folder. (Rafał Miłecki)

    - Introduce DA9062/61 thermal driver. (Steve Twiss)

    - Remove non-DT booting on TI-SoC driver. Also add support to fetching
    coefficients from DT. (Keerthy)

    - Refactorf RCAR Gen3 thermal driver. (Niklas Söderlund)

    - Small fix on MTK and intel-soc-dts thermal driver. (Dawei Chien,
    Brian Bian)

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (25 commits)
    thermal: core: Add a back up thermal shutdown mechanism
    thermal: core: Allow orderly_poweroff to be called only once
    Thermal: Intel SoC DTS: Change interrupt request behavior
    trace: thermal: add another parameter 'power' to the tracing function
    thermal: devfreq_cooling: add new interface for direct power read
    thermal: devfreq_cooling: refactor code and add get_voltage function
    thermal: mt8173: minor mtk_thermal.c cleanups
    thermal: bcm2835: move to the broadcom subdirectory
    thermal: broadcom: ns: specify myself as MODULE_AUTHOR
    thermal: da9062/61: Thermal junction temperature monitoring driver
    Documentation: devicetree: thermal: da9062/61 TJUNC temperature binding
    thermal: broadcom: add Northstar thermal driver
    dt-bindings: thermal: add support for Broadcom's Northstar thermal
    thermal: bcm2835: add thermal driver for bcm2835 SoC
    dt-bindings: Add thermal zone to bcm2835-thermal example
    thermal: rcar_gen3_thermal: add suspend and resume support
    thermal: rcar_gen3_thermal: store device match data in private structure
    thermal: rcar_gen3_thermal: enable hardware interrupts for trip points
    thermal: rcar_gen3_thermal: record and check number of TSCs found
    thermal: rcar_gen3_thermal: check that TSC exists before memory allocation
    ...

    Linus Torvalds
     

05 May, 2017

1 commit

  • orderly_poweroff is triggered when a graceful shutdown
    of system is desired. This may be used in many critical states of the
    kernel such as when subsystems detects conditions such as critical
    temperature conditions. However, in certain conditions in system
    boot up sequences like those in the middle of driver probes being
    initiated, userspace will be unable to power off the system in a clean
    manner and leaves the system in a critical state. In cases like these,
    the /sbin/poweroff will return success (having forked off to attempt
    powering off the system. However, the system overall will fail to
    completely poweroff (since other modules will be probed) and the system
    is still functional with no userspace (since that would have shut itself
    off).

    However, there is no clean way of detecting such failure of userspace
    powering off the system. In such scenarios, it is necessary for a backup
    workqueue to be able to force a shutdown of the system when orderly
    shutdown is not successful after a configurable time period.

    Reported-by: Nishanth Menon
    Signed-off-by: Keerthy
    Acked-by: Eduardo Valentin
    Signed-off-by: Zhang Rui

    Keerthy
     

21 Apr, 2017

1 commit

  • Commit feb6cd6a0f9f ("thermal/intel_powerclamp: stop sched tick in forced
    idle") changed how idle injection accouting, so we need to update
    the documentation accordingly.

    This patch also expands more details on the behavior of cur_state.

    Signed-off-by: Jacob Pan
    Reported-by: Wang, Xiaolong
    Signed-off-by: Jonathan Corbet

    Jacob Pan
     

05 Jan, 2017

1 commit


27 Sep, 2016

2 commits

  • This adds support for hardware-tracked trip points to the device tree
    thermal sensor framework.

    The framework supports an arbitrary number of trip points. Whenever
    the current temperature is updated, the trip points immediately
    below and above the current temperature are found. A .set_trips
    callback is then called with the temperatures. If there is no trip
    point above or below the current temperature, the passed trip
    temperature will be -INT_MAX or INT_MAX respectively. In this callback,
    the driver should program the hardware such that it is notified
    when either of these trip points are triggered. When a trip point
    is triggered, the driver should call `thermal_zone_device_update'
    for the respective thermal zone. This will cause the trip points
    to be updated again.

    If .set_trips is not implemented, the framework behaves as before.

    This patch is based on an earlier version from Mikko Perttunen

    Signed-off-by: Sascha Hauer
    Signed-off-by: Caesar Wang
    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Cc: linux-pm@vger.kernel.org
    Reviewed-by: Javi Merino
    Signed-off-by: Eduardo Valentin
    Signed-off-by: Zhang Rui

    Sascha Hauer
     
  • Add apis for platform thermal drivers to query for slope and offset
    attributes, which might be needed for temperature calculations.

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

    Rajendra Nayak
     

01 Jul, 2016

1 commit


17 May, 2016

1 commit


10 Mar, 2016

2 commits


15 Jan, 2016

1 commit


14 Sep, 2015

1 commit

  • The power allocator governor currently requires that the thermal zone
    has at least two passive trip points. If there aren't, the governor
    refuses to bind to the thermal zone.

    This commit relaxes that requirement. Now the governor will bind to all
    thermal zones regardless of how many trip points they have.

    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Reviewed-by: Daniel Kurtz
    Signed-off-by: Javi Merino
    Signed-off-by: Eduardo Valentin

    Javi Merino
     

03 Aug, 2015

1 commit

  • The Linux thermal framework support to change thermal governor
    policy in userspace, but it can't show what available policies
    supported.

    This patch adds available_policies attribute to the thermal
    framework, it can list the thermal governors which can be
    used for a particular zone. This attribute is read only.

    Signed-off-by: Wei Ni
    Reviewed-by: Javi Merino
    Signed-off-by: Zhang Rui

    Ni Wade
     

12 May, 2015

1 commit

  • 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

    Eduardo Valentin
     

05 May, 2015

6 commits

  • 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

    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

    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

    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

    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

    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

    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