From: Bob Moore Date: Mon, 9 Mar 2009 08:32:20 +0000 (+0800) Subject: ACPICA: Change handling of PM1 Status register ignored bit X-Git-Tag: Ubuntu-5.2.0-15.16~30034^2~39 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=8636f8d257b3edf5a1529df93119cdc630ed85c7;p=mirror_ubuntu-eoan-kernel.git 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: Bob Moore Signed-off-by: Lin Ming Signed-off-by: Len Brown --- diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c index edc627c9fc0d..fd7abe277db3 100644 --- a/drivers/acpi/acpica/hwregs.c +++ b/drivers/acpi/acpica/hwregs.c @@ -273,22 +273,17 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value) switch (register_id) { case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */ - - /* Perform a read first to preserve certain bits (per ACPI spec) */ - - status = acpi_hw_read_multiple(&read_value, - &acpi_gbl_xpm1a_status, - &acpi_gbl_xpm1b_status); - if (ACPI_FAILURE(status)) { - goto exit; - } - - /* Insert the bits to be preserved */ - - ACPI_INSERT_BITS(value, ACPI_PM1_STATUS_PRESERVED_BITS, - read_value); - - /* Now we can write the data */ + /* + * Handle the "ignored" bit in PM1 Status. According to the ACPI + * specification, ignored bits are to be preserved when writing. + * Normally, this would mean a read/modify/write sequence. However, + * preserving a bit in the status register is different. Writing a + * one clears the status, and writing a zero preserves the status. + * Therefore, we must always write zero to the ignored bit. + * + * This behavior is clarified in the ACPI 4.0 specification. + */ + value &= ~ACPI_PM1_STATUS_PRESERVED_BITS; status = acpi_hw_write_multiple(value, &acpi_gbl_xpm1a_status,