summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2022-03-25 09:37:10 -0700
committerGitHub <noreply@github.com>2022-03-25 09:37:10 -0700
commitb3c9e44f1ee3cd113d939012ac03cb2daa899422 (patch)
tree3dffbbbb31a5000afe11b9428188539a9b7e4fdd
parentc7b6dd94b19ec1fcc4d6eba156a283ab414a39b2 (diff)
parent2a0d1d475e7ea1c815bee1e0692d81db9a7c909c (diff)
downloadacpica-b3c9e44f1ee3cd113d939012ac03cb2daa899422.tar.gz
Merge pull request #754 from paulmenzel/warn-about-long-delays
Warn about long delays
-rw-r--r--source/components/executer/exsystem.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/source/components/executer/exsystem.c b/source/components/executer/exsystem.c
index 9e1e530a4..0a6d33c16 100644
--- a/source/components/executer/exsystem.c
+++ b/source/components/executer/exsystem.c
@@ -265,7 +265,7 @@ AcpiExSystemWaitMutex (
*
* FUNCTION: AcpiExSystemDoStall
*
- * PARAMETERS: HowLong - The amount of time to stall,
+ * PARAMETERS: HowLongUs - The amount of time to stall,
* in microseconds
*
* RETURN: Status
@@ -280,7 +280,7 @@ AcpiExSystemWaitMutex (
ACPI_STATUS
AcpiExSystemDoStall (
- UINT32 HowLong)
+ UINT32 HowLongUs)
{
ACPI_STATUS Status = AE_OK;
@@ -288,21 +288,26 @@ AcpiExSystemDoStall (
ACPI_FUNCTION_ENTRY ();
- if (HowLong > 255) /* 255 microseconds */
+ if (HowLongUs > 255)
{
/*
- * Longer than 255 usec, this is an error
+ * Longer than 255 microseconds, this is an error
*
* (ACPI specifies 100 usec as max, but this gives some slack in
* order to support existing BIOSs)
*/
ACPI_ERROR ((AE_INFO,
- "Time parameter is too large (%u)", HowLong));
+ "Time parameter is too large (%u)", HowLongUs));
Status = AE_AML_OPERAND_VALUE;
}
else
{
- AcpiOsStall (HowLong);
+ if (HowLongUS > 100)
+ {
+ ACPI_WARNING ((AE_INFO,
+ "Time parameter %u us > 100 us violating ACPI spec, please fix the firmware.", HowLongUs));
+ }
+ AcpiOsStall (HowLongUs);
}
return (Status);
@@ -313,7 +318,7 @@ AcpiExSystemDoStall (
*
* FUNCTION: AcpiExSystemDoSleep
*
- * PARAMETERS: HowLong - The amount of time to sleep,
+ * PARAMETERS: HowLongMs - The amount of time to sleep,
* in milliseconds
*
* RETURN: None
@@ -324,7 +329,7 @@ AcpiExSystemDoStall (
ACPI_STATUS
AcpiExSystemDoSleep (
- UINT64 HowLong)
+ UINT64 HowLongMs)
{
ACPI_FUNCTION_ENTRY ();
@@ -334,15 +339,25 @@ AcpiExSystemDoSleep (
AcpiExExitInterpreter ();
/*
+ * Warn users about excessive sleep times, so ASL code can be improved to
+ * use polling or similar techniques.
+ */
+ if (HowLongMs > 10)
+ {
+ ACPI_WARNING ((AE_INFO,
+ "Firmware issue: Excessive sleep time (%llu ms > 10 ms) in ACPI Control Method", HowLongUs));
+ }
+
+ /*
* For compatibility with other ACPI implementations and to prevent
* accidental deep sleeps, limit the sleep time to something reasonable.
*/
- if (HowLong > ACPI_MAX_SLEEP)
+ if (HowLongMs > ACPI_MAX_SLEEP)
{
- HowLong = ACPI_MAX_SLEEP;
+ HowLongMs = ACPI_MAX_SLEEP;
}
- AcpiOsSleep (HowLong);
+ AcpiOsSleep (HowLongMs);
/* And now we must get the interpreter again */