Commit 8636f8d2 authored by Bob Moore's avatar Bob Moore Committed by Len Brown

ACPICA: Change handling of PM1 Status register ignored bit

Ignored bits must be preserved according to the ACPI spec.
Usually this means a read/modify/write when writing to the
register.  However, for status registers, writing a one means
clear the event.  Writing a zero means preserve the event (do not
clear.) This behavior is clarified in the ACPI 4.0 spec, and the
ACPICA code now simply always writes a zero to the ignored bit.
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 8a335a23
...@@ -273,22 +273,17 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value) ...@@ -273,22 +273,17 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
switch (register_id) { switch (register_id) {
case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */ case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
/*
/* Perform a read first to preserve certain bits (per ACPI spec) */ * Handle the "ignored" bit in PM1 Status. According to the ACPI
* specification, ignored bits are to be preserved when writing.
status = acpi_hw_read_multiple(&read_value, * Normally, this would mean a read/modify/write sequence. However,
&acpi_gbl_xpm1a_status, * preserving a bit in the status register is different. Writing a
&acpi_gbl_xpm1b_status); * one clears the status, and writing a zero preserves the status.
if (ACPI_FAILURE(status)) { * Therefore, we must always write zero to the ignored bit.
goto exit; *
} * This behavior is clarified in the ACPI 4.0 specification.
*/
/* Insert the bits to be preserved */ value &= ~ACPI_PM1_STATUS_PRESERVED_BITS;
ACPI_INSERT_BITS(value, ACPI_PM1_STATUS_PRESERVED_BITS,
read_value);
/* Now we can write the data */
status = acpi_hw_write_multiple(value, status = acpi_hw_write_multiple(value,
&acpi_gbl_xpm1a_status, &acpi_gbl_xpm1a_status,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment