aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2011-02-14 02:50:42 -0500
committerLen Brown <len.brown@intel.com>2011-03-02 19:38:03 -0500
commit64b3db22c04586997ab4be46dd5a5b99f8a2d390 (patch)
treee0642436efe91c824d84383cba3e8fc906c4a2d0
parent6dfad339645247c9deb553e4d68e21211ddc61bd (diff)
ACPICA: Remove use of unreliable FADT revision field
The revision number in the FADT has been found to be completely unreliable and cannot be trusted. Only the table length can be used to infer the actual version. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/acpica/tbfadt.c5
-rw-r--r--include/acpi/actbl.h16
2 files changed, 20 insertions, 1 deletions
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 428d44e2d162..6f5588e62c0a 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -384,8 +384,11 @@ static void acpi_tb_convert_fadt(void)
384 * 384 *
385 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located at 385 * The ACPI 1.0 reserved fields that will be zeroed are the bytes located at
386 * offset 45, 55, 95, and the word located at offset 109, 110. 386 * offset 45, 55, 95, and the word located at offset 109, 110.
387 *
388 * Note: The FADT revision value is unreliable. Only the length can be
389 * trusted.
387 */ 390 */
388 if (acpi_gbl_FADT.header.revision < FADT2_REVISION_ID) { 391 if (acpi_gbl_FADT.header.length <= ACPI_FADT_V2_SIZE) {
389 acpi_gbl_FADT.preferred_profile = 0; 392 acpi_gbl_FADT.preferred_profile = 0;
390 acpi_gbl_FADT.pstate_control = 0; 393 acpi_gbl_FADT.pstate_control = 0;
391 acpi_gbl_FADT.cst_control = 0; 394 acpi_gbl_FADT.cst_control = 0;
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 7e42bfee0e29..d41c94885211 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -343,4 +343,20 @@ struct acpi_table_desc {
343#include <acpi/actbl1.h> 343#include <acpi/actbl1.h>
344#include <acpi/actbl2.h> 344#include <acpi/actbl2.h>
345 345
346/*
347 * Sizes of the various flavors of FADT. We need to look closely
348 * at the FADT length because the version number essentially tells
349 * us nothing because of many BIOS bugs where the version does not
350 * match the expected length. In other words, the length of the
351 * FADT is the bottom line as to what the version really is.
352 *
353 * For reference, the values below are as follows:
354 * FADT V1 size: 0x74
355 * FADT V2 size: 0x84
356 * FADT V3+ size: 0xF4
357 */
358#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4)
359#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3)
360#define ACPI_FADT_V3_SIZE (u32) (sizeof (struct acpi_table_fadt))
361
346#endif /* __ACTBL_H__ */ 362#endif /* __ACTBL_H__ */