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

Merge tag 'acpi-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
"These update the ACPICA code in the kernel to upstream revision
20190703, fix up the handling of GPEs in ACPICA, allow some more ACPI
code to be built on ARM64 platforms, allow BGRT to be overridden, fix
minor issues and clean up assorted pieces of ACPI code.

Specifics:

- Update the ACPICA code in the kernel to upstream revision 20190703
including:
- Initial/default namespace creation simplification (Bob Moore).
- Object initialization sequence update (Bob Moore).
- Removal of legacy module-level (dead) code (Erik Schmauss).
- Table load object initialization update (Erik Schmauss,
Nikolaus Voss).

- Fix GPE enabling issue in ACPICA causing premature wakeups from
suspend-to-idle to occur (Rafael Wysocki).

- Allow ACPI AC and battery drivers to be built on non-X86 (Ard
Biesheuvel).

- Fix address space handler removal in the ACPI PMIC driver for Intel
platforms (Andy Shevchenko).

- Allow BGRT to be overridden via initrd or configfs (Andrea
Oliveri).

- Fix object resolution on table loads via configfs (Nikolaus Voss).

- Clean up assorted pieces of ACPI code and tools (Colin Ian King,
Liguang Zhang, Masahiro Yamada).

- Fix documentation build warning, convert the extcon document to
ReST and add it to the ACPI documentation (Mauro Carvalho Chehab,
Qian Cai)"

* tag 'acpi-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / APEI: Remove needless __ghes_check_estatus() calls
ACPICA: Update version to 20190703
ACPICA: Update table load object initialization
ACPICA: Update for object initialization sequence
ACPICA: remove legacy module-level code due to deprecation
ACPICA: Namespace: simplify creation of the initial/default namespace
ACPI / PMIC: intel: Drop double removal of address space handler
ACPI: APD: remove redundant assignment to pointer clk
docs: extcon: convert it to ReST and move to ACPI dir
ACPI: Make AC and battery drivers available on !X86
ACPICA: Clear status of GPEs on first direct enable
ACPI: configfs: Resolve objects on host-directed table loads
ACPI: tables: Allow BGRT to be overridden
ACPI: OSL: Make a W=1 kernel-doc warning go away
ACPI: tools: Exclude tools/* from .gitignore patterns

+131 -337
+10 -4
Documentation/extcon/intel-int3496.txt Documentation/firmware-guide/acpi/extcon-intel-int3496.rst
··· 1 + ===================================================== 1 2 Intel INT3496 ACPI device extcon driver documentation 2 - ----------------------------------------------------- 3 + ===================================================== 3 4 4 5 The Intel INT3496 ACPI device extcon driver is a driver for ACPI 5 6 devices with an acpi-id of INT3496, such as found for example on ··· 14 13 The ACPI devices exposes this functionality by returning an array with up 15 14 to 3 gpio descriptors from its ACPI _CRS (Current Resource Settings) call: 16 15 17 - Index 0: The input gpio for the id-pin, this is always present and valid 18 - Index 1: The output gpio for enabling Vbus output from the device to the otg 16 + ======= ===================================================================== 17 + Index 0 The input gpio for the id-pin, this is always present and valid 18 + Index 1 The output gpio for enabling Vbus output from the device to the otg 19 19 port, write 1 to enable the Vbus output (this gpio descriptor may 20 20 be absent or invalid) 21 - Index 2: The output gpio for muxing of the data pins between the USB host and 21 + Index 2 The output gpio for muxing of the data pins between the USB host and 22 22 the USB peripheral controller, write 1 to mux to the peripheral 23 23 controller 24 + ======= ===================================================================== 24 25 25 26 There is a mapping between indices and GPIO connection IDs as follows 27 + 28 + ======= ======= 26 29 id index 0 27 30 vbus index 1 28 31 mux index 2 32 + ======= =======
+1
Documentation/firmware-guide/acpi/index.rst
··· 24 24 acpi-lid 25 25 lpit 26 26 video_extension 27 + extcon-intel-int3496
+3 -3
MAINTAINERS
··· 321 321 F: include/linux/acpi.h 322 322 F: include/linux/fwnode.h 323 323 F: include/acpi/ 324 - F: Documentation/acpi/ 324 + F: Documentation/firmware-guide/acpi/ 325 325 F: Documentation/ABI/testing/sysfs-bus-acpi 326 326 F: Documentation/ABI/testing/configfs-acpi 327 327 F: drivers/pci/*acpi* ··· 4893 4893 F: Documentation/ 4894 4894 F: scripts/kernel-doc 4895 4895 X: Documentation/ABI/ 4896 - X: Documentation/acpi/ 4896 + X: Documentation/firmware-guide/acpi/ 4897 4897 X: Documentation/devicetree/ 4898 4898 X: Documentation/i2c/ 4899 4899 X: Documentation/media/ ··· 6069 6069 F: drivers/extcon/ 6070 6070 F: include/linux/extcon/ 6071 6071 F: include/linux/extcon.h 6072 - F: Documentation/extcon/ 6072 + F: Documentation/firmware-guide/acpi/extcon-intel-int3496.rst 6073 6073 F: Documentation/devicetree/bindings/extcon/ 6074 6074 6075 6075 EXYNOS DP DRIVER
-2
drivers/acpi/Kconfig
··· 155 155 156 156 config ACPI_AC 157 157 tristate "AC Adapter" 158 - depends on X86 159 158 select POWER_SUPPLY 160 159 default y 161 160 help ··· 167 168 168 169 config ACPI_BATTERY 169 170 tristate "Battery" 170 - depends on X86 171 171 select POWER_SUPPLY 172 172 default y 173 173 help
+1 -1
drivers/acpi/acpi_apd.c
··· 57 57 static int acpi_apd_setup(struct apd_private_data *pdata) 58 58 { 59 59 const struct apd_device_desc *dev_desc = pdata->dev_desc; 60 - struct clk *clk = ERR_PTR(-ENODEV); 60 + struct clk *clk; 61 61 62 62 if (dev_desc->fixed_clk_rate) { 63 63 clk = clk_register_fixed_rate(&pdata->adev->dev,
+1 -5
drivers/acpi/acpi_configfs.c
··· 53 53 if (!table->header) 54 54 return -ENOMEM; 55 55 56 - ACPI_INFO(("Host-directed Dynamic ACPI Table Load:")); 57 - ret = acpi_tb_install_and_load_table( 58 - ACPI_PTR_TO_PHYSADDR(table->header), 59 - ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE, 60 - &table->index); 56 + ret = acpi_load_table(table->header); 61 57 if (ret) { 62 58 kfree(table->header); 63 59 table->header = NULL;
+2 -1
drivers/acpi/acpica/acevents.h
··· 69 69 acpi_ev_mask_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 is_masked); 70 70 71 71 acpi_status 72 - acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info); 72 + acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info, 73 + u8 clear_on_enable); 73 74 74 75 acpi_status 75 76 acpi_ev_remove_gpe_reference(struct acpi_gpe_event_info *gpe_event_info);
-1
drivers/acpi/acpica/acglobal.h
··· 178 178 ACPI_GLOBAL(struct acpi_namespace_node, acpi_gbl_root_node_struct); 179 179 ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_root_node); 180 180 ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_fadt_gpe_device); 181 - ACPI_GLOBAL(union acpi_operand_object *, acpi_gbl_module_code_list); 182 181 183 182 extern const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES]; 184 183 extern const struct acpi_predefined_names
-2
drivers/acpi/acpica/acnamesp.h
··· 207 207 */ 208 208 acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info); 209 209 210 - void acpi_ns_exec_module_code_list(void); 211 - 212 210 /* 213 211 * nsarguments - Argument count/type checking for predefined/reserved names 214 212 */
+1 -1
drivers/acpi/acpica/dsinit.c
··· 202 202 203 203 if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT)) { 204 204 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, 205 - "\nInitializing Namespace objects:\n")); 205 + "\nACPI table initialization:\n")); 206 206 } 207 207 208 208 /* Summary of objects initialized */
+7 -1
drivers/acpi/acpica/evgpe.c
··· 146 146 * FUNCTION: acpi_ev_add_gpe_reference 147 147 * 148 148 * PARAMETERS: gpe_event_info - Add a reference to this GPE 149 + * clear_on_enable - Clear GPE status before enabling it 149 150 * 150 151 * RETURN: Status 151 152 * ··· 156 155 ******************************************************************************/ 157 156 158 157 acpi_status 159 - acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info) 158 + acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info, 159 + u8 clear_on_enable) 160 160 { 161 161 acpi_status status = AE_OK; 162 162 ··· 171 169 if (gpe_event_info->runtime_count == 1) { 172 170 173 171 /* Enable on first reference */ 172 + 173 + if (clear_on_enable) { 174 + (void)acpi_hw_clear_gpe(gpe_event_info); 175 + } 174 176 175 177 status = acpi_ev_update_gpe_enable_mask(gpe_event_info); 176 178 if (ACPI_SUCCESS(status)) {
+1 -1
drivers/acpi/acpica/evgpeblk.c
··· 453 453 continue; 454 454 } 455 455 456 - status = acpi_ev_add_gpe_reference(gpe_event_info); 456 + status = acpi_ev_add_gpe_reference(gpe_event_info, FALSE); 457 457 if (ACPI_FAILURE(status)) { 458 458 ACPI_EXCEPTION((AE_INFO, status, 459 459 "Could not enable GPE 0x%02X",
+1 -1
drivers/acpi/acpica/evxface.c
··· 971 971 ACPI_GPE_DISPATCH_METHOD) || 972 972 (ACPI_GPE_DISPATCH_TYPE(handler->original_flags) == 973 973 ACPI_GPE_DISPATCH_NOTIFY)) && handler->originally_enabled) { 974 - (void)acpi_ev_add_gpe_reference(gpe_event_info); 974 + (void)acpi_ev_add_gpe_reference(gpe_event_info, FALSE); 975 975 if (ACPI_GPE_IS_POLLING_NEEDED(gpe_event_info)) { 976 976 977 977 /* Poll edge triggered GPEs to handle existing events */
+1 -1
drivers/acpi/acpica/evxfgpe.c
··· 108 108 if (gpe_event_info) { 109 109 if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) != 110 110 ACPI_GPE_DISPATCH_NONE) { 111 - status = acpi_ev_add_gpe_reference(gpe_event_info); 111 + status = acpi_ev_add_gpe_reference(gpe_event_info, TRUE); 112 112 if (ACPI_SUCCESS(status) && 113 113 ACPI_GPE_IS_POLLING_NEEDED(gpe_event_info)) { 114 114
+6 -10
drivers/acpi/acpica/exconfig.c
··· 174 174 return_ACPI_STATUS(status); 175 175 } 176 176 177 - /* Complete the initialization/resolution of package objects */ 177 + /* Complete the initialization/resolution of new objects */ 178 178 179 - status = acpi_ns_walk_namespace(ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT, 180 - ACPI_UINT32_MAX, 0, 181 - acpi_ns_init_one_package, NULL, NULL, 182 - NULL); 179 + acpi_ns_initialize_objects(); 183 180 184 181 /* Parameter Data (optional) */ 185 182 ··· 434 437 return_ACPI_STATUS(status); 435 438 } 436 439 437 - /* Complete the initialization/resolution of package objects */ 440 + /* Complete the initialization/resolution of new objects */ 438 441 439 - status = acpi_ns_walk_namespace(ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT, 440 - ACPI_UINT32_MAX, 0, 441 - acpi_ns_init_one_package, NULL, NULL, 442 - NULL); 442 + acpi_ex_exit_interpreter(); 443 + acpi_ns_initialize_objects(); 444 + acpi_ex_enter_interpreter(); 443 445 444 446 /* Store the ddb_handle into the Target operand */ 445 447
+43 -11
drivers/acpi/acpica/nsaccess.c
··· 36 36 acpi_status status; 37 37 const struct acpi_predefined_names *init_val = NULL; 38 38 struct acpi_namespace_node *new_node; 39 + struct acpi_namespace_node *prev_node = NULL; 39 40 union acpi_operand_object *obj_desc; 40 41 acpi_string val = NULL; 41 42 ··· 62 61 */ 63 62 acpi_gbl_root_node = &acpi_gbl_root_node_struct; 64 63 65 - /* Enter the pre-defined names in the name table */ 64 + /* Enter the predefined names in the name table */ 66 65 67 66 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 68 67 "Entering predefined entries into namespace\n")); 69 68 69 + /* 70 + * Create the initial (default) namespace. 71 + * This namespace looks like something similar to this: 72 + * 73 + * ACPI Namespace (from Namespace Root): 74 + * 0 _GPE Scope 00203160 00 75 + * 0 _PR_ Scope 002031D0 00 76 + * 0 _SB_ Device 00203240 00 Notify Object: 0020ADD8 77 + * 0 _SI_ Scope 002032B0 00 78 + * 0 _TZ_ Device 00203320 00 79 + * 0 _REV Integer 00203390 00 = 0000000000000002 80 + * 0 _OS_ String 00203488 00 Len 14 "Microsoft Windows NT" 81 + * 0 _GL_ Mutex 00203580 00 Object 002035F0 82 + * 0 _OSI Method 00203678 00 Args 1 Len 0000 Aml 00000000 83 + */ 70 84 for (init_val = acpi_gbl_pre_defined_names; init_val->name; init_val++) { 85 + status = AE_OK; 71 86 72 87 /* _OSI is optional for now, will be permanent later */ 73 88 ··· 92 75 continue; 93 76 } 94 77 95 - status = 96 - acpi_ns_lookup(NULL, ACPI_CAST_PTR(char, init_val->name), 97 - init_val->type, ACPI_IMODE_LOAD_PASS2, 98 - ACPI_NS_NO_UPSEARCH, NULL, &new_node); 99 - if (ACPI_FAILURE(status)) { 100 - ACPI_EXCEPTION((AE_INFO, status, 101 - "Could not create predefined name %s", 102 - init_val->name)); 103 - continue; 78 + /* 79 + * Create, init, and link the new predefined name 80 + * Note: No need to use acpi_ns_lookup here because all the 81 + * predefined names are at the root level. It is much easier to 82 + * just create and link the new node(s) here. 83 + */ 84 + new_node = 85 + ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_namespace_node)); 86 + if (!new_node) { 87 + status = AE_NO_MEMORY; 88 + goto unlock_and_exit; 104 89 } 90 + 91 + ACPI_COPY_NAMESEG(new_node->name.ascii, init_val->name); 92 + new_node->descriptor_type = ACPI_DESC_TYPE_NAMED; 93 + new_node->type = init_val->type; 94 + 95 + if (!prev_node) { 96 + acpi_gbl_root_node_struct.child = new_node; 97 + } else { 98 + prev_node->peer = new_node; 99 + } 100 + 101 + new_node->parent = &acpi_gbl_root_node_struct; 102 + prev_node = new_node; 105 103 106 104 /* 107 105 * Name entered successfully. If entry in pre_defined_names[] specifies ··· 163 131 164 132 new_node->value = obj_desc->method.param_count; 165 133 #else 166 - /* Mark this as a very SPECIAL method */ 134 + /* Mark this as a very SPECIAL method (_OSI) */ 167 135 168 136 obj_desc->method.info_flags = 169 137 ACPI_METHOD_INTERNAL_ONLY;
-190
drivers/acpi/acpica/nseval.c
··· 14 14 #define _COMPONENT ACPI_NAMESPACE 15 15 ACPI_MODULE_NAME("nseval") 16 16 17 - /* Local prototypes */ 18 - static void 19 - acpi_ns_exec_module_code(union acpi_operand_object *method_obj, 20 - struct acpi_evaluate_info *info); 21 - 22 17 /******************************************************************************* 23 18 * 24 19 * FUNCTION: acpi_ns_evaluate ··· 39 44 * MUTEX: Locks interpreter 40 45 * 41 46 ******************************************************************************/ 42 - 43 47 acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info) 44 48 { 45 49 acpi_status status; ··· 303 309 ACPI_FREE(info->full_pathname); 304 310 info->full_pathname = NULL; 305 311 return_ACPI_STATUS(status); 306 - } 307 - 308 - /******************************************************************************* 309 - * 310 - * FUNCTION: acpi_ns_exec_module_code_list 311 - * 312 - * PARAMETERS: None 313 - * 314 - * RETURN: None. Exceptions during method execution are ignored, since 315 - * we cannot abort a table load. 316 - * 317 - * DESCRIPTION: Execute all elements of the global module-level code list. 318 - * Each element is executed as a single control method. 319 - * 320 - * NOTE: With this option enabled, each block of detected executable AML 321 - * code that is outside of any control method is wrapped with a temporary 322 - * control method object and placed on a global list. The methods on this 323 - * list are executed below. 324 - * 325 - * This function executes the module-level code for all tables only after 326 - * all of the tables have been loaded. It is a legacy option and is 327 - * not compatible with other ACPI implementations. See acpi_ns_load_table. 328 - * 329 - * This function will be removed when the legacy option is removed. 330 - * 331 - ******************************************************************************/ 332 - 333 - void acpi_ns_exec_module_code_list(void) 334 - { 335 - union acpi_operand_object *prev; 336 - union acpi_operand_object *next; 337 - struct acpi_evaluate_info *info; 338 - u32 method_count = 0; 339 - 340 - ACPI_FUNCTION_TRACE(ns_exec_module_code_list); 341 - 342 - /* Exit now if the list is empty */ 343 - 344 - next = acpi_gbl_module_code_list; 345 - if (!next) { 346 - ACPI_DEBUG_PRINT((ACPI_DB_INIT_NAMES, 347 - "Legacy MLC block list is empty\n")); 348 - 349 - return_VOID; 350 - } 351 - 352 - /* Allocate the evaluation information block */ 353 - 354 - info = ACPI_ALLOCATE(sizeof(struct acpi_evaluate_info)); 355 - if (!info) { 356 - return_VOID; 357 - } 358 - 359 - /* Walk the list, executing each "method" */ 360 - 361 - while (next) { 362 - prev = next; 363 - next = next->method.mutex; 364 - 365 - /* Clear the link field and execute the method */ 366 - 367 - prev->method.mutex = NULL; 368 - acpi_ns_exec_module_code(prev, info); 369 - method_count++; 370 - 371 - /* Delete the (temporary) method object */ 372 - 373 - acpi_ut_remove_reference(prev); 374 - } 375 - 376 - ACPI_INFO(("Executed %u blocks of module-level executable AML code", 377 - method_count)); 378 - 379 - ACPI_FREE(info); 380 - acpi_gbl_module_code_list = NULL; 381 - return_VOID; 382 - } 383 - 384 - /******************************************************************************* 385 - * 386 - * FUNCTION: acpi_ns_exec_module_code 387 - * 388 - * PARAMETERS: method_obj - Object container for the module-level code 389 - * info - Info block for method evaluation 390 - * 391 - * RETURN: None. Exceptions during method execution are ignored, since 392 - * we cannot abort a table load. 393 - * 394 - * DESCRIPTION: Execute a control method containing a block of module-level 395 - * executable AML code. The control method is temporarily 396 - * installed to the root node, then evaluated. 397 - * 398 - ******************************************************************************/ 399 - 400 - static void 401 - acpi_ns_exec_module_code(union acpi_operand_object *method_obj, 402 - struct acpi_evaluate_info *info) 403 - { 404 - union acpi_operand_object *parent_obj; 405 - struct acpi_namespace_node *parent_node; 406 - acpi_object_type type; 407 - acpi_status status; 408 - 409 - ACPI_FUNCTION_TRACE(ns_exec_module_code); 410 - 411 - /* 412 - * Get the parent node. We cheat by using the next_object field 413 - * of the method object descriptor. 414 - */ 415 - parent_node = 416 - ACPI_CAST_PTR(struct acpi_namespace_node, 417 - method_obj->method.next_object); 418 - type = acpi_ns_get_type(parent_node); 419 - 420 - /* 421 - * Get the region handler and save it in the method object. We may need 422 - * this if an operation region declaration causes a _REG method to be run. 423 - * 424 - * We can't do this in acpi_ps_link_module_code because 425 - * acpi_gbl_root_node->Object is NULL at PASS1. 426 - */ 427 - if ((type == ACPI_TYPE_DEVICE) && parent_node->object) { 428 - method_obj->method.dispatch.handler = 429 - parent_node->object->device.handler; 430 - } 431 - 432 - /* Must clear next_object (acpi_ns_attach_object needs the field) */ 433 - 434 - method_obj->method.next_object = NULL; 435 - 436 - /* Initialize the evaluation information block */ 437 - 438 - memset(info, 0, sizeof(struct acpi_evaluate_info)); 439 - info->prefix_node = parent_node; 440 - 441 - /* 442 - * Get the currently attached parent object. Add a reference, 443 - * because the ref count will be decreased when the method object 444 - * is installed to the parent node. 445 - */ 446 - parent_obj = acpi_ns_get_attached_object(parent_node); 447 - if (parent_obj) { 448 - acpi_ut_add_reference(parent_obj); 449 - } 450 - 451 - /* Install the method (module-level code) in the parent node */ 452 - 453 - status = 454 - acpi_ns_attach_object(parent_node, method_obj, ACPI_TYPE_METHOD); 455 - if (ACPI_FAILURE(status)) { 456 - goto exit; 457 - } 458 - 459 - /* Execute the parent node as a control method */ 460 - 461 - status = acpi_ns_evaluate(info); 462 - 463 - ACPI_DEBUG_PRINT((ACPI_DB_INIT_NAMES, 464 - "Executed module-level code at %p\n", 465 - method_obj->method.aml_start)); 466 - 467 - /* Delete a possible implicit return value (in slack mode) */ 468 - 469 - if (info->return_object) { 470 - acpi_ut_remove_reference(info->return_object); 471 - } 472 - 473 - /* Detach the temporary method object */ 474 - 475 - acpi_ns_detach_object(parent_node); 476 - 477 - /* Restore the original parent object */ 478 - 479 - if (parent_obj) { 480 - status = acpi_ns_attach_object(parent_node, parent_obj, type); 481 - } else { 482 - parent_node->type = (u8)type; 483 - } 484 - 485 - exit: 486 - if (parent_obj) { 487 - acpi_ut_remove_reference(parent_obj); 488 - } 489 - return_VOID; 490 312 }
+19 -30
drivers/acpi/acpica/nsinit.c
··· 55 55 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 56 56 "**** Starting initialization of namespace objects ****\n")); 57 57 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, 58 - "Completing Region/Field/Buffer/Package initialization:\n")); 58 + "Final data object initialization: ")); 59 59 60 - /* Set all init info to zero */ 60 + /* Clear the info block */ 61 61 62 62 memset(&info, 0, sizeof(struct acpi_init_walk_info)); 63 63 64 64 /* Walk entire namespace from the supplied root */ 65 65 66 + /* 67 + * TBD: will become ACPI_TYPE_PACKAGE as this type object 68 + * is now the only one that supports deferred initialization 69 + * (forward references). 70 + */ 66 71 status = acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, 67 72 ACPI_UINT32_MAX, acpi_ns_init_one_object, 68 73 NULL, &info, NULL); ··· 76 71 } 77 72 78 73 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, 79 - " Initialized %u/%u Regions %u/%u Fields %u/%u " 80 - "Buffers %u/%u Packages (%u nodes)\n", 81 - info.op_region_init, info.op_region_count, 82 - info.field_init, info.field_count, 83 - info.buffer_init, info.buffer_count, 84 - info.package_init, info.package_count, 85 - info.object_count)); 74 + "Namespace contains %u (0x%X) objects\n", 75 + info.object_count, info.object_count)); 86 76 87 77 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 88 78 "%u Control Methods found\n%u Op Regions found\n", ··· 382 382 acpi_ex_enter_interpreter(); 383 383 384 384 /* 385 - * Each of these types can contain executable AML code within the 386 - * declaration. 385 + * Only initialization of Package objects can be deferred, in order 386 + * to support forward references. 387 387 */ 388 388 switch (type) { 389 - case ACPI_TYPE_REGION: 390 - 391 - info->op_region_init++; 392 - status = acpi_ds_get_region_arguments(obj_desc); 393 - break; 394 - 395 - case ACPI_TYPE_BUFFER_FIELD: 396 - 397 - info->field_init++; 398 - status = acpi_ds_get_buffer_field_arguments(obj_desc); 399 - break; 400 - 401 389 case ACPI_TYPE_LOCAL_BANK_FIELD: 390 + 391 + /* TBD: bank_fields do not require deferred init, remove this code */ 402 392 403 393 info->field_init++; 404 394 status = acpi_ds_get_bank_field_arguments(obj_desc); 405 - break; 406 - 407 - case ACPI_TYPE_BUFFER: 408 - 409 - info->buffer_init++; 410 - status = acpi_ds_get_buffer_arguments(obj_desc); 411 395 break; 412 396 413 397 case ACPI_TYPE_PACKAGE: ··· 405 421 406 422 default: 407 423 408 - /* No other types can get here */ 424 + /* No other types should get here */ 409 425 426 + status = AE_TYPE; 427 + ACPI_EXCEPTION((AE_INFO, status, 428 + "Opcode is not deferred [%4.4s] (%s)", 429 + acpi_ut_get_node_name(node), 430 + acpi_ut_get_type_name(type))); 410 431 break; 411 432 } 412 433
-12
drivers/acpi/acpica/nsload.c
··· 109 109 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 110 110 "**** Completed Table Object Initialization\n")); 111 111 112 - /* 113 - * This case handles the legacy option that groups all module-level 114 - * code blocks together and defers execution until all of the tables 115 - * are loaded. Execute all of these blocks at this time. 116 - * Execute any module-level code that was detected during the table 117 - * load phase. 118 - * 119 - * Note: this option is deprecated and will be eliminated in the 120 - * future. Use of this option can cause problems with AML code that 121 - * depends upon in-order immediate execution of module-level code. 122 - */ 123 - acpi_ns_exec_module_code_list(); 124 112 return_ACPI_STATUS(status); 125 113 } 126 114
-12
drivers/acpi/acpica/nsutils.c
··· 560 560 void acpi_ns_terminate(void) 561 561 { 562 562 acpi_status status; 563 - union acpi_operand_object *prev; 564 - union acpi_operand_object *next; 565 563 566 564 ACPI_FUNCTION_TRACE(ns_terminate); 567 - 568 - /* Delete any module-level code blocks */ 569 - 570 - next = acpi_gbl_module_code_list; 571 - while (next) { 572 - prev = next; 573 - next = next->method.mutex; 574 - prev->method.mutex = NULL; /* Clear the Mutex (cheated) field */ 575 - acpi_ut_remove_reference(prev); 576 - } 577 565 578 566 /* 579 567 * Free the entire namespace -- all nodes and all objects
-13
drivers/acpi/acpica/tbdata.c
··· 934 934 status = acpi_ns_load_table(table_index, parent_node); 935 935 936 936 /* 937 - * This case handles the legacy option that groups all module-level 938 - * code blocks together and defers execution until all of the tables 939 - * are loaded. Execute all of these blocks at this time. 940 - * Execute any module-level code that was detected during the table 941 - * load phase. 942 - * 943 - * Note: this option is deprecated and will be eliminated in the 944 - * future. Use of this option can cause problems with AML code that 945 - * depends upon in-order immediate execution of module-level code. 946 - */ 947 - acpi_ns_exec_module_code_list(); 948 - 949 - /* 950 937 * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is 951 938 * responsible for discovering any new wake GPEs by running _PRW methods 952 939 * that may have been loaded by this table.
+7
drivers/acpi/acpica/tbxfload.c
··· 297 297 status = acpi_tb_install_and_load_table(ACPI_PTR_TO_PHYSADDR(table), 298 298 ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, 299 299 FALSE, &table_index); 300 + if (ACPI_SUCCESS(status)) { 301 + 302 + /* Complete the initialization/resolution of new objects */ 303 + 304 + acpi_ns_initialize_objects(); 305 + } 306 + 300 307 return_ACPI_STATUS(status); 301 308 } 302 309
-1
drivers/acpi/acpica/utinit.c
··· 180 180 181 181 /* Namespace */ 182 182 183 - acpi_gbl_module_code_list = NULL; 184 183 acpi_gbl_root_node = NULL; 185 184 acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME; 186 185 acpi_gbl_root_node_struct.descriptor_type = ACPI_DESC_TYPE_NAMED;
+6 -12
drivers/acpi/acpica/utxfinit.c
··· 211 211 212 212 ACPI_FUNCTION_TRACE(acpi_initialize_objects); 213 213 214 + #ifdef ACPI_OBSOLETE_BEHAVIOR 214 215 /* 215 - * This case handles the legacy option that groups all module-level 216 - * code blocks together and defers execution until all of the tables 217 - * are loaded. Execute all of these blocks at this time. 218 - * Execute any module-level code that was detected during the table 219 - * load phase. 220 - * 221 - * Note: this option is deprecated and will be eliminated in the 222 - * future. Use of this option can cause problems with AML code that 223 - * depends upon in-order immediate execution of module-level code. 216 + * 05/2019: Removed, initialization now happens at both object 217 + * creation and table load time 224 218 */ 225 - acpi_ns_exec_module_code_list(); 226 219 227 220 /* 228 221 * Initialize the objects that remain uninitialized. This 229 222 * runs the executable AML that may be part of the 230 - * declaration of these objects: 231 - * operation_regions, buffer_fields, Buffers, and Packages. 223 + * declaration of these objects: operation_regions, buffer_fields, 224 + * bank_fields, Buffers, and Packages. 232 225 */ 233 226 if (!(flags & ACPI_NO_OBJECT_INIT)) { 234 227 status = acpi_ns_initialize_objects(); ··· 229 236 return_ACPI_STATUS(status); 230 237 } 231 238 } 239 + #endif 232 240 233 241 /* 234 242 * Initialize all device/region objects in the namespace. This runs
+1 -1
drivers/acpi/apei/ghes.c
··· 345 345 return -ENOENT; 346 346 } 347 347 348 - return __ghes_check_estatus(ghes, estatus); 348 + return 0; 349 349 } 350 350 351 351 static int __ghes_read_estatus(struct acpi_hest_generic_status *estatus,
+2 -2
drivers/acpi/osl.c
··· 301 301 * During early init (when acpi_permanent_mmap has not been set yet) this 302 302 * routine simply calls __acpi_map_table() to get the job done. 303 303 */ 304 - void __iomem *__ref 305 - acpi_os_map_iomem(acpi_physical_address phys, acpi_size size) 304 + void __iomem __ref 305 + *acpi_os_map_iomem(acpi_physical_address phys, acpi_size size) 306 306 { 307 307 struct acpi_ioremap *map; 308 308 void __iomem *virt;
-2
drivers/acpi/pmic/intel_pmic.c
··· 284 284 intel_pmic_thermal_handler, 285 285 NULL, opregion); 286 286 if (ACPI_FAILURE(status)) { 287 - acpi_remove_address_space_handler(handle, PMIC_POWER_OPREGION_ID, 288 - intel_pmic_power_handler); 289 287 ret = -ENODEV; 290 288 goto out_remove_power_handler; 291 289 }
+11 -10
drivers/acpi/tables.c
··· 490 490 491 491 /* All but ACPI_SIG_RSDP and ACPI_SIG_FACS: */ 492 492 static const char * const table_sigs[] = { 493 - ACPI_SIG_BERT, ACPI_SIG_CPEP, ACPI_SIG_ECDT, ACPI_SIG_EINJ, 494 - ACPI_SIG_ERST, ACPI_SIG_HEST, ACPI_SIG_MADT, ACPI_SIG_MSCT, 495 - ACPI_SIG_SBST, ACPI_SIG_SLIT, ACPI_SIG_SRAT, ACPI_SIG_ASF, 496 - ACPI_SIG_BOOT, ACPI_SIG_DBGP, ACPI_SIG_DMAR, ACPI_SIG_HPET, 497 - ACPI_SIG_IBFT, ACPI_SIG_IVRS, ACPI_SIG_MCFG, ACPI_SIG_MCHI, 498 - ACPI_SIG_SLIC, ACPI_SIG_SPCR, ACPI_SIG_SPMI, ACPI_SIG_TCPA, 499 - ACPI_SIG_UEFI, ACPI_SIG_WAET, ACPI_SIG_WDAT, ACPI_SIG_WDDT, 500 - ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_PSDT, 501 - ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT, ACPI_SIG_IORT, 502 - ACPI_SIG_NFIT, ACPI_SIG_HMAT, ACPI_SIG_PPTT, NULL }; 493 + ACPI_SIG_BERT, ACPI_SIG_BGRT, ACPI_SIG_CPEP, ACPI_SIG_ECDT, 494 + ACPI_SIG_EINJ, ACPI_SIG_ERST, ACPI_SIG_HEST, ACPI_SIG_MADT, 495 + ACPI_SIG_MSCT, ACPI_SIG_SBST, ACPI_SIG_SLIT, ACPI_SIG_SRAT, 496 + ACPI_SIG_ASF, ACPI_SIG_BOOT, ACPI_SIG_DBGP, ACPI_SIG_DMAR, 497 + ACPI_SIG_HPET, ACPI_SIG_IBFT, ACPI_SIG_IVRS, ACPI_SIG_MCFG, 498 + ACPI_SIG_MCHI, ACPI_SIG_SLIC, ACPI_SIG_SPCR, ACPI_SIG_SPMI, 499 + ACPI_SIG_TCPA, ACPI_SIG_UEFI, ACPI_SIG_WAET, ACPI_SIG_WDAT, 500 + ACPI_SIG_WDDT, ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT, 501 + ACPI_SIG_PSDT, ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT, 502 + ACPI_SIG_IORT, ACPI_SIG_NFIT, ACPI_SIG_HMAT, ACPI_SIG_PPTT, 503 + NULL }; 503 504 504 505 #define ACPI_HEADER_SIZE sizeof(struct acpi_table_header) 505 506
+2 -2
include/acpi/acpi_io.h
··· 16 16 17 17 extern bool acpi_permanent_mmap; 18 18 19 - void __iomem *__ref 20 - acpi_os_map_iomem(acpi_physical_address phys, acpi_size size); 19 + void __iomem __ref 20 + *acpi_os_map_iomem(acpi_physical_address phys, acpi_size size); 21 21 void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size); 22 22 void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size); 23 23
+1 -1
include/acpi/acpixf.h
··· 12 12 13 13 /* Current ACPICA subsystem version in YYYYMMDD format */ 14 14 15 - #define ACPI_CA_VERSION 0x20190509 15 + #define ACPI_CA_VERSION 0x20190703 16 16 17 17 #include <acpi/acconfig.h> 18 18 #include <acpi/actypes.h>
+4 -4
tools/power/acpi/.gitignore
··· 1 - acpidbg 2 - acpidump 3 - ec 4 - include 1 + /acpidbg 2 + /acpidump 3 + /ec 4 + /include/