mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
thermal: intel: int340x: Evaluate _TMP exclusively
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(), also where int3403 and processor_thermal probe for it. Fixes:d33e89d122("thermal: core: Suspend thermal zones later and resume them earlier") Reported-by: Charis Stratakis <c.stratakis@proton.me> Closes: https://lore.kernel.org/all/37N_jFulf7n-Z55NfKfE71C_wVPxYvZ0xD_iRUg2fXu7TypDiF5PStQ6siSfVBih6fThg5WoPes8U5ZQpfVm_teMFcUGXFxz2DdMbfSWuws=@proton.me/ Cc: All applicable <stable@vger.kernel.org> #80892972ffACPI: utils: Add exclusive AML evaluation helpers Signed-off-by: Ali Ahmet Memiş <aliamemis@disroot.org> Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Reviewed-by: Rong Zhang <i@rong.moe> Link: https://patch.msgid.link/20261018122220.678822-4-aliamemis@disroot.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
645f370c93
commit
c4aae727be
|
|
@ -217,8 +217,7 @@ static int int3403_add(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
|
||||
status = acpi_evaluate_integer(priv->adev->handle, "_TMP",
|
||||
NULL, &tmp);
|
||||
status = acpi_evaluate_integer_exclusive(priv->adev->handle, "_TMP", NULL, &tmp);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
status = acpi_evaluate_integer(priv->adev->handle, "PTYP",
|
||||
NULL, &priv->type);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@ 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;
|
||||
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ int proc_thermal_add(struct device *dev, struct proc_thermal_device *proc_priv)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
status = acpi_evaluate_integer(adev->handle, "_TMP", NULL, &tmp);
|
||||
status = acpi_evaluate_integer_exclusive(adev->handle, "_TMP", NULL, &tmp);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
/* there is no _TMP method, add local method */
|
||||
if (intel_tcc_get_tjmax(-1) > 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user