Skip to content

Commit

Permalink
Merge branch 'acpica'
Browse files Browse the repository at this point in the history
* acpica:
  ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT support
  ACPICA: Utilities: Update trace mechinism for acquire_object
  ACPICA: Namespace: Rename acpi_gbl_reg_methods_enabled to acpi_gbl_namespace_initialized
  ACPICA: Namespace: Ensure \_SB._INI executed before any _REG
  ACPICA: ACPICA: Tune _REG evaluations order in the initialization steps
  ACPICA: Tables: make default region accessible during the table load
  ACPICA: ACPI 6.0/iASL: Add support for the External AML opcode
  ACPICA: Remove unnecessary arguments to ACPI_INFO
  ACPICA: debugger: dbconvert: free pld_info on error return path
  ACPICA: iASL: Update to use internal acpi_ut_strtoul64 function
  ACPICA: iASL: Fix some typos with the name strtoul64
  ACPICA: Remove incorrect "static" from a global structure
  ACPICA: aclocal: Put parens around some definitions.
  • Loading branch information
Rafael J. Wysocki committed Mar 14, 2016
2 parents b562e44 + 5508df8 commit 255a60f
Show file tree
Hide file tree
Showing 26 changed files with 374 additions and 190 deletions.
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ ACPI_GLOBAL(u8, acpi_gbl_next_owner_id_offset);

/* Initialization sequencing */

ACPI_INIT_GLOBAL(u8, acpi_gbl_reg_methods_enabled, FALSE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_namespace_initialized, FALSE);

/* Misc */

Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ union acpi_parse_object;
#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */

#define ACPI_MAX_MUTEX 5
#define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1
#define ACPI_NUM_MUTEX (ACPI_MAX_MUTEX+1)

/* Lock structure for reader/writer interfaces */

Expand All @@ -103,11 +103,11 @@ struct acpi_rw_lock {
#define ACPI_LOCK_HARDWARE 1

#define ACPI_MAX_LOCK 1
#define ACPI_NUM_LOCK ACPI_MAX_LOCK+1
#define ACPI_NUM_LOCK (ACPI_MAX_LOCK+1)

/* This Thread ID means that the mutex is not in use (unlocked) */

#define ACPI_MUTEX_NOT_ACQUIRED (acpi_thread_id) 0
#define ACPI_MUTEX_NOT_ACQUIRED ((acpi_thread_id) 0)

/* This Thread ID means an invalid thread ID */

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acnamesp.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
*/
acpi_status acpi_ns_initialize_objects(void);

acpi_status acpi_ns_initialize_devices(void);
acpi_status acpi_ns_initialize_devices(u32 flags);

/*
* nsload - Namespace loading
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acpredef.h
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ const union acpi_predefined_info acpi_gbl_resource_names[] = {
PACKAGE_INFO(0, 0, 0, 0, 0, 0) /* Table terminator */
};

