aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables/tbfadt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/tables/tbfadt.c')
-rw-r--r--drivers/acpi/tables/tbfadt.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/drivers/acpi/tables/tbfadt.c b/drivers/acpi/tables/tbfadt.c
index ccb5b64bbef3..2c7885e7ffba 100644
--- a/drivers/acpi/tables/tbfadt.c
+++ b/drivers/acpi/tables/tbfadt.c
@@ -50,7 +50,7 @@ ACPI_MODULE_NAME("tbfadt")
50/* Local prototypes */ 50/* Local prototypes */
51static void inline 51static void inline
52acpi_tb_init_generic_address(struct acpi_generic_address *generic_address, 52acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
53 u8 bit_width, u64 address); 53 u8 byte_width, u64 address);
54 54
55static void acpi_tb_convert_fadt(void); 55static void acpi_tb_convert_fadt(void);
56 56
@@ -111,7 +111,7 @@ static struct acpi_fadt_info fadt_info_table[] = {
111 * FUNCTION: acpi_tb_init_generic_address 111 * FUNCTION: acpi_tb_init_generic_address
112 * 112 *
113 * PARAMETERS: generic_address - GAS struct to be initialized 113 * PARAMETERS: generic_address - GAS struct to be initialized
114 * bit_width - Width of this register 114 * byte_width - Width of this register
115 * Address - Address of the register 115 * Address - Address of the register
116 * 116 *
117 * RETURN: None 117 * RETURN: None
@@ -342,12 +342,21 @@ static void acpi_tb_convert_fadt(void)
342 * useful to calculate them once, here. 342 * useful to calculate them once, here.
343 * 343 *
344 * The PM event blocks are split into two register blocks, first is the 344 * The PM event blocks are split into two register blocks, first is the
345 * PM Status Register block, followed immediately by the PM Enable Register 345 * PM Status Register block, followed immediately by the PM Enable
346 * block. Each is of length (xpm1x_event_block.bit_width/2) 346 * Register block. Each is of length (xpm1x_event_block.bit_width/2).
347 *
348 * On various systems the v2 fields (and particularly the bit widths)
349 * cannot be relied upon, though. Hence resort to using the v1 length
350 * here (and warn about the inconsistency).
347 */ 351 */
348 WARN_ON(ACPI_MOD_16(acpi_gbl_FADT.xpm1a_event_block.bit_width)); 352 if (acpi_gbl_FADT.xpm1a_event_block.bit_width
349 pm1_register_length = (u8) ACPI_DIV_16(acpi_gbl_FADT 353 != acpi_gbl_FADT.pm1_event_length * 8)
350 .xpm1a_event_block.bit_width); 354 printk(KERN_WARNING "FADT: "
355 "X_PM1a_EVT_BLK.bit_width (%u) does not match"
356 " PM1_EVT_LEN (%u)\n",
357 acpi_gbl_FADT.xpm1a_event_block.bit_width,
358 acpi_gbl_FADT.pm1_event_length);
359 pm1_register_length = (u8) ACPI_DIV_2(acpi_gbl_FADT.pm1_event_length);
351 360
352 /* The PM1A register block is required */ 361 /* The PM1A register block is required */
353 362
@@ -362,10 +371,13 @@ static void acpi_tb_convert_fadt(void)
362 /* The PM1B register block is optional, ignore if not present */ 371 /* The PM1B register block is optional, ignore if not present */
363 372
364 if (acpi_gbl_FADT.xpm1b_event_block.address) { 373 if (acpi_gbl_FADT.xpm1b_event_block.address) {
365 WARN_ON(ACPI_MOD_16(acpi_gbl_FADT.xpm1b_event_block.bit_width)); 374 if (acpi_gbl_FADT.xpm1b_event_block.bit_width
366 pm1_register_length = (u8) ACPI_DIV_16(acpi_gbl_FADT 375 != acpi_gbl_FADT.pm1_event_length * 8)
367 .xpm1b_event_block 376 printk(KERN_WARNING "FADT: "
368 .bit_width); 377 "X_PM1b_EVT_BLK.bit_width (%u) does not match"
378 " PM1_EVT_LEN (%u)\n",
379 acpi_gbl_FADT.xpm1b_event_block.bit_width,
380 acpi_gbl_FADT.pm1_event_length);
369 acpi_tb_init_generic_address(&acpi_gbl_xpm1b_enable, 381 acpi_tb_init_generic_address(&acpi_gbl_xpm1b_enable,
370 pm1_register_length, 382 pm1_register_length,
371 (acpi_gbl_FADT.xpm1b_event_block. 383 (acpi_gbl_FADT.xpm1b_event_block.
@@ -373,6 +385,7 @@ static void acpi_tb_convert_fadt(void)
373 /* Don't forget to copy space_id of the GAS */ 385 /* Don't forget to copy space_id of the GAS */
374 acpi_gbl_xpm1b_enable.space_id = 386 acpi_gbl_xpm1b_enable.space_id =
375 acpi_gbl_FADT.xpm1b_event_block.space_id; 387 acpi_gbl_FADT.xpm1b_event_block.space_id;
388
376 } 389 }
377} 390}
378 391