mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
ACPI: battery: Evaluate battery methods exclusively
On ThinkPad P1 Gen2 and P53, INT3403 _TMP switches the EC page selector without taking the AML mutex the battery methods use, so _BIX and _BST running at the same time can read the wrong page. Since commitd33e89d122("thermal: core: Suspend thermal zones later and resume them earlier") this happens on most resumes. Evaluate the battery methods with acpi_evaluate_object_exclusive(). 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-3-aliamemis@disroot.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
80892972ff
commit
645f370c93
|
|
@ -647,9 +647,8 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
|
|||
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
|
||||
acpi_status status = AE_ERROR;
|
||||
|
||||
status = acpi_evaluate_object(battery->device->handle,
|
||||
use_bix ? "_BIX":"_BIF",
|
||||
NULL, &buffer);
|
||||
status = acpi_evaluate_object_exclusive(battery->device->handle,
|
||||
use_bix ? "_BIX" : "_BIF", NULL, &buffer);
|
||||
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_handle_info(battery->device->handle,
|
||||
|
|
@ -688,8 +687,7 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
|
|||
msecs_to_jiffies(cache_time)))
|
||||
return 0;
|
||||
|
||||
status = acpi_evaluate_object(battery->device->handle, "_BST",
|
||||
NULL, &buffer);
|
||||
status = acpi_evaluate_object_exclusive(battery->device->handle, "_BST", NULL, &buffer);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_handle_info(battery->device->handle,
|
||||
"_BST evaluation failed: %s",
|
||||
|
|
@ -739,8 +737,8 @@ static int acpi_battery_set_alarm(struct acpi_battery *battery)
|
|||
!test_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags))
|
||||
return -ENODEV;
|
||||
|
||||
status = acpi_execute_simple_method(battery->device->handle, "_BTP",
|
||||
battery->alarm);
|
||||
status = acpi_execute_simple_method_exclusive(battery->device->handle, "_BTP",
|
||||
battery->alarm);
|
||||
if (ACPI_FAILURE(status))
|
||||
return -ENODEV;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user