static const union acpi_predefined_info acpi_gbl_scope_names[] = {
const union acpi_predefined_info acpi_gbl_scope_names[] = {
{{"_GPE", 0, 0}},
{{"_PR_", 0, 0}},
{{"_SB_", 0, 0}},
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/dbcmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ void acpi_db_display_table_info(char *table_arg)
} else {
/* If the pointer is null, the table has been unloaded */

ACPI_INFO((AE_INFO, "%4.4s - Table has been unloaded",
ACPI_INFO(("%4.4s - Table has been unloaded",
table_desc->signature.ascii));
}
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/acpi/acpica/dbconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ void acpi_db_dump_pld_buffer(union acpi_object *obj_desc)

new_buffer = acpi_db_encode_pld_buffer(pld_info);
if (!new_buffer) {
return;
goto exit;
}

/* The two bit-packed buffers should match */
Expand Down Expand Up @@ -479,6 +479,7 @@ void acpi_db_dump_pld_buffer(union acpi_object *obj_desc)
pld_info->horizontal_offset);
}

ACPI_FREE(pld_info);
ACPI_FREE(new_buffer);
exit:
ACPI_FREE(pld_info);
}
3 changes: 1 addition & 2 deletions drivers/acpi/acpica/dsmethod.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
if (method_desc->method.
info_flags & ACPI_METHOD_SERIALIZED_PENDING) {
if (walk_state) {
ACPI_INFO((AE_INFO,
"Marking method %4.4s as Serialized "
ACPI_INFO(("Marking method %4.4s as Serialized "
"because of AE_ALREADY_EXISTS error",
walk_state->method_node->name.
ascii));
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/acpica/dsobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
arg = arg->common.next;
}

ACPI_INFO((AE_INFO,
"Actual Package length (%u) is larger than "
ACPI_INFO(("Actual Package length (%u) is larger than "
"NumElements field (%u), truncated",
i, element_count));
} else if (i < element_count) {
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/acpica/evgpeblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,7 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
}

if (gpe_enabled_count) {
ACPI_INFO((AE_INFO,
"Enabled %u GPEs in block %02X to %02X",
ACPI_INFO(("Enabled %u GPEs in block %02X to %02X",
gpe_enabled_count, (u32)gpe_block->block_base_number,
(u32)(gpe_block->block_base_number +
(gpe_block->gpe_count - 1))));
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/evgpeinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void acpi_ev_update_gpes(acpi_owner_id table_owner_id)
}

if (walk_info.count) {
ACPI_INFO((AE_INFO, "Enabled %u new GPEs", walk_info.count));
ACPI_INFO(("Enabled %u new GPEs", walk_info.count));
}

(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/evregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)

if (region_obj2->extra.method_REG == NULL ||
region_obj->region.handler == NULL ||
!acpi_gbl_reg_methods_enabled) {
!acpi_gbl_namespace_initialized) {
return_ACPI_STATUS(AE_OK);
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/exconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,

status = acpi_get_table_by_index(table_index, &table);
if (ACPI_SUCCESS(status)) {
ACPI_INFO((AE_INFO, "Dynamic OEM Table Load:"));
ACPI_INFO(("Dynamic OEM Table Load:"));
acpi_tb_print_table_header(0, table);
}

Expand Down Expand Up @@ -472,7 +472,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,

/* Install the new table into the local data structures */

ACPI_INFO((AE_INFO, "Dynamic OEM Table Load:"));
ACPI_INFO(("Dynamic OEM Table Load:"));
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);

status = acpi_tb_install_standard_table(ACPI_PTR_TO_PHYSADDR(table),
Expand Down
4 changes: 3 additions & 1 deletion drivers/acpi/acpica/exoparg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
* op is intended for use by disassemblers in order to properly
* disassemble control method invocations. The opcode or group of
* opcodes should be surrounded by an "if (0)" clause to ensure that
* AML interpreters never see the opcode.
* AML interpreters never see the opcode. Thus, something is
* wrong if an external opcode ever gets here.
*/
ACPI_ERROR((AE_INFO, "Executed External Op"));
status = AE_OK;
goto cleanup;

Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/acpica/nseval.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,7 @@ void acpi_ns_exec_module_code_list(void)
acpi_ut_remove_reference(prev);
}

ACPI_INFO((AE_INFO,
"Executed %u blocks of module-level executable AML code",
ACPI_INFO(("Executed %u blocks of module-level executable AML code",
method_count));

ACPI_FREE(info);
Expand Down
137 changes: 83 additions & 54 deletions drivers/acpi/acpica/nsinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "acnamesp.h"
#include "acdispat.h"
#include "acinterp.h"
#include "acevents.h"

#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME("nsinit")
Expand Down Expand Up @@ -83,6 +84,8 @@ acpi_status acpi_ns_initialize_objects(void)

ACPI_FUNCTION_TRACE(ns_initialize_objects);

ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"[Init] Completing Initialization of ACPI Objects\n"));
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
Expand Down Expand Up @@ -133,82 +136,108 @@ acpi_status acpi_ns_initialize_objects(void)
*
******************************************************************************/

acpi_status acpi_ns_initialize_devices(void)
acpi_status acpi_ns_initialize_devices(u32 flags)
{
acpi_status status;
acpi_status status = AE_OK;
struct acpi_device_walk_info info;

ACPI_FUNCTION_TRACE(ns_initialize_devices);

/* Init counters */
if (!(flags & ACPI_NO_DEVICE_INIT)) {
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"[Init] Initializing ACPI Devices\n"));

info.device_count = 0;
info.num_STA = 0;
info.num_INI = 0;
/* Init counters */

ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Initializing Device/Processor/Thermal objects "
"and executing _INI/_STA methods:\n"));
info.device_count = 0;
info.num_STA = 0;
info.num_INI = 0;

/* Tree analysis: find all subtrees that contain _INI methods */
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Initializing Device/Processor/Thermal objects "
"and executing _INI/_STA methods:\n"));

status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE,
acpi_ns_find_ini_methods, NULL, &info,
NULL);
if (ACPI_FAILURE(status)) {
goto error_exit;
}
/* Tree analysis: find all subtrees that contain _INI methods */

status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE,
acpi_ns_find_ini_methods, NULL,
&info, NULL);
if (ACPI_FAILURE(status)) {
goto error_exit;
}

/* Allocate the evaluation information block */

/* Allocate the evaluation information block */
info.evaluate_info =
ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
if (!info.evaluate_info) {
status = AE_NO_MEMORY;
goto error_exit;
}

info.evaluate_info =
ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
if (!info.evaluate_info) {
status = AE_NO_MEMORY;
goto error_exit;
/*
* Execute the "global" _INI method that may appear at the root.
* This support is provided for Windows compatibility (Vista+) and
* is not part of the ACPI specification.
*/
info.evaluate_info->prefix_node = acpi_gbl_root_node;
info.evaluate_info->relative_pathname = METHOD_NAME__INI;
info.evaluate_info->parameters = NULL;
info.evaluate_info->flags = ACPI_IGNORE_RETURN_VALUE;

status = acpi_ns_evaluate(info.evaluate_info);
if (ACPI_SUCCESS(status)) {
info.num_INI++;
}
}

