Skip to content

Commit

Permalink
ACPICA: Update for object initialization sequence
Browse files Browse the repository at this point in the history
ACPICA commit 106c72a97f5ca972f29956e5e9a0429b8c4a2723

 1) Do not allow the objects to be initialized twice
 2) Only package objects require a deferred initialization
 3) Cleanup initialization output

Link: https://github.com/acpica/acpica/commit/106c72a9
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Bob Moore authored and Rafael J. Wysocki committed Jul 3, 2019
1 parent 8894f52 commit 86a33cf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 33 deletions.
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/dsinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ acpi_ds_initialize_objects(u32 table_index,

if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT)) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"\nInitializing Namespace objects:\n"));
"\nACPI table initialization:\n"));
}

/* Summary of objects initialized */
Expand Down
49 changes: 19 additions & 30 deletions drivers/acpi/acpica/nsinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,19 @@ acpi_status acpi_ns_initialize_objects(void)
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Completing Region/Field/Buffer/Package initialization:\n"));
"Final data object initialization: "));

/* Set all init info to zero */
/* Clear the info block */

memset(&info, 0, sizeof(struct acpi_init_walk_info));

/* Walk entire namespace from the supplied root */

/*
* TBD: will become ACPI_TYPE_PACKAGE as this type object
* is now the only one that supports deferred initialization
* (forward references).
*/
status = acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, acpi_ns_init_one_object,
NULL, &info, NULL);
Expand All @@ -71,13 +76,8 @@ acpi_status acpi_ns_initialize_objects(void)
}

ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
" Initialized %u/%u Regions %u/%u Fields %u/%u "
"Buffers %u/%u Packages (%u nodes)\n",
info.op_region_init, info.op_region_count,
info.field_init, info.field_count,
info.buffer_init, info.buffer_count,
info.package_init, info.package_count,
info.object_count));
"Namespace contains %u (0x%X) objects\n",
info.object_count, info.object_count));

ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"%u Control Methods found\n%u Op Regions found\n",
Expand Down Expand Up @@ -382,34 +382,18 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
acpi_ex_enter_interpreter();

/*
* Each of these types can contain executable AML code within the
* declaration.
* Only initialization of Package objects can be deferred, in order
* to support forward references.
*/
switch (type) {
case ACPI_TYPE_REGION:

info->op_region_init++;
status = acpi_ds_get_region_arguments(obj_desc);
break;

case ACPI_TYPE_BUFFER_FIELD:

info->field_init++;
status = acpi_ds_get_buffer_field_arguments(obj_desc);
break;

case ACPI_TYPE_LOCAL_BANK_FIELD:

/* TBD: bank_fields do not require deferred init, remove this code */

info->field_init++;
status = acpi_ds_get_bank_field_arguments(obj_desc);
break;

case ACPI_TYPE_BUFFER:

info->buffer_init++;
status = acpi_ds_get_buffer_arguments(obj_desc);
break;

case ACPI_TYPE_PACKAGE:

/* Complete the initialization/resolution of the package object */
Expand All @@ -421,8 +405,13 @@ acpi_ns_init_one_object(acpi_handle obj_handle,

default:

/* No other types can get here */
/* No other types should get here */

status = AE_TYPE;
ACPI_EXCEPTION((AE_INFO, status,
"Opcode is not deferred [%4.4s] (%s)",
acpi_ut_get_node_name(node),
acpi_ut_get_type_name(type)));
break;
}

Expand Down
11 changes: 9 additions & 2 deletions drivers/acpi/acpica/utxfinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,25 @@ acpi_status ACPI_INIT_FUNCTION acpi_initialize_objects(u32 flags)

ACPI_FUNCTION_TRACE(acpi_initialize_objects);

#ifdef ACPI_OBSOLETE_BEHAVIOR
/*
* 05/2019: Removed, initialization now happens at both object
* creation and table load time
*/

/*
* Initialize the objects that remain uninitialized. This
* runs the executable AML that may be part of the
* declaration of these objects:
* operation_regions, buffer_fields, Buffers, and Packages.
* declaration of these objects: operation_regions, buffer_fields,
* bank_fields, Buffers, and Packages.
*/
if (!(flags & ACPI_NO_OBJECT_INIT)) {
status = acpi_ns_initialize_objects();
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
}
#endif

/*
* Initialize all device/region objects in the namespace. This runs
Expand Down

0 comments on commit 86a33cf

Please sign in to comment.