Skip to content

Commit 36b531a

Browse files
jiaqingz-devrafaeljw
authored andcommitted
ACPICA: Detect FACS in reduced hardware build
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: acpica/acpica@ee53ed6 Signed-off-by: Jiaqing Zhao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent a524287 commit 36b531a

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

drivers/acpi/acpica/acglobal.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ ACPI_INIT_GLOBAL(u32, acpi_gbl_dsdt_index, ACPI_INVALID_TABLE_INDEX);
2929
ACPI_INIT_GLOBAL(u32, acpi_gbl_facs_index, ACPI_INVALID_TABLE_INDEX);
3030
ACPI_INIT_GLOBAL(u32, acpi_gbl_xfacs_index, ACPI_INVALID_TABLE_INDEX);
3131
ACPI_INIT_GLOBAL(u32, acpi_gbl_fadt_index, ACPI_INVALID_TABLE_INDEX);
32-
33-
#if (!ACPI_REDUCED_HARDWARE)
34-
ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS);
35-
36-
#endif /* !ACPI_REDUCED_HARDWARE */
32+
ACPI_INIT_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS, NULL);
3733

3834
/* These addresses are calculated from the FADT Event Block addresses */
3935

drivers/acpi/acpica/tbutils.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ ACPI_MODULE_NAME("tbutils")
1818
static acpi_physical_address
1919
acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size);
2020

21-
#if (!ACPI_REDUCED_HARDWARE)
2221
/*******************************************************************************
2322
*
2423
* FUNCTION: acpi_tb_initialize_facs
@@ -56,7 +55,6 @@ acpi_status acpi_tb_initialize_facs(void)
5655

5756
return (AE_OK);
5857
}
59-
#endif /* !ACPI_REDUCED_HARDWARE */
6058

6159
/*******************************************************************************
6260
*

drivers/acpi/acpica/utxfinit.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ acpi_status ACPI_INIT_FUNCTION acpi_enable_subsystem(u32 flags)
120120
*/
121121
acpi_gbl_early_initialization = FALSE;
122122

123+
/*
124+
* Obtain a permanent mapping for the FACS. This is required for the
125+
* Global Lock and the Firmware Waking Vector
126+
*/
127+
if (!(flags & ACPI_NO_FACS_INIT)) {
128+
status = acpi_tb_initialize_facs();
129+
if (ACPI_FAILURE(status)) {
130+
ACPI_WARNING((AE_INFO, "Could not map the FACS table"));
131+
return_ACPI_STATUS(status);
132+
}
133+
}
134+
123135
#if (!ACPI_REDUCED_HARDWARE)
124136

125137
/* Enable ACPI mode */
@@ -137,18 +149,6 @@ acpi_status ACPI_INIT_FUNCTION acpi_enable_subsystem(u32 flags)
137149
}
138150
}
139151

140-
/*
141-
* Obtain a permanent mapping for the FACS. This is required for the
142-
* Global Lock and the Firmware Waking Vector
143-
*/
144-
if (!(flags & ACPI_NO_FACS_INIT)) {
145-
status = acpi_tb_initialize_facs();
146-
if (ACPI_FAILURE(status)) {
147-
ACPI_WARNING((AE_INFO, "Could not map the FACS table"));
148-
return_ACPI_STATUS(status);
149-
}
150-
}
151-
152152
/*
153153
* Initialize ACPI Event handling (Fixed and General Purpose)
154154
*

include/acpi/acconfig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
* General Purpose Events (GPEs)
6868
* Global Lock
6969
* ACPI PM timer
70-
* FACS table (Waking vectors and Global Lock)
7170
*/
7271
#ifndef ACPI_REDUCED_HARDWARE
7372
#define ACPI_REDUCED_HARDWARE FALSE

0 commit comments

Comments
 (0)