]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ACPICA: Detect FACS in reduced hardware build
authorJiaqing Zhao <jiaqing.zhao@linux.intel.com>
Tue, 27 Aug 2024 02:58:20 +0000 (02:58 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 29 Aug 2024 12:40:28 +0000 (14:40 +0200)
According to Section 5.2.10 of ACPI Specification, FACS is optional
in reduced hardware model. Enable the detection for "Hardware-reduced
ACPI support only" build (CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y) also.

Link: https://github.com/acpica/acpica/commit/ee53ed6b5452612bb44af542b68d605f8b2b1104
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Link: https://patch.msgid.link/20240827025821.2099068-2-jiaqing.zhao@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/acglobal.h
drivers/acpi/acpica/tbutils.c
drivers/acpi/acpica/utxfinit.c
include/acpi/acconfig.h

index f4c90fc99be2fbd8eb3d626e6c253e3b9b22adc4..309ce8efb4f684e4d9dd73964242d9ef442a2dfe 100644 (file)
@@ -29,11 +29,7 @@ ACPI_INIT_GLOBAL(u32, acpi_gbl_dsdt_index, ACPI_INVALID_TABLE_INDEX);
 ACPI_INIT_GLOBAL(u32, acpi_gbl_facs_index, ACPI_INVALID_TABLE_INDEX);
 ACPI_INIT_GLOBAL(u32, acpi_gbl_xfacs_index, ACPI_INVALID_TABLE_INDEX);
 ACPI_INIT_GLOBAL(u32, acpi_gbl_fadt_index, ACPI_INVALID_TABLE_INDEX);
-
-#if (!ACPI_REDUCED_HARDWARE)
-ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS);
-
-#endif                         /* !ACPI_REDUCED_HARDWARE */
+ACPI_INIT_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS, NULL);
 
 /* These addresses are calculated from the FADT Event Block addresses */
 
index 15fa68a5ea6e25b7160bbf40b8c085bf3aa865b2..dad7425fce3f103c05d04803e5545dcb1f79a223 100644 (file)
@@ -18,7 +18,6 @@ ACPI_MODULE_NAME("tbutils")
 static acpi_physical_address
 acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size);
 
-#if (!ACPI_REDUCED_HARDWARE)
 /*******************************************************************************
  *
  * FUNCTION:    acpi_tb_initialize_facs
@@ -56,7 +55,6 @@ acpi_status acpi_tb_initialize_facs(void)
 
        return (AE_OK);
 }
-#endif                         /* !ACPI_REDUCED_HARDWARE */
 
 /*******************************************************************************
  *
index 1915bec2b2799348287f09cebbf277c1f2f83903..70ae0afa793952f63fdf89dbc9827ecfc88c7ab6 100644 (file)
@@ -120,6 +120,18 @@ acpi_status ACPI_INIT_FUNCTION acpi_enable_subsystem(u32 flags)
         */
        acpi_gbl_early_initialization = FALSE;
 
+       /*
+        * Obtain a permanent mapping for the FACS. This is required for the
+        * Global Lock and the Firmware Waking Vector
+        */
+       if (!(flags & ACPI_NO_FACS_INIT)) {
+               status = acpi_tb_initialize_facs();
+               if (ACPI_FAILURE(status)) {
+                       ACPI_WARNING((AE_INFO, "Could not map the FACS table"));
+                       return_ACPI_STATUS(status);
+               }
+       }
+
 #if (!ACPI_REDUCED_HARDWARE)
 
        /* Enable ACPI mode */
@@ -137,18 +149,6 @@ acpi_status ACPI_INIT_FUNCTION acpi_enable_subsystem(u32 flags)
                }
        }
 
-       /*
-        * Obtain a permanent mapping for the FACS. This is required for the
-        * Global Lock and the Firmware Waking Vector
-        */
-       if (!(flags & ACPI_NO_FACS_INIT)) {
-               status = acpi_tb_initialize_facs();
-               if (ACPI_FAILURE(status)) {
-                       ACPI_WARNING((AE_INFO, "Could not map the FACS table"));
-                       return_ACPI_STATUS(status);
-               }
-       }
-
        /*
         * Initialize ACPI Event handling (Fixed and General Purpose)
         *
index d768d9c568cfbe23da03f4bb04d832fbad52cb9a..2da5f4a6e8147c1f6c030730d1c773f40ebd9de7 100644 (file)
@@ -67,7 +67,6 @@
  *      General Purpose Events (GPEs)
  *      Global Lock
  *      ACPI PM timer
- *      FACS table (Waking vectors and Global Lock)
  */
 #ifndef ACPI_REDUCED_HARDWARE
 #define ACPI_REDUCED_HARDWARE           FALSE