> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Thermal architecture

The thermal architecture shows how the Qualcomm Linux thermal framework interacts with temperature sensors (Tsens) hardware, cooling map interfaces, and user space clients.

<img src="https://mintcdn.com/qualcomm-prod/OKFyShYzKWv2bmj8/System/Power/media/k2c-perf/Thermal-architecture.svg?fit=max&auto=format&n=OKFyShYzKWv2bmj8&q=85&s=bece5e8c096fa06b92e319e7a79ebd76" alt="Thermal Architecture Diagram" width="941" height="320" data-path="System/Power/media/k2c-perf/Thermal-architecture.svg" />

**Figure: Thermal architecture**

**Table: Description of the components of thermal architecture**

| Components of Thermal Architecture | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Thermal device tree                | <ul><li>A thermal device tree consists of various thermal zones.</li><li>A thermal zone is configured for every Tsens.</li><li>Each thermal zone consists of sensor hardware information, different levels of thermal thresholds, and their respective cooling actions.</li><li>All rules for a thermal zone are defined in the device tree.</li></ul>                                                                                                      |
| Thermal framework                  | The thermal framework parses the thermal zone rules from the device tree and configures Tsens hardware to generate interrupts when temperature crosses the threshold.                                                                                                                                                                                                                                                                                       |
| Thermal governor                   | <ul><li>The thermal governor is a temperature monitor algorithm that controls the temperature of a thermal zone.</li><li>It mitigates the cooling devices associated with the zone and keeps the temperature within the limit.</li><li>On receiving an interrupt notification from Tsens hardware, the thermal framework uses a stepwise thermal governor to communicate the cooling actions to the cooling map interface (CPU frequency driver).</li></ul> |
| Cooling map interface              | <ul><li>A cooling map interface is a collection of devices that can be throttled to reduce the temperature of Qualcomm Linux.</li><li>Every trip instance of the thermal zone is associated with a cooling device.</li><li>The thermal core framework aggregates all the cooling device instance requests and places the aggregated requests to the cooling device.</li></ul>                                                                               |
| User space clients                 | User space clients use the following interfaces to communicate with the thermal framework:<br /><br /><ul><li>The `sysfs` interface is used to read the temperature of Tsens and kernel trip information.</li><li>The `Netlink` interface gets information on Tsens temperature notifications.</li></ul>                                                                                                                                                    |

## Thermal Mitigation Policies

Qualcomm Linux uses in-built software and hardware mitigation policies to regulate the device's thermal behavior.

The thermal framework applies the mitigation policies when required and operates through the following policies:

* Monitors the thermal response of the system using on-die Tsens
* Applies mitigation based on thermal threshold limits defined in the device tree
* Implements software throttling, hardware throttling, software shutdown, and hardware shutdown mitigation policies to control temperature

**Table: Temperature management techniques and description**

| Temperature Management Techniques | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Software throttling               | <ul><li>The Tsens triggers an interrupt whenever the temperature in the system crosses the configured threshold.</li><li>The thermal framework initiates the following mitigation actions on the CPU, GPU, and NSP in response to the interrupts:<ul><li>**Thermal DCVS**<ul><li>Reduces the maximum operating frequency if temperature thresholds are crossed</li><li>Voltage scaling occurs according to clock scaling, which reduces power consumption and temperature in turn</li></ul></li><li>**CPU idle injection**<br />The core is put in the deepest low power state for the configured idle time.</li></ul></li></ul> |
| Hardware throttling               | <ul><li>In-built hardware runs the thermal mitigation actions ensuring system reliability</li><li>Reduces CPU and NSP clock speed to quickly recover from high thermal conditions</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Software shutdown                 | The thermal framework initiates graceful shutdown upon receiving interruption from Tsens.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Hardware shutdown                 | The hardware initiates a device shutdown.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

**Note:** The thermal mitigation techniques are for information purpose only. They help in understanding performance regressions during high thermal conditions.

For detailed temperature thresholds for each platform, see [Platform Support - Thermal Management](platform-support-thermal).

## Next Steps

* [Configure a thermal zone](configure-a-thermal-zone)
