Patchwork fwts: patch for fwts - fadt

login
register
mail settings
Submitter AceLan Kao
Date Sept. 1, 2010, 7:37 a.m.
Message ID <AANLkTinbFyZtf=9=7qbMsutGLqD8qr_OgDhVZKRgbn-7@mail.gmail.com>
Download mbox | patch
Permalink /patch/63351/
State Accepted
Delegated to: Colin King
Headers show

Comments

AceLan Kao - Sept. 1, 2010, 7:37 a.m.
Hi,

I found that FADT test always fails, so I do a small study.
The table name of FADT is not "FADT" actually, it's "FACP",
so the patch is quite simple to rename it.

And one more thing about FADT.
After disassembling the FADT, there 2 interesting items
C2 Latency : 0065
C3 Latency : 03E9
Those two value means if BIOS allow the CPU enter C2 or C3 state.
C2 smaller than 100(0x64), and C3 smaller than 1000(0x3E8) means allow
or BIOS will block the change of CPU state.

Best regards,
AceLan Kao.

Patch

From 470e3aea1ea0a12e58ecdb0cb903cd9b0d0900aa Mon Sep 17 00:00:00 2001
From: AceLan Kao <acelan.kao@canonical.com>
Date: Wed, 1 Sep 2010 14:53:33 +0800
Subject: [PATCH] fadt: The FADT table name is not FADT, it's FACP

The name of FADT table in the /sys/firmware/acpi/tables/
is not "FADT", it's "FACP". The "FADT" name only exists
in /proc/acpi/

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
---
 src/acpi/fadt/fadt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
index e0d60ee..768951b 100644
--- a/src/acpi/fadt/fadt.c
+++ b/src/acpi/fadt/fadt.c
@@ -161,7 +161,7 @@  static int fadt_init(fwts_framework *fw)
 	if (fwts_check_root_euid(fw))
 		return FWTS_ERROR;
 
-	if ((fadt_table = fwts_acpi_table_load(fw, "FADT", 0, &fadt_size)) == NULL) {
+	if ((fadt_table = fwts_acpi_table_load(fw, "FACP", 0, &fadt_size)) == NULL) {
 		fwts_log_error(fw, "Failed to read ACPI FADT");
 		return FWTS_ERROR;
 	}
-- 
1.7.1