Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPICA: Tables: Change table duplication check to be related to acpi_gbl_verify_table_checksum

ACPICA commit 3d837b5d4b1033942b4d91c7d3801a09c3157918

acpi_gbl_verify_table_checksum is used to avoid validating (mapping) an entire
table in OS boot stage. 2nd "Reload" check in acpi_tb_install_standard_table()
is prepared for the same purpose. So this patch combines them together
using a renamed acpi_gbl_enable_table_validation flag. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/3d837b5d
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Lv Zheng and committed by
Rafael J. Wysocki
023e2ee1 04ba15aa

+20 -14
+2 -2
drivers/acpi/acpica/tbdata.c
··· 338 338 acpi_status acpi_tb_validate_temp_table(struct acpi_table_desc *table_desc) 339 339 { 340 340 341 - if (!table_desc->pointer && !acpi_gbl_verify_table_checksum) { 341 + if (!table_desc->pointer && !acpi_gbl_enable_table_validation) { 342 342 /* 343 343 * Only validates the header of the table. 344 344 * Note that Length contains the size of the mapping after invoking ··· 394 394 395 395 /* Verify the checksum */ 396 396 397 - if (acpi_gbl_verify_table_checksum) { 397 + if (acpi_gbl_enable_table_validation) { 398 398 status = 399 399 acpi_tb_verify_checksum(table_desc->pointer, 400 400 table_desc->length);
+1 -1
drivers/acpi/acpica/tbinstal.c
··· 221 221 222 222 (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); 223 223 224 - if (reload) { 224 + if (acpi_gbl_enable_table_validation) { 225 225 226 226 /* Check if table is already registered */ 227 227
+8
drivers/acpi/acpica/tbxface.c
··· 194 194 } 195 195 } 196 196 197 + if (!acpi_gbl_enable_table_validation) { 198 + /* 199 + * Now it's safe to do full table validation. We can do deferred 200 + * table initilization here once the flag is set. 201 + */ 202 + acpi_gbl_enable_table_validation = TRUE; 203 + } 204 + 197 205 acpi_gbl_root_table_list.flags |= ACPI_ROOT_ALLOW_RESIZE; 198 206 199 207 status = acpi_tb_resize_root_table_list();
-3
drivers/acpi/bus.c
··· 995 995 996 996 printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION); 997 997 998 - /* It's safe to verify table checksums during late stage */ 999 - acpi_gbl_verify_table_checksum = TRUE; 1000 - 1001 998 /* enable workarounds, unless strict ACPI spec. compliance */ 1002 999 if (!acpi_strict) 1003 1000 acpi_gbl_enable_interpreter_slack = TRUE;
+2 -2
drivers/acpi/tables.c
··· 740 740 741 741 if (acpi_verify_table_checksum) { 742 742 pr_info("Early table checksum verification enabled\n"); 743 - acpi_gbl_verify_table_checksum = TRUE; 743 + acpi_gbl_enable_table_validation = TRUE; 744 744 } else { 745 745 pr_info("Early table checksum verification disabled\n"); 746 - acpi_gbl_verify_table_checksum = FALSE; 746 + acpi_gbl_enable_table_validation = FALSE; 747 747 } 748 748 749 749 status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
+7 -6
include/acpi/acpixf.h
··· 160 160 ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE); 161 161 162 162 /* 163 - * Whether or not to verify the table checksum before installation. Set 164 - * this to TRUE to verify the table checksum before install it to the table 165 - * manager. Note that enabling this option causes errors to happen in some 166 - * OSPMs during early initialization stages. Default behavior is to do such 167 - * verification. 163 + * Whether or not to validate (map) an entire table to verify 164 + * checksum/duplication in early stage before install. Set this to TRUE to 165 + * allow early table validation before install it to the table manager. 166 + * Note that enabling this option causes errors to happen in some OSPMs 167 + * during early initialization stages. Default behavior is to allow such 168 + * validation. 168 169 */ 169 - ACPI_INIT_GLOBAL(u8, acpi_gbl_verify_table_checksum, TRUE); 170 + ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_table_validation, TRUE); 170 171 171 172 /* 172 173 * Optionally enable output from the AML Debug Object.