/*
* Execute the "global" _INI method that may appear at the root. This
* support is provided for Windows compatibility (Vista+) and is not
* part of the ACPI specification.
* Run all _REG methods
*
* Note: Any objects accessed by the _REG methods will be automatically
* initialized, even if they contain executable AML (see the call to
* acpi_ns_initialize_objects below).
*/
info.evaluate_info->prefix_node = acpi_gbl_root_node;
info.evaluate_info->relative_pathname = METHOD_NAME__INI;
info.evaluate_info->parameters = NULL;
info.evaluate_info->flags = ACPI_IGNORE_RETURN_VALUE;
if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"[Init] Executing _REG OpRegion methods\n"));

status = acpi_ns_evaluate(info.evaluate_info);
if (ACPI_SUCCESS(status)) {
info.num_INI++;
status = acpi_ev_initialize_op_regions();
if (ACPI_FAILURE(status)) {
goto error_exit;
}
}

/* Walk namespace to execute all _INIs on present devices */
if (!(flags & ACPI_NO_DEVICE_INIT)) {

status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE,
acpi_ns_init_one_device, NULL, &info,
NULL);
/* Walk namespace to execute all _INIs on present devices */

/*
* Any _OSI requests should be completed by now. If the BIOS has
* requested any Windows OSI strings, we will always truncate
* I/O addresses to 16 bits -- for Windows compatibility.
*/
if (acpi_gbl_osi_data >= ACPI_OSI_WIN_2000) {
acpi_gbl_truncate_io_addresses = TRUE;
}
status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE,
acpi_ns_init_one_device, NULL,
&info, NULL);

ACPI_FREE(info.evaluate_info);
if (ACPI_FAILURE(status)) {
goto error_exit;
}
/*
* Any _OSI requests should be completed by now. If the BIOS has
* requested any Windows OSI strings, we will always truncate
* I/O addresses to 16 bits -- for Windows compatibility.
*/
if (acpi_gbl_osi_data >= ACPI_OSI_WIN_2000) {
acpi_gbl_truncate_io_addresses = TRUE;
}

ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
" Executed %u _INI methods requiring %u _STA executions "
"(examined %u objects)\n",
info.num_INI, info.num_STA, info.device_count));
ACPI_FREE(info.evaluate_info);
if (ACPI_FAILURE(status)) {
goto error_exit;
}

ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
" Executed %u _INI methods requiring %u _STA executions "
"(examined %u objects)\n",
info.num_INI, info.num_STA,
info.device_count));
}

return_ACPI_STATUS(status);

Expand Down
5 changes: 2 additions & 3 deletions drivers/acpi/acpica/tbinstal.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ acpi_tb_install_standard_table(acpi_physical_address address,
if (!reload &&
acpi_gbl_disable_ssdt_table_install &&
ACPI_COMPARE_NAME(&new_table_desc.signature, ACPI_SIG_SSDT)) {
ACPI_INFO((AE_INFO,
"Ignoring installation of %4.4s at %8.8X%8.8X",
ACPI_INFO(("Ignoring installation of %4.4s at %8.8X%8.8X",
new_table_desc.signature.ascii,
ACPI_FORMAT_UINT64(address)));
goto release_and_exit;
Expand Down Expand Up @@ -432,7 +431,7 @@ void acpi_tb_override_table(struct acpi_table_desc *old_table_desc)
return;
}

ACPI_INFO((AE_INFO, "%4.4s 0x%8.8X%8.8X"
ACPI_INFO(("%4.4s 0x%8.8X%8.8X"
" %s table override, new table: 0x%8.8X%8.8X",
old_table_desc->signature.ascii,
ACPI_FORMAT_UINT64(old_table_desc->address),
Expand Down
7 changes: 3 additions & 4 deletions drivers/acpi/acpica/tbprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ acpi_tb_print_table_header(acpi_physical_address address,

/* FACS only has signature and length fields */

ACPI_INFO((AE_INFO, "%-4.4s 0x%8.8X%8.8X %06X",
ACPI_INFO(("%-4.4s 0x%8.8X%8.8X %06X",
header->signature, ACPI_FORMAT_UINT64(address),
header->length));
} else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) {
Expand All @@ -144,7 +144,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
ACPI_OEM_ID_SIZE);
acpi_tb_fix_string(local_header.oem_id, ACPI_OEM_ID_SIZE);

ACPI_INFO((AE_INFO, "RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
ACPI_INFO(("RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
ACPI_FORMAT_UINT64(address),
(ACPI_CAST_PTR(struct acpi_table_rsdp, header)->
revision >
Expand All @@ -158,8 +158,7 @@ acpi_tb_print_table_header(acpi_physical_address address,

acpi_tb_cleanup_table_header(&local_header, header);

ACPI_INFO((AE_INFO,
"%-4.4s 0x%8.8X%8.8X"
ACPI_INFO(("%-4.4s 0x%8.8X%8.8X"
" %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
local_header.signature, ACPI_FORMAT_UINT64(address),
local_header.length, local_header.revision,
Expand Down
Loading

0 comments on commit 255a60f

Please sign in to comment.