ACPICA: Preserve all PM control reserved and ignored bits
authorBob Moore <robert.moore@intel.com>
Fri, 13 Mar 2009 01:10:46 +0000 (09:10 +0800)
committerLen Brown <len.brown@intel.com>
Fri, 27 Mar 2009 16:11:03 +0000 (12:11 -0400)
As per the ACPI specification, preserve (read/modify/write) all
bits that are defined as either reserved or ignored (PM control
control registers only.)

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>
drivers/acpi/acpica/aclocal.h
drivers/acpi/acpica/hwregs.c

index 18a8d96eaa49b1dc5fd986b86a7670a3a418c57e..f01e155b2bccd818de223846eff15ccce92643b2 100644 (file)
@@ -780,7 +780,15 @@ struct acpi_bit_register_info {
  * must be preserved.
  */
 #define ACPI_PM1_STATUS_PRESERVED_BITS          0x0800 /* Bit 11 */
-#define ACPI_PM1_CONTROL_PRESERVED_BITS         0x0200 /* Bit 9 (whatever) */
+
+/* For control registers, both ignored and reserved bits must be preserved */
+
+#define ACPI_PM1_CONTROL_IGNORED_BITS           0x0201 /* Bits 9, 0(SCI_EN) */
+#define ACPI_PM1_CONTROL_RESERVED_BITS          0xC1F8 /* Bits 14-15, 3-8 */
+#define ACPI_PM1_CONTROL_PRESERVED_BITS \
+              (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
+
+#define ACPI_PM2_CONTROL_PRESERVED_BITS         0xFFFFFFFE     /* All except bit 0 */
 
 /*
  * Register IDs
index fd7abe277db3021c23b94dd1f9823c61fdc9c09b..611736266f9f5516456dfc090d0862dc4321efdd 100644 (file)
@@ -328,6 +328,21 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
 
        case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
 
+               /*
+                * For control registers, all reserved bits must be preserved,
+                * as per the ACPI spec.
+                */
+               status =
+                   acpi_read(&read_value, &acpi_gbl_FADT.xpm2_control_block);
+               if (ACPI_FAILURE(status)) {
+                       goto exit;
+               }
+
+               /* Insert the bits to be preserved */
+
+               ACPI_INSERT_BITS(value, ACPI_PM2_CONTROL_PRESERVED_BITS,
+                                read_value);
+
                status = acpi_write(value, &acpi_gbl_FADT.xpm2_control_block);
                break;