[PATCH 14/20] ACPICA: executer/exsystem: Inform users about ACPI spec violation

From: Rafael J. Wysocki
Date: Mon Apr 11 2022 - 15:04:52 EST


From: Paul Menzel <pmenzel@xxxxxxxxxxxxx>

ACPICA commit 05ba545ce7859392250b18c10081db25c90ed8d7

Values greater than 100 microseconds violate the ACPI specification, so
warn users about it.

>From ACPI Specification version 6.2 Errata A, 19.6.128 *Stall (Stall for
a Short Time)*:

> The implementation of Stall is OS-specific, but must not relinquish
> control of the processor. Because of this, delays longer than 100
> microseconds must use Sleep instead of Stall.

Link: https://github.com/acpica/acpica/commit/05ba545c
Signed-off-by: Bob Moore <robert.moore@xxxxxxxxx>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
---
exsystem.c | 5 +++++
1 file changed, 5 insertions(+)

diff -Nurp linux.before_name/drivers/acpi/acpica/exsystem.c linux.after_name/drivers/acpi/acpica/exsystem.c
--- linux.before_name/drivers/acpi/acpica/exsystem.c 2022-04-01 18:26:39.407241333 +0200
+++ linux.after_name/drivers/acpi/acpica/exsystem.c 2022-04-01 18:26:35.905285106 +0200
@@ -137,6 +137,11 @@ acpi_status acpi_ex_system_do_stall(u32
"Time parameter is too large (%u)", how_long_us));
status = AE_AML_OPERAND_VALUE;
} else {
+ if (how_long_US > 100) {
+ ACPI_WARNING((AE_INFO,
+ "Time parameter %u us > 100 us violating ACPI spec, please fix the firmware.",
+ how_long_us));
+ }
acpi_os_stall(how_long_us);
}