forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/acpi/acpica/evrgnini.c
....@@ -3,7 +3,7 @@
33 *
44 * Module Name: evrgnini- ACPI address_space (op_region) init
55 *
6
- * Copyright (C) 2000 - 2018, Intel Corp.
6
+ * Copyright (C) 2000 - 2020, Intel Corp.
77 *
88 *****************************************************************************/
99
....@@ -38,6 +38,7 @@
3838 union acpi_operand_object *region_desc =
3939 (union acpi_operand_object *)handle;
4040 struct acpi_mem_space_context *local_region_context;
41
+ struct acpi_mem_mapping *mm;
4142
4243 ACPI_FUNCTION_TRACE(ev_system_memory_region_setup);
4344
....@@ -46,13 +47,14 @@
4647 local_region_context =
4748 (struct acpi_mem_space_context *)*region_context;
4849
49
- /* Delete a cached mapping if present */
50
+ /* Delete memory mappings if present */
5051
51
- if (local_region_context->mapped_length) {
52
- acpi_os_unmap_memory(local_region_context->
53
- mapped_logical_address,
54
- local_region_context->
55
- mapped_length);
52
+ while (local_region_context->first_mm) {
53
+ mm = local_region_context->first_mm;
54
+ local_region_context->first_mm = mm->next_mm;
55
+ acpi_os_unmap_memory(mm->logical_address,
56
+ mm->length);
57
+ ACPI_FREE(mm);
5658 }
5759 ACPI_FREE(local_region_context);
5860 *region_context = NULL;
....@@ -198,7 +200,6 @@
198200 * root bridge. Still need to return a context object
199201 * for the new PCI_Config operation region, however.
200202 */
201
- status = AE_OK;
202203 } else {
203204 ACPI_EXCEPTION((AE_INFO, status,
204205 "Could not install PciConfig handler "
....@@ -514,25 +515,6 @@
514515 case ACPI_TYPE_THERMAL:
515516
516517 handler_obj = obj_desc->common_notify.handler;
517
- break;
518
-
519
- case ACPI_TYPE_METHOD:
520
- /*
521
- * If we are executing module level code, the original
522
- * Node's object was replaced by this Method object and we
523
- * saved the handler in the method object.
524
- *
525
- * Note: Only used for the legacy MLC support. Will
526
- * be removed in the future.
527
- *
528
- * See acpi_ns_exec_module_code
529
- */
530
- if (!acpi_gbl_execute_tables_as_methods &&
531
- obj_desc->method.
532
- info_flags & ACPI_METHOD_MODULE_LEVEL) {
533
- handler_obj =
534
- obj_desc->method.dispatch.handler;
535
- }
536518 break;
537519
538520 default: