* [PATCH v6 0/3] Lenovo ThinkPad T14s EC thermal monitoring and thermal zone integration
@ 2026-07-07 19:22 Daniel Lezcano
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2026-07-07 19:22 UTC (permalink / raw)
To: sre, hansg, ilpo.jarvinen, linux, andersson, konradybcio, robh,
krzk+dt, conor+dt
Cc: bryan.odonoghue, platform-driver-x86, linux-kernel, linux-hwmon,
linux-arm-msm, devicetree, neil.armstrong, gaurav.kohli,
manaf.pallikunhi, priyansh.jain
Hi,
This series extends the Lenovo ThinkPad T14s embedded controller driver
with environmental monitoring capabilities and integrates the exposed
sensors into the Linux thermal framework.
The EC provides access to several platform temperature sensors
covering the SoC, keyboard area, bottom cover, charging circuitry, QTM
module and SSD. These sensors are currently used by the firmware for
thermal management but are not exposed to Linux.
The first patch adds hwmon support for the EC temperature sensors.
The second patch exposes the EC as a thermal sensor provider in the
device tree and defines thermal zones for the keyboard skin
temperature and the charging circuitry temperature. This allows the
generic thermal framework to react to EC-reported temperatures and
apply standard Linux thermal mitigation policies.
As the EC protocol is not fully decoded, the passive trip points
get/set actions are missing, so it is not possible to program a
threshold and receive an interrupt when crossed the way up or
down. Consequently, the thermal zone related to the charging circuitry
is polled every two seconds until we can set the trip points in the
EC.
This series fixes critical thermal issues happening on this platform
where a kernel compilation, or heavy workloads, lead to a system
reboot.
Tested on a Lenovo ThinkPad T14s Gen 6 (Snapdragon X Elite).
Please make sure scmi-cpufreq.ko is loaded before testing
Thanks,
Daniel
---
Changelog:
v6:
- Added Reviewed-by tag (Dmitry Baryshkov)
- Removed required property for #thermal-sensor-cells (Krzysztof Kozlowski)
v5:
- Added Reviewed-by tag (Ilpo Järvinen)
- Added the '#thermal-sensor-cells' property DT binding (Sashiko)
v4:
- Added the missing HWMON_C_REGISTER_TZ attribute (Sashiko)
- Fixed dependency with HWMON (Sashiko)
- Added Tested-by tag (Neil Armstrong)
v3:
- Removed event based because trip point are not yet well supported
- Added an empty line after variable declaration (Ilpo Järvinen)
- Used MILLIDEGREE_PER_DEGREE from units.h (Ilpo Järvinen)
- Made switch consistent (Ilpo Järvinen)
v2:
- Fixed patch 1 subject prefix
- Removed the fan information part
- Added HWMON_T_ALARM
- Fixed DT change description to reflect what it does really
Daniel Lezcano (3):
dt-bindings: embedded-controller: Add Lenovo ThinkPad T14s thermal
sensor provider support
platform: arm64: lenovo-thinkpad-t14s-ec: Add hwmon support for
temperatures
arm64: dts: qcom: x1e78100-t14s: Add thermal zones for keyboard skin
and charging sensors
.../lenovo,thinkpad-t14s-ec.yaml | 4 +
.../qcom/x1e78100-lenovo-thinkpad-t14s.dtsi | 67 ++++++++-
drivers/platform/arm64/Kconfig | 1 +
drivers/platform/arm64/lenovo-thinkpad-t14s.c | 131 ++++++++++++++++++
4 files changed, 202 insertions(+), 1 deletion(-)
--
2.53.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v6 0/3] Lenovo ThinkPad T14s EC thermal monitoring and thermal zone integration
@ 2026-07-07 19:22 Daniel Lezcano
2026-07-08 12:03 ` Stephan Gerhold
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Lezcano @ 2026-07-07 19:22 UTC (permalink / raw)
To: sre, hansg, ilpo.jarvinen, linux, andersson, konradybcio, robh,
krzk+dt, conor+dt
Cc: bryan.odonoghue, platform-driver-x86, linux-kernel, linux-hwmon,
linux-arm-msm, devicetree, neil.armstrong, gaurav.kohli,
manaf.pallikunhi, priyansh.jain
Hi,
This series extends the Lenovo ThinkPad T14s embedded controller driver
with environmental monitoring capabilities and integrates the exposed
sensors into the Linux thermal framework.
The EC provides access to several platform temperature sensors
covering the SoC, keyboard area, bottom cover, charging circuitry, QTM
module and SSD. These sensors are currently used by the firmware for
thermal management but are not exposed to Linux.
The first patch adds hwmon support for the EC temperature sensors.
The second patch exposes the EC as a thermal sensor provider in the
device tree and defines thermal zones for the keyboard skin
temperature and the charging circuitry temperature. This allows the
generic thermal framework to react to EC-reported temperatures and
apply standard Linux thermal mitigation policies.
As the EC protocol is not fully decoded, the passive trip points
get/set actions are missing, so it is not possible to program a
threshold and receive an interrupt when crossed the way up or
down. Consequently, the thermal zone related to the charging circuitry
is polled every two seconds until we can set the trip points in the
EC.
This series fixes critical thermal issues happening on this platform
where a kernel compilation, or heavy workloads, lead to a system
reboot.
Tested on a Lenovo ThinkPad T14s Gen 6 (Snapdragon X Elite).
Please make sure scmi-cpufreq.ko is loaded before testing
Thanks,
Daniel
---
Changelog:
v6:
- Added Reviewed-by tag (Dmitry Baryshkov)
- Removed required property for #thermal-sensor-cells (Krzysztof Kozlowski)
v5:
- Added Reviewed-by tag (Ilpo Järvinen)
- Added the '#thermal-sensor-cells' property DT binding (Sashiko)
v4:
- Added the missing HWMON_C_REGISTER_TZ attribute (Sashiko)
- Fixed dependency with HWMON (Sashiko)
- Added Tested-by tag (Neil Armstrong)
v3:
- Removed event based because trip point are not yet well supported
- Added an empty line after variable declaration (Ilpo Järvinen)
- Used MILLIDEGREE_PER_DEGREE from units.h (Ilpo Järvinen)
- Made switch consistent (Ilpo Järvinen)
v2:
- Fixed patch 1 subject prefix
- Removed the fan information part
- Added HWMON_T_ALARM
- Fixed DT change description to reflect what it does really
Daniel Lezcano (3):
dt-bindings: embedded-controller: Add Lenovo ThinkPad T14s thermal
sensor provider support
platform: arm64: lenovo-thinkpad-t14s-ec: Add hwmon support for
temperatures
arm64: dts: qcom: x1e78100-t14s: Add thermal zones for keyboard skin
and charging sensors
.../lenovo,thinkpad-t14s-ec.yaml | 4 +
.../qcom/x1e78100-lenovo-thinkpad-t14s.dtsi | 67 ++++++++-
drivers/platform/arm64/Kconfig | 1 +
drivers/platform/arm64/lenovo-thinkpad-t14s.c | 131 ++++++++++++++++++
4 files changed, 202 insertions(+), 1 deletion(-)
--
2.53.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v6 0/3] Lenovo ThinkPad T14s EC thermal monitoring and thermal zone integration
2026-07-07 19:22 Daniel Lezcano
@ 2026-07-08 12:03 ` Stephan Gerhold
2026-07-08 13:16 ` Daniel Lezcano
0 siblings, 1 reply; 6+ messages in thread
From: Stephan Gerhold @ 2026-07-08 12:03 UTC (permalink / raw)
To: Daniel Lezcano
Cc: sre, hansg, ilpo.jarvinen, linux, andersson, konradybcio, robh,
krzk+dt, conor+dt, bryan.odonoghue, platform-driver-x86,
linux-kernel, linux-hwmon, linux-arm-msm, devicetree,
neil.armstrong, gaurav.kohli, manaf.pallikunhi, priyansh.jain
On Tue, Jul 07, 2026 at 09:22:25PM +0200, Daniel Lezcano wrote:
> This series extends the Lenovo ThinkPad T14s embedded controller driver
> with environmental monitoring capabilities and integrates the exposed
> sensors into the Linux thermal framework.
>
> The EC provides access to several platform temperature sensors
> covering the SoC, keyboard area, bottom cover, charging circuitry, QTM
> module and SSD. These sensors are currently used by the firmware for
> thermal management but are not exposed to Linux.
>
> The first patch adds hwmon support for the EC temperature sensors.
>
> The second patch exposes the EC as a thermal sensor provider in the
> device tree and defines thermal zones for the keyboard skin
> temperature and the charging circuitry temperature. This allows the
> generic thermal framework to react to EC-reported temperatures and
> apply standard Linux thermal mitigation policies.
>
> As the EC protocol is not fully decoded, the passive trip points
> get/set actions are missing, so it is not possible to program a
> threshold and receive an interrupt when crossed the way up or
> down. Consequently, the thermal zone related to the charging circuitry
> is polled every two seconds until we can set the trip points in the
> EC.
>
> This series fixes critical thermal issues happening on this platform
> where a kernel compilation, or heavy workloads, lead to a system
> reboot.
>
Thanks for working on this! I have a few comments/questions about this:
1. EC vs PMIC temperature sensors
AFAIK, the T14s (and actually most X1E laptops) have two sets of
thermistors in each location: One is connected to the PMIC (called
SYS_THERMx), and the other set is connected to the EC.
The SYS_THERMx sensors connected to the PMIC have been enabled for the
T14s already over a year ago [1]. The reason this is not upstream is
that we now been waiting 3 years for the corresponding ADC/thermal code
to land upstream [2]. It seems pretty close now, the ADC part has landed
and there is only the thermal part left [3].
The PMIC thermistor setup is likely going to be similar for most X1E
laptops, so I think it would be preferable to use that instead of the EC
sensors to implement additional temperature throttling. It also supports
interrupts/trip points already, so it doesn't need polling.
The most recent proposed patch actually adds the SYS_THERMx thermal
zones to all X1E-based devices [4], although I'm not sure if it would be
better to keep that device-specific...
[1]: https://github.com/stephan-gh/linux/commit/c0ddc9fa96667d6b32d690ce6a3dcfc76aaabad6
[2]: https://lore.kernel.org/linux-arm-msm/20230708072835.3035398-1-quic_jprakash@quicinc.com/
[3]: https://lore.kernel.org/linux-arm-msm/20260705-gen3_adc_tm-v3-0-ac62f387dbce@oss.qualcomm.com/
[4]: https://lore.kernel.org/linux-arm-msm/20260614-adc5_gen3_dt-v2-4-32ec576c5865@oss.qualcomm.com/
2. EC sensor mapping vs PMIC sensor mapping
In PATCH 2/3 you define:
{ .label = "soc", .reg = T14S_EC_SYS_THERM0 },
{ .label = "keyboard", .reg = T14S_EC_SYS_THERM1 },
{ .label = "base", .reg = T14S_EC_SYS_THERM2 },
{ .label = "charging", .reg = T14S_EC_SYS_THERM3 },
{ .label = "qtm", .reg = T14S_EC_SYS_THERM6 },
{ .label = "ssd", .reg = T14S_EC_SYS_THERM7 },
I'm not sure if this is correct. When comparing this with the data read
from the sensors connected to the PMIC:
| Sensor | PMIC Channel | EC (hwmon) | PMIC (thermal) | Delta |
|-----------------|--------------|--------------|-----------------|----------|
| SOC | SYS_THERM0 | 79.0°C | 78.7°C | +0.3°C |
| Keyboard | SYS_THERM1 | 68.0°C | 70.1°C | -2.1°C |
| Base / Back | SYS_THERM2 | 66.0°C | 64.6°C | +1.4°C |
| Charging | SYS_THERM3 | 73.0°C | 73.8°C | -0.8°C |
| West / QTM | SYS_THERM6 | 64.0°C | 62.6°C | +1.4°C |
| SSD | SYS_THERM7 | 31.0°C | 67.1°C | -36.1°C |
| Modem | SYS_THERM4 | N/A | 31.6°C | N/A |
| East | SYS_THERM5 | N/A | 70.3°C | N/A |
The SSD delta of 36°C is definitely suspicious. I think
"ssd"/T14S_EC_SYS_THERM7 in your EC driver patch is actually the modem
sensor (SYS_THERM4).
If you look at a picture of the T14s mainboard
(https://www.notebookcheck.net/fileadmin/_processed_/d/c/csm_DSC_0003_aadae1ddd2.jpg)
and zoom in to the unpopulated modem sub-board left to the fan you can
see the two thermistors RT601 and RT301. The SSD on the other hand sits
almost directly next to the SoC on the right, so I wouldn't expect it to
stay > 30°C cooler than its surroundings.
However, there are also two thermistors next to the SSD, see e.g. this
close-up picture of the mainboard:
https://download.lenovo.com/Images/Parts/5B21P83385/5B21P83385_A.jpg
This means that the SSD is probably one of the other mappings. If the
thermistors are consecutively numbered in the EC firmware, the SSD
(RT8203) might be actually the third sensor ("base"/T14S_EC_SYS_THERM2).
I'm not sure how to figure out the proper mapping.
The back of the mainboard is completely covered with tape
(https://download.lenovo.com/Images/Parts/5B21P83377/5B21P83377_B.jpg)
so it's impossible to see anything there.
3. Active vs passive throttling
Are you matching the Windows cooling/throttling setup here? If not, have
you considered how this interacts with the fan control applied by the
EC? I'm a bit worried that this might lead to unexpected performance
regressions if we start throttling before the EC runs the fan at full
speed.
Thanks,
Stephan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v6 0/3] Lenovo ThinkPad T14s EC thermal monitoring and thermal zone integration
2026-07-08 12:03 ` Stephan Gerhold
@ 2026-07-08 13:16 ` Daniel Lezcano
2026-07-08 13:39 ` Stephan Gerhold
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Lezcano @ 2026-07-08 13:16 UTC (permalink / raw)
To: Stephan Gerhold
Cc: sre, hansg, ilpo.jarvinen, linux, andersson, konradybcio, robh,
krzk+dt, conor+dt, bryan.odonoghue, platform-driver-x86,
linux-kernel, linux-hwmon, linux-arm-msm, devicetree,
neil.armstrong, gaurav.kohli, manaf.pallikunhi, priyansh.jain
Hi Stephan,
On 7/8/26 14:03, Stephan Gerhold wrote:
> On Tue, Jul 07, 2026 at 09:22:25PM +0200, Daniel Lezcano wrote:
>> This series extends the Lenovo ThinkPad T14s embedded controller driver
>> with environmental monitoring capabilities and integrates the exposed
>> sensors into the Linux thermal framework.
>>
>> The EC provides access to several platform temperature sensors
>> covering the SoC, keyboard area, bottom cover, charging circuitry, QTM
>> module and SSD. These sensors are currently used by the firmware for
>> thermal management but are not exposed to Linux.
>>
>> The first patch adds hwmon support for the EC temperature sensors.
>>
>> The second patch exposes the EC as a thermal sensor provider in the
>> device tree and defines thermal zones for the keyboard skin
>> temperature and the charging circuitry temperature. This allows the
>> generic thermal framework to react to EC-reported temperatures and
>> apply standard Linux thermal mitigation policies.
>>
>> As the EC protocol is not fully decoded, the passive trip points
>> get/set actions are missing, so it is not possible to program a
>> threshold and receive an interrupt when crossed the way up or
>> down. Consequently, the thermal zone related to the charging circuitry
>> is polled every two seconds until we can set the trip points in the
>> EC.
>>
>> This series fixes critical thermal issues happening on this platform
>> where a kernel compilation, or heavy workloads, lead to a system
>> reboot.
>>
>
> Thanks for working on this! I have a few comments/questions about this:
Thanks for jumping in the discussion
> 1. EC vs PMIC temperature sensors
>
> AFAIK, the T14s (and actually most X1E laptops) have two sets of
> thermistors in each location: One is connected to the PMIC (called
> SYS_THERMx), and the other set is connected to the EC.
From the schematics I have in my possession, the SYS_THERMx are
connected to the EC, at least this is how they are named. May be it is
the other set with different numbers.
I'm curious to know why this mirroring ?
> The SYS_THERMx sensors connected to the PMIC have been enabled for the
> T14s already over a year ago [1]. The reason this is not upstream is
> that we now been waiting 3 years for the corresponding ADC/thermal code
> to land upstream [2]. It seems pretty close now, the ADC part has landed
> and there is only the thermal part left [3].
Right, I have to pick this one.
> The PMIC thermistor setup is likely going to be similar for most X1E
> laptops, so I think it would be preferable to use that instead of the EC
> sensors to implement additional temperature throttling. It also supports
> interrupts/trip points already, so it doesn't need polling.
I definitively second that
> The most recent proposed patch actually adds the SYS_THERMx thermal
> zones to all X1E-based devices [4], although I'm not sure if it would be
> better to keep that device-specific...
>
> [1]: https://github.com/stephan-gh/linux/commit/c0ddc9fa96667d6b32d690ce6a3dcfc76aaabad6
> [2]: https://lore.kernel.org/linux-arm-msm/20230708072835.3035398-1-quic_jprakash@quicinc.com/
> [3]: https://lore.kernel.org/linux-arm-msm/20260705-gen3_adc_tm-v3-0-ac62f387dbce@oss.qualcomm.com/
> [4]: https://lore.kernel.org/linux-arm-msm/20260614-adc5_gen3_dt-v2-4-32ec576c5865@oss.qualcomm.com/
>
> 2. EC sensor mapping vs PMIC sensor mapping
>
> In PATCH 2/3 you define:
>
> { .label = "soc", .reg = T14S_EC_SYS_THERM0 },
> { .label = "keyboard", .reg = T14S_EC_SYS_THERM1 },
> { .label = "base", .reg = T14S_EC_SYS_THERM2 },
> { .label = "charging", .reg = T14S_EC_SYS_THERM3 },
> { .label = "qtm", .reg = T14S_EC_SYS_THERM6 },
> { .label = "ssd", .reg = T14S_EC_SYS_THERM7 },
>
> I'm not sure if this is correct. When comparing this with the data read
> from the sensors connected to the PMIC:
>
> | Sensor | PMIC Channel | EC (hwmon) | PMIC (thermal) | Delta |
> |-----------------|--------------|--------------|-----------------|----------|
> | SOC | SYS_THERM0 | 79.0°C | 78.7°C | +0.3°C |
> | Keyboard | SYS_THERM1 | 68.0°C | 70.1°C | -2.1°C |
> | Base / Back | SYS_THERM2 | 66.0°C | 64.6°C | +1.4°C |
> | Charging | SYS_THERM3 | 73.0°C | 73.8°C | -0.8°C |
> | West / QTM | SYS_THERM6 | 64.0°C | 62.6°C | +1.4°C |
> | SSD | SYS_THERM7 | 31.0°C | 67.1°C | -36.1°C |
> | Modem | SYS_THERM4 | N/A | 31.6°C | N/A |
> | East | SYS_THERM5 | N/A | 70.3°C | N/A |
>
> The SSD delta of 36°C is definitely suspicious. I think
> "ssd"/T14S_EC_SYS_THERM7 in your EC driver patch is actually the modem
> sensor (SYS_THERM4).
Yes probably, it was unclear from the documentation. I may have mixed
some info.
The SoC sensor seems to be hotter than the Charging sensor. I'm a bit
surprised because I've always seen charging hotter than the rest.
> If you look at a picture of the T14s mainboard
> (https://www.notebookcheck.net/fileadmin/_processed_/d/c/csm_DSC_0003_aadae1ddd2.jpg)
> and zoom in to the unpopulated modem sub-board left to the fan you can
> see the two thermistors RT601 and RT301. The SSD on the other hand sits
> almost directly next to the SoC on the right, so I wouldn't expect it to
> stay > 30°C cooler than its surroundings.
>
> However, there are also two thermistors next to the SSD, see e.g. this
> close-up picture of the mainboard:
> https://download.lenovo.com/Images/Parts/5B21P83385/5B21P83385_A.jpg
> This means that the SSD is probably one of the other mappings. If the
> thermistors are consecutively numbered in the EC firmware, the SSD
> (RT8203) might be actually the third sensor ("base"/T14S_EC_SYS_THERM2).
> I'm not sure how to figure out the proper mapping.
>
> The back of the mainboard is completely covered with tape
> (https://download.lenovo.com/Images/Parts/5B21P83377/5B21P83377_B.jpg)
> so it's impossible to see anything there.
>
> 3. Active vs passive throttling
>
> Are you matching the Windows cooling/throttling setup here? If not, have
> you considered how this interacts with the fan control applied by the
> EC? I'm a bit worried that this might lead to unexpected performance
> regressions if we start throttling before the EC runs the fan at full
> speed.
For the moment, I would say fixing the critical issue is the highest
priority. With the 'charging' sensor with a 55°C trip point, AFAICT the
fan is at full speed before this trip is reached.
Then we may want to take control of the fan and add active trip and
passive trip.
This autonomous EC / PMIC mix sounds a bit strange to me :/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v6 0/3] Lenovo ThinkPad T14s EC thermal monitoring and thermal zone integration
2026-07-08 13:16 ` Daniel Lezcano
@ 2026-07-08 13:39 ` Stephan Gerhold
2026-07-08 14:09 ` Daniel Lezcano
0 siblings, 1 reply; 6+ messages in thread
From: Stephan Gerhold @ 2026-07-08 13:39 UTC (permalink / raw)
To: Daniel Lezcano
Cc: sre, hansg, ilpo.jarvinen, linux, andersson, konradybcio, robh,
krzk+dt, conor+dt, bryan.odonoghue, platform-driver-x86,
linux-kernel, linux-hwmon, linux-arm-msm, devicetree,
neil.armstrong, gaurav.kohli, manaf.pallikunhi, priyansh.jain
On Wed, Jul 08, 2026 at 03:16:20PM +0200, Daniel Lezcano wrote:
> On 7/8/26 14:03, Stephan Gerhold wrote:
> > On Tue, Jul 07, 2026 at 09:22:25PM +0200, Daniel Lezcano wrote:
> > > This series extends the Lenovo ThinkPad T14s embedded controller driver
> > > with environmental monitoring capabilities and integrates the exposed
> > > sensors into the Linux thermal framework.
> > >
> > > The EC provides access to several platform temperature sensors
> > > covering the SoC, keyboard area, bottom cover, charging circuitry, QTM
> > > module and SSD. These sensors are currently used by the firmware for
> > > thermal management but are not exposed to Linux.
> > >
> > > The first patch adds hwmon support for the EC temperature sensors.
> > >
> > > The second patch exposes the EC as a thermal sensor provider in the
> > > device tree and defines thermal zones for the keyboard skin
> > > temperature and the charging circuitry temperature. This allows the
> > > generic thermal framework to react to EC-reported temperatures and
> > > apply standard Linux thermal mitigation policies.
> > >
> > > As the EC protocol is not fully decoded, the passive trip points
> > > get/set actions are missing, so it is not possible to program a
> > > threshold and receive an interrupt when crossed the way up or
> > > down. Consequently, the thermal zone related to the charging circuitry
> > > is polled every two seconds until we can set the trip points in the
> > > EC.
> > >
> > > This series fixes critical thermal issues happening on this platform
> > > where a kernel compilation, or heavy workloads, lead to a system
> > > reboot.
> > >
> >
> > Thanks for working on this! I have a few comments/questions about this:
>
> Thanks for jumping in the discussion
>
> > 1. EC vs PMIC temperature sensors
> >
> > AFAIK, the T14s (and actually most X1E laptops) have two sets of
> > thermistors in each location: One is connected to the PMIC (called
> > SYS_THERMx), and the other set is connected to the EC.
>
> From the schematics I have in my possession, the SYS_THERMx are connected to
> the EC, at least this is how they are named. May be it is the other set with
> different numbers.
>
> I'm curious to know why this mirroring ?
>
AFAICT the SYS_THERMx thermistors all go to the PMC838C PMIC on the
T14s. The EC thermistors are on a separate page, search for "RT8203" for
example.
I'm not sure why this mirroring exists, but even QC's Hamoa/X1E CRD has
that. IIRC it is not always there though, the Purwa/X1P CRD has the
sensors only connected to the EC (maybe for some minor cost savings?).
I believe on some devices the OS (Windows/Linux) even needs to send
temperatures (e.g. CPU/GPU temperature) to the EC for it to work
correctly. Not sure if the T14s needs/uses that though. I was mostly
looking at the CRD thermal setup a year ago...
> > The SYS_THERMx sensors connected to the PMIC have been enabled for the
> > T14s already over a year ago [1]. The reason this is not upstream is
> > that we now been waiting 3 years for the corresponding ADC/thermal code
> > to land upstream [2]. It seems pretty close now, the ADC part has landed
> > and there is only the thermal part left [3].
>
> Right, I have to pick this one.
>
> > The PMIC thermistor setup is likely going to be similar for most X1E
> > laptops, so I think it would be preferable to use that instead of the EC
> > sensors to implement additional temperature throttling. It also supports
> > interrupts/trip points already, so it doesn't need polling.
>
> I definitively second that
>
> > The most recent proposed patch actually adds the SYS_THERMx thermal
> > zones to all X1E-based devices [4], although I'm not sure if it would be
> > better to keep that device-specific...
> >
> > [1]: https://github.com/stephan-gh/linux/commit/c0ddc9fa96667d6b32d690ce6a3dcfc76aaabad6
> > [2]: https://lore.kernel.org/linux-arm-msm/20230708072835.3035398-1-quic_jprakash@quicinc.com/
> > [3]: https://lore.kernel.org/linux-arm-msm/20260705-gen3_adc_tm-v3-0-ac62f387dbce@oss.qualcomm.com/
> > [4]: https://lore.kernel.org/linux-arm-msm/20260614-adc5_gen3_dt-v2-4-32ec576c5865@oss.qualcomm.com/
> >
> > 2. EC sensor mapping vs PMIC sensor mapping
> >
> > In PATCH 2/3 you define:
> >
> > { .label = "soc", .reg = T14S_EC_SYS_THERM0 },
> > { .label = "keyboard", .reg = T14S_EC_SYS_THERM1 },
> > { .label = "base", .reg = T14S_EC_SYS_THERM2 },
> > { .label = "charging", .reg = T14S_EC_SYS_THERM3 },
> > { .label = "qtm", .reg = T14S_EC_SYS_THERM6 },
> > { .label = "ssd", .reg = T14S_EC_SYS_THERM7 },
> >
> > I'm not sure if this is correct. When comparing this with the data read
> > from the sensors connected to the PMIC:
> >
> > | Sensor | PMIC Channel | EC (hwmon) | PMIC (thermal) | Delta |
> > |-----------------|--------------|--------------|-----------------|----------|
> > | SOC | SYS_THERM0 | 79.0°C | 78.7°C | +0.3°C |
> > | Keyboard | SYS_THERM1 | 68.0°C | 70.1°C | -2.1°C |
> > | Base / Back | SYS_THERM2 | 66.0°C | 64.6°C | +1.4°C |
> > | Charging | SYS_THERM3 | 73.0°C | 73.8°C | -0.8°C |
> > | West / QTM | SYS_THERM6 | 64.0°C | 62.6°C | +1.4°C |
> > | SSD | SYS_THERM7 | 31.0°C | 67.1°C | -36.1°C |
> > | Modem | SYS_THERM4 | N/A | 31.6°C | N/A |
> > | East | SYS_THERM5 | N/A | 70.3°C | N/A |
> >
> > The SSD delta of 36°C is definitely suspicious. I think
> > "ssd"/T14S_EC_SYS_THERM7 in your EC driver patch is actually the modem
> > sensor (SYS_THERM4).
>
> Yes probably, it was unclear from the documentation. I may have mixed some
> info.
>
> The SoC sensor seems to be hotter than the Charging sensor. I'm a bit
> surprised because I've always seen charging hotter than the rest.
>
I captured the above while actively stressing the CPU, so presumably the
SoC was heating up more quickly than the charging in that situation.
Just a few minutes earlier it was like this in idle state with charging
indeed warmer than SoC:
| Sensor | EC (hwmon) | PMIC (thermal) | Delta |
|-----------------|--------------|-----------------|----------|
| SOC | 35.0°C | 35.8°C | -0.8°C |
| Keyboard | 32.0°C | 33.0°C | -1.0°C |
| Base / Back | 33.0°C | 31.9°C | +1.1°C |
| Charging | 37.0°C | 38.2°C | -1.2°C |
| West / QTM | 31.0°C | 35.7°C | -4.7°C |
| SSD | 25.0°C | 34.0°C | -9.0°C |
| Modem | N/A | 26.2°C | N/A |
| East | N/A | 33.1°C | N/A |
>
> > If you look at a picture of the T14s mainboard
> > (https://www.notebookcheck.net/fileadmin/_processed_/d/c/csm_DSC_0003_aadae1ddd2.jpg)
> > and zoom in to the unpopulated modem sub-board left to the fan you can
> > see the two thermistors RT601 and RT301. The SSD on the other hand sits
> > almost directly next to the SoC on the right, so I wouldn't expect it to
> > stay > 30°C cooler than its surroundings.
> >
> > However, there are also two thermistors next to the SSD, see e.g. this
> > close-up picture of the mainboard:
> > https://download.lenovo.com/Images/Parts/5B21P83385/5B21P83385_A.jpg
> > This means that the SSD is probably one of the other mappings. If the
> > thermistors are consecutively numbered in the EC firmware, the SSD
> > (RT8203) might be actually the third sensor ("base"/T14S_EC_SYS_THERM2).
> > I'm not sure how to figure out the proper mapping.
> >
> > The back of the mainboard is completely covered with tape
> > (https://download.lenovo.com/Images/Parts/5B21P83377/5B21P83377_B.jpg)
> > so it's impossible to see anything there.
> >
> > 3. Active vs passive throttling
> >
> > Are you matching the Windows cooling/throttling setup here? If not, have
> > you considered how this interacts with the fan control applied by the
> > EC? I'm a bit worried that this might lead to unexpected performance
> > regressions if we start throttling before the EC runs the fan at full
> > speed.
>
> For the moment, I would say fixing the critical issue is the highest
> priority. With the 'charging' sensor with a 55°C trip point, AFAICT the fan
> is at full speed before this trip is reached.
Agreed.
I'm not sure about the fan speed, I never checked properly but my gut
feeling is that the fan runs faster in Windows and never runs full speed
in Linux. (Are there fan profiles maybe? Not sure. Maybe I'm imagining
it. :-))
>
> Then we may want to take control of the fan and add active trip and passive
> trip.
>
> This autonomous EC / PMIC mix sounds a bit strange to me :/
>
Right, it's all quite complicated. :/ Ideally, we would be able to
figure out the exact thresholds for the fan control in the EC firmware,
so that we can set the throttling temperature to be shortly above that..
Thanks,
Stephan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v6 0/3] Lenovo ThinkPad T14s EC thermal monitoring and thermal zone integration
2026-07-08 13:39 ` Stephan Gerhold
@ 2026-07-08 14:09 ` Daniel Lezcano
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2026-07-08 14:09 UTC (permalink / raw)
To: Stephan Gerhold
Cc: sre, hansg, ilpo.jarvinen, linux, andersson, konradybcio, robh,
krzk+dt, conor+dt, bryan.odonoghue, platform-driver-x86,
linux-kernel, linux-hwmon, linux-arm-msm, devicetree,
neil.armstrong, gaurav.kohli, manaf.pallikunhi, priyansh.jain
On 7/8/26 15:39, Stephan Gerhold wrote:
> On Wed, Jul 08, 2026 at 03:16:20PM +0200, Daniel Lezcano wrote:
>> On 7/8/26 14:03, Stephan Gerhold wrote:
>>> On Tue, Jul 07, 2026 at 09:22:25PM +0200, Daniel Lezcano wrote:
>>>> This series extends the Lenovo ThinkPad T14s embedded controller driver
>>>> with environmental monitoring capabilities and integrates the exposed
>>>> sensors into the Linux thermal framework.
>>>>
>>>> The EC provides access to several platform temperature sensors
>>>> covering the SoC, keyboard area, bottom cover, charging circuitry, QTM
>>>> module and SSD. These sensors are currently used by the firmware for
>>>> thermal management but are not exposed to Linux.
>>>>
>>>> The first patch adds hwmon support for the EC temperature sensors.
>>>>
>>>> The second patch exposes the EC as a thermal sensor provider in the
>>>> device tree and defines thermal zones for the keyboard skin
>>>> temperature and the charging circuitry temperature. This allows the
>>>> generic thermal framework to react to EC-reported temperatures and
>>>> apply standard Linux thermal mitigation policies.
>>>>
>>>> As the EC protocol is not fully decoded, the passive trip points
>>>> get/set actions are missing, so it is not possible to program a
>>>> threshold and receive an interrupt when crossed the way up or
>>>> down. Consequently, the thermal zone related to the charging circuitry
>>>> is polled every two seconds until we can set the trip points in the
>>>> EC.
>>>>
>>>> This series fixes critical thermal issues happening on this platform
>>>> where a kernel compilation, or heavy workloads, lead to a system
>>>> reboot.
>>>>
>>>
>>> Thanks for working on this! I have a few comments/questions about this:
>>
>> Thanks for jumping in the discussion
>>
>>> 1. EC vs PMIC temperature sensors
>>>
>>> AFAIK, the T14s (and actually most X1E laptops) have two sets of
>>> thermistors in each location: One is connected to the PMIC (called
>>> SYS_THERMx), and the other set is connected to the EC.
>>
>> From the schematics I have in my possession, the SYS_THERMx are connected to
>> the EC, at least this is how they are named. May be it is the other set with
>> different numbers.
>>
>> I'm curious to know why this mirroring ?
>>
>
> AFAICT the SYS_THERMx thermistors all go to the PMC838C PMIC on the
> T14s. The EC thermistors are on a separate page, search for "RT8203" for
> example.
>
> I'm not sure why this mirroring exists, but even QC's Hamoa/X1E CRD has
> that. IIRC it is not always there though, the Purwa/X1P CRD has the
> sensors only connected to the EC (maybe for some minor cost savings?).
>
> I believe on some devices the OS (Windows/Linux) even needs to send
> temperatures (e.g. CPU/GPU temperature) to the EC for it to work
> correctly. Not sure if the T14s needs/uses that though. I was mostly
> looking at the CRD thermal setup a year ago...
>
>>> The SYS_THERMx sensors connected to the PMIC have been enabled for the
>>> T14s already over a year ago [1]. The reason this is not upstream is
>>> that we now been waiting 3 years for the corresponding ADC/thermal code
>>> to land upstream [2]. It seems pretty close now, the ADC part has landed
>>> and there is only the thermal part left [3].
>>
>> Right, I have to pick this one.
>>
>>> The PMIC thermistor setup is likely going to be similar for most X1E
>>> laptops, so I think it would be preferable to use that instead of the EC
>>> sensors to implement additional temperature throttling. It also supports
>>> interrupts/trip points already, so it doesn't need polling.
>>
>> I definitively second that
>>
>>> The most recent proposed patch actually adds the SYS_THERMx thermal
>>> zones to all X1E-based devices [4], although I'm not sure if it would be
>>> better to keep that device-specific...
>>>
>>> [1]: https://github.com/stephan-gh/linux/commit/c0ddc9fa96667d6b32d690ce6a3dcfc76aaabad6
>>> [2]: https://lore.kernel.org/linux-arm-msm/20230708072835.3035398-1-quic_jprakash@quicinc.com/
>>> [3]: https://lore.kernel.org/linux-arm-msm/20260705-gen3_adc_tm-v3-0-ac62f387dbce@oss.qualcomm.com/
>>> [4]: https://lore.kernel.org/linux-arm-msm/20260614-adc5_gen3_dt-v2-4-32ec576c5865@oss.qualcomm.com/
>>>
>>> 2. EC sensor mapping vs PMIC sensor mapping
>>>
>>> In PATCH 2/3 you define:
>>>
>>> { .label = "soc", .reg = T14S_EC_SYS_THERM0 },
>>> { .label = "keyboard", .reg = T14S_EC_SYS_THERM1 },
>>> { .label = "base", .reg = T14S_EC_SYS_THERM2 },
>>> { .label = "charging", .reg = T14S_EC_SYS_THERM3 },
>>> { .label = "qtm", .reg = T14S_EC_SYS_THERM6 },
>>> { .label = "ssd", .reg = T14S_EC_SYS_THERM7 },
>>>
>>> I'm not sure if this is correct. When comparing this with the data read
>>> from the sensors connected to the PMIC:
>>>
>>> | Sensor | PMIC Channel | EC (hwmon) | PMIC (thermal) | Delta |
>>> |-----------------|--------------|--------------|-----------------|----------|
>>> | SOC | SYS_THERM0 | 79.0°C | 78.7°C | +0.3°C |
>>> | Keyboard | SYS_THERM1 | 68.0°C | 70.1°C | -2.1°C |
>>> | Base / Back | SYS_THERM2 | 66.0°C | 64.6°C | +1.4°C |
>>> | Charging | SYS_THERM3 | 73.0°C | 73.8°C | -0.8°C |
>>> | West / QTM | SYS_THERM6 | 64.0°C | 62.6°C | +1.4°C |
>>> | SSD | SYS_THERM7 | 31.0°C | 67.1°C | -36.1°C |
>>> | Modem | SYS_THERM4 | N/A | 31.6°C | N/A |
>>> | East | SYS_THERM5 | N/A | 70.3°C | N/A |
>>>
>>> The SSD delta of 36°C is definitely suspicious. I think
>>> "ssd"/T14S_EC_SYS_THERM7 in your EC driver patch is actually the modem
>>> sensor (SYS_THERM4).
>>
>> Yes probably, it was unclear from the documentation. I may have mixed some
>> info.
>>
>> The SoC sensor seems to be hotter than the Charging sensor. I'm a bit
>> surprised because I've always seen charging hotter than the rest.
>>
>
> I captured the above while actively stressing the CPU, so presumably the
> SoC was heating up more quickly than the charging in that situation.
> Just a few minutes earlier it was like this in idle state with charging
> indeed warmer than SoC:
>
> | Sensor | EC (hwmon) | PMIC (thermal) | Delta |
> |-----------------|--------------|-----------------|----------|
> | SOC | 35.0°C | 35.8°C | -0.8°C |
> | Keyboard | 32.0°C | 33.0°C | -1.0°C |
> | Base / Back | 33.0°C | 31.9°C | +1.1°C |
> | Charging | 37.0°C | 38.2°C | -1.2°C |
> | West / QTM | 31.0°C | 35.7°C | -4.7°C |
> | SSD | 25.0°C | 34.0°C | -9.0°C |
> | Modem | N/A | 26.2°C | N/A |
> | East | N/A | 33.1°C | N/A |
>
>>
>>> If you look at a picture of the T14s mainboard
>>> (https://www.notebookcheck.net/fileadmin/_processed_/d/c/csm_DSC_0003_aadae1ddd2.jpg)
>>> and zoom in to the unpopulated modem sub-board left to the fan you can
>>> see the two thermistors RT601 and RT301. The SSD on the other hand sits
>>> almost directly next to the SoC on the right, so I wouldn't expect it to
>>> stay > 30°C cooler than its surroundings.
>>>
>>> However, there are also two thermistors next to the SSD, see e.g. this
>>> close-up picture of the mainboard:
>>> https://download.lenovo.com/Images/Parts/5B21P83385/5B21P83385_A.jpg
>>> This means that the SSD is probably one of the other mappings. If the
>>> thermistors are consecutively numbered in the EC firmware, the SSD
>>> (RT8203) might be actually the third sensor ("base"/T14S_EC_SYS_THERM2).
>>> I'm not sure how to figure out the proper mapping.
>>>
>>> The back of the mainboard is completely covered with tape
>>> (https://download.lenovo.com/Images/Parts/5B21P83377/5B21P83377_B.jpg)
>>> so it's impossible to see anything there.
>>>
>>> 3. Active vs passive throttling
>>>
>>> Are you matching the Windows cooling/throttling setup here? If not, have
>>> you considered how this interacts with the fan control applied by the
>>> EC? I'm a bit worried that this might lead to unexpected performance
>>> regressions if we start throttling before the EC runs the fan at full
>>> speed.
>>
>> For the moment, I would say fixing the critical issue is the highest
>> priority. With the 'charging' sensor with a 55°C trip point, AFAICT the fan
>> is at full speed before this trip is reached.
>
> Agreed.
>
> I'm not sure about the fan speed, I never checked properly but my gut
> feeling is that the fan runs faster in Windows and never runs full speed
> in Linux. (Are there fan profiles maybe? Not sure. Maybe I'm imagining
> it. :-))
When I did some tests with the EC and the fan rpm count, it reports a
constant augmentation of RPM up to 3600 when starting a CPU workload. So
I guess 3600 is the max but may be it can go above. I don't know.
Or Windows has control of the fan and is more aggressive by going to
3600 RPM more often so giving the illusion it turns faster.
Without technical details, it is hard to say.
>> Then we may want to take control of the fan and add active trip and passive
>> trip.
>>
>> This autonomous EC / PMIC mix sounds a bit strange to me :/
>>
>
> Right, it's all quite complicated. :/ Ideally, we would be able to
> figure out the exact thresholds for the fan control in the EC firmware,
> so that we can set the throttling temperature to be shortly above that..
Perhaps, with a dual boot Windows / Linux, we can read the i2c transfer
between windows and the EC to figure it out. Unfortunately, I don't have
enough bandwidth to investigate that now
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-07-08 14:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 19:22 [PATCH v6 0/3] Lenovo ThinkPad T14s EC thermal monitoring and thermal zone integration Daniel Lezcano
-- strict thread matches above, loose matches on Subject: below --
2026-07-07 19:22 Daniel Lezcano
2026-07-08 12:03 ` Stephan Gerhold
2026-07-08 13:16 ` Daniel Lezcano
2026-07-08 13:39 ` Stephan Gerhold
2026-07-08 14:09 ` Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox