[PATCH] acpi: fadt: Fix FACS checking

Jeffrey Hugo jhugo at codeaurora.org
Thu Jan 25 15:04:11 UTC 2018


In case of HW reduced platforms, FIRMWARE_CTRL and X_FIRMWARE_CTRL are
allowed to be 0 in the FADT as a FACS may not be provided.  The FACS
validation which checks these fields does register a success for HW reduced
platforms when the fields are both 0, or registers a failure for non-HW
reduced platforms as FACS is required in that case.  However, the FACS
validation continues with other checks, which can override the previous
success with a failure, causing an invalid test result and confusing output
messages.

We can do better by returning early after validating FIRMWARE_CTRL and
X_FIRMWARE_CTRL are both 0 and the platform is or is not HW reduced as we
have made a definitive pass/fail determination, and further checking is not
warranted.

Signed-off-by: Jeffrey Hugo <jhugo at codeaurora.org>
---
 src/acpi/fadt/fadt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
index 9863566..d18d28c 100644
--- a/src/acpi/fadt/fadt.c
+++ b/src/acpi/fadt/fadt.c
@@ -270,7 +270,8 @@ static void acpi_table_check_fadt_firmware_ctrl(fwts_framework *fw)
 				    "Structure (FACS) when ACPI hardware "
 				    "reduced mode is not set. ");
 		}
-
+		/* We have either passed or failed.  No need to continue */
+		return;
 	}
 
 	if ((fadt->firmware_control != 0 && fadt->x_firmware_ctrl == 0) ||
-- 
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.




More information about the fwts-devel mailing list