Commit 6a776e47 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents a34ab101 cb15c81a
Loading
Loading
Loading
Loading
+28 −4
Original line number Diff line number Diff line
@@ -7,11 +7,35 @@ compatible: should be one of: "brcm,bcm2835-thermal",
			"brcm,bcm2836-thermal" or "brcm,bcm2837-thermal"
reg:			Address range of the thermal registers.
clocks: 		Phandle of the clock used by the thermal sensor.
#thermal-sensor-cells:	should be 0 (see thermal.txt)

Example:

thermal-zones {
	cpu_thermal: cpu-thermal {
		polling-delay-passive = <0>;
		polling-delay = <1000>;

		thermal-sensors = <&thermal>;

		trips {
			cpu-crit {
				temperature	= <80000>;
				hysteresis	= <0>;
				type		= "critical";
			};
		};

		coefficients = <(-538)	407000>;

		cooling-maps {
		};
	};
};

thermal: thermal@7e212000 {
	compatible = "brcm,bcm2835-thermal";
	reg = <0x7e212000 0x8>;
	clocks = <&clocks BCM2835_CLOCK_TSENS>;
	#thermal-sensor-cells = <0>;
};
+37 −0
Original line number Diff line number Diff line
* Broadcom Northstar Thermal

This binding describes thermal sensor that is part of Northstar's DMU (Device
Management Unit).

Required properties:
- compatible : Must be "brcm,ns-thermal"
- reg : iomem address range of PVTMON registers
- #thermal-sensor-cells : Should be <0>

Example:

thermal: thermal@1800c2c0 {
	compatible = "brcm,ns-thermal";
	reg = <0x1800c2c0 0x10>;
	#thermal-sensor-cells = <0>;
};

thermal-zones {
	cpu_thermal: cpu-thermal {
		polling-delay-passive = <0>;
		polling-delay = <1000>;
		coefficients = <(-556) 418000>;
		thermal-sensors = <&thermal>;

		trips {
			cpu-crit {
				temperature	= <125000>;
				hysteresis	= <0>;
				type		= "critical";
			};
		};

		cooling-maps {
		};
	};
};
+36 −0
Original line number Diff line number Diff line
* Dialog DA9062/61 TJUNC Thermal Module

This module is part of the DA9061/DA9062. For more details about entire
DA9062 and DA9061 chips see Documentation/devicetree/bindings/mfd/da9062.txt

Junction temperature thermal module uses an interrupt signal to identify
high THERMAL_TRIP_HOT temperatures for the PMIC device.

Required properties:

- compatible: should be one of the following valid compatible string lines:
        "dlg,da9061-thermal", "dlg,da9062-thermal"
        "dlg,da9062-thermal"

Optional properties:

- polling-delay-passive : Specify the polling period, measured in
    milliseconds, between thermal zone device update checks.

Example: DA9062

	pmic0: da9062@58 {
		thermal {
			compatible = "dlg,da9062-thermal";
			polling-delay-passive = <3000>;
		};
	};

Example: DA9061 using a fall-back compatible for the DA9062 onkey driver

	pmic0: da9061@58 {
		thermal {
			compatible = "dlg,da9061-thermal", "dlg,da9062-thermal";
			polling-delay-passive = <3000>;
		};
	};
+21 −0
Original line number Diff line number Diff line
@@ -582,3 +582,24 @@ platform data is provided, this uses the step_wise throttling policy.
This function serves as an arbitrator to set the state of a cooling
device. It sets the cooling device to the deepest cooling state if
possible.

6. thermal_emergency_poweroff:

On an event of critical trip temperature crossing. Thermal framework
allows the system to shutdown gracefully by calling orderly_poweroff().
In the event of a failure of orderly_poweroff() to shut down the system
we are in danger of keeping the system alive at undesirably high
temperatures. To mitigate this high risk scenario we program a work
queue to fire after a pre-determined number of seconds to start
an emergency shutdown of the device using the kernel_power_off()
function. In case kernel_power_off() fails then finally
emergency_restart() is called in the worst case.

The delay should be carefully profiled so as to give adequate time for
orderly_poweroff(). In case of failure of an orderly_poweroff() the
emergency poweroff kicks in after the delay has elapsed and shuts down
the system.

If set to 0 emergency poweroff will not be supported. So a carefully
profiled non-zero positive value is a must for emergerncy poweroff to be
triggered.
+32 −0
Original line number Diff line number Diff line
@@ -15,6 +15,23 @@ menuconfig THERMAL

if THERMAL

config THERMAL_EMERGENCY_POWEROFF_DELAY_MS
	int "Emergency poweroff delay in milli-seconds"
	depends on THERMAL
	default 0
	help
	  Thermal subsystem will issue a graceful shutdown when
	  critical temperatures are reached using orderly_poweroff(). In
	  case of failure of an orderly_poweroff(), the thermal emergency
	  poweroff kicks in after a delay has elapsed and shuts down the system.
	  This config is number of milliseconds to delay before emergency
	  poweroff kicks in. Similarly to the critical trip point,
	  the delay should be carefully profiled so as to give adequate
	  time for orderly_poweroff() to finish on regular execution.
	  If set to 0 emergency poweroff will not be supported.

	  In doubt, leave as 0.

config THERMAL_HWMON
	bool
	prompt "Expose thermal sensors as hwmon device"
@@ -291,6 +308,16 @@ config ARMADA_THERMAL
	  Enable this option if you want to have support for thermal management
	  controller present in Armada 370 and Armada XP SoC.

config DA9062_THERMAL
	tristate "DA9062/DA9061 Dialog Semiconductor thermal driver"
	depends on MFD_DA9062 || COMPILE_TEST
	depends on OF
	help
	  Enable this for the Dialog Semiconductor thermal sensor driver.
	  This will report PMIC junction over-temperature for one thermal trip
	  zone.
	  Compatible with the DA9062 and DA9061 PMICs.

config INTEL_POWERCLAMP
	tristate "Intel PowerClamp idle injection driver"
	depends on THERMAL
@@ -380,6 +407,11 @@ config MTK_THERMAL
	  Enable this option if you want to have support for thermal management
	  controller present in Mediatek SoCs

menu "Broadcom thermal drivers"
depends on ARCH_BCM || COMPILE_TEST
source "drivers/thermal/broadcom/Kconfig"
endmenu

menu "Texas Instruments thermal drivers"
depends on ARCH_HAS_BANDGAP || COMPILE_TEST
depends on HAS_IOMEM
Loading