diff options
author | Lv Zheng <lv.zheng@intel.com> | 2017-07-10 03:23:45 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-07-20 10:38:25 -0400 |
commit | 023e2ee16c51da7f6a9455ac936e4fb00295f47a (patch) | |
tree | 63db362bca4e3a36e63c29d1fdc1a8170a7ad2ab /drivers/acpi | |
parent | 04ba15aa55cf16e18757faea55d62d1b7e407fe3 (diff) |
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/tbdata.c | 4 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbinstal.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbxface.c | 8 | ||||
-rw-r--r-- | drivers/acpi/bus.c | 3 | ||||
-rw-r--r-- | drivers/acpi/tables.c | 4 |
5 files changed, 13 insertions, 8 deletions
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c index 7056ca01e875..24d99711b2a4 100644 --- a/drivers/acpi/acpica/tbdata.c +++ b/drivers/acpi/acpica/tbdata.c | |||
@@ -338,7 +338,7 @@ void acpi_tb_invalidate_table(struct acpi_table_desc *table_desc) | |||
338 | acpi_status acpi_tb_validate_temp_table(struct acpi_table_desc *table_desc) | 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 | * Only validates the header of the table. | 343 | * Only validates the header of the table. |
344 | * Note that Length contains the size of the mapping after invoking | 344 | * Note that Length contains the size of the mapping after invoking |
@@ -394,7 +394,7 @@ acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature) | |||
394 | 394 | ||
395 | /* Verify the checksum */ | 395 | /* Verify the checksum */ |
396 | 396 | ||
397 | if (acpi_gbl_verify_table_checksum) { | 397 | if (acpi_gbl_enable_table_validation) { |
398 | status = | 398 | status = |
399 | acpi_tb_verify_checksum(table_desc->pointer, | 399 | acpi_tb_verify_checksum(table_desc->pointer, |
400 | table_desc->length); | 400 | table_desc->length); |
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index 9d212967fad8..f7bc362bd3c5 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c | |||
@@ -221,7 +221,7 @@ acpi_tb_install_standard_table(acpi_physical_address address, | |||
221 | 221 | ||
222 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 222 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
223 | 223 | ||
224 | if (reload) { | 224 | if (acpi_gbl_enable_table_validation) { |
225 | 225 | ||
226 | /* Check if table is already registered */ | 226 | /* Check if table is already registered */ |
227 | 227 | ||
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index 18508b2c0c05..38c01049afd5 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c | |||
@@ -194,6 +194,14 @@ acpi_status ACPI_INIT_FUNCTION acpi_reallocate_root_table(void) | |||
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 | acpi_gbl_root_table_list.flags |= ACPI_ROOT_ALLOW_RESIZE; | 205 | acpi_gbl_root_table_list.flags |= ACPI_ROOT_ALLOW_RESIZE; |
198 | 206 | ||
199 | status = acpi_tb_resize_root_table_list(); | 207 | status = acpi_tb_resize_root_table_list(); |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index af74b420ec83..59f2f96fdb7e 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -995,9 +995,6 @@ void __init acpi_early_init(void) | |||
995 | 995 | ||
996 | printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION); | 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 | /* enable workarounds, unless strict ACPI spec. compliance */ | 998 | /* enable workarounds, unless strict ACPI spec. compliance */ |
1002 | if (!acpi_strict) | 999 | if (!acpi_strict) |
1003 | acpi_gbl_enable_interpreter_slack = TRUE; | 1000 | acpi_gbl_enable_interpreter_slack = TRUE; |
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index ff425390bfa8..80ce2a7d224b 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -740,10 +740,10 @@ int __init acpi_table_init(void) | |||
740 | 740 | ||
741 | if (acpi_verify_table_checksum) { | 741 | if (acpi_verify_table_checksum) { |
742 | pr_info("Early table checksum verification enabled\n"); | 742 | pr_info("Early table checksum verification enabled\n"); |
743 | acpi_gbl_verify_table_checksum = TRUE; | 743 | acpi_gbl_enable_table_validation = TRUE; |
744 | } else { | 744 | } else { |
745 | pr_info("Early table checksum verification disabled\n"); | 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 | status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); | 749 | status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); |