Re: [PATCH 3/3] thermal: intel: int340x: Evaluate _TMP exclusively

From: Hans de Goede

Date: Wed Oct 14 2026 - 10:47:54 EST


Hi,

On 14-Oct-26 15:30, Ali Ahmet Memiş wrote:
> On ThinkPad P1 Gen2 and P53, INT3403 _TMP switches the EC page selector
> without taking the mutex the battery methods use, so it must not run
> interleaved with them.
>
> Evaluate _TMP with acpi_evaluate_integer_exclusive().
>
> Fixes: d33e89d12295 ("thermal: core: Suspend thermal zones later and resume them earlier")
> Reported-by: Charis Stratakis <c.stratakis@xxxxxxxxx>
> Closes: https://lore.kernel.org/all/37N_jFulf7n-Z55NfKfE71C_wVPxYvZ0xD_iRUg2fXu7TypDiF5PStQ6siSfVBih6fThg5WoPes8U5ZQpfVm_teMFcUGXFxz2DdMbfSWuws=@proton.me/
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Ali Ahmet Memiş <aliamemis@xxxxxxxxxxx>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <johannes.goede@xxxxxxxxxxxxxxxx>

Regards,

Hans




> ---
> .../thermal/intel/int340x_thermal/int340x_thermal_zone.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
> index 965700ee6962..de0a1fc7b817 100644
> --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
> +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
> @@ -18,7 +18,12 @@ static int int340x_thermal_get_zone_temp(struct thermal_zone_device *zone,
> unsigned long long tmp;
> acpi_status status;
>
> - status = acpi_evaluate_integer(d->adev->handle, "_TMP", NULL, &tmp);
> + /*
> + * On some ThinkPads _TMP switches the EC page selector without
> + * taking the mutex the battery methods use.
> + */
> + status = acpi_evaluate_integer_exclusive(d->adev->handle, "_TMP", NULL,
> + &tmp);
> if (ACPI_FAILURE(status))
> return -EIO;
>