Commit f7eae09b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branch 'acpica'

Merge additional ACPICA changes for 6.2-rc1:

 - Avoid trying to resolve operands in AML when there are none (Amadeusz
   Sławiński).

 - Fix indentation in include/acpi/acpixf.h to help applying patches
   from the upstream ACPICA git (Hans de Goede).

 - Make it possible to install an address space handler without
   evaluating _REG for Operation Regions in the given address space (Hans
   de Goede).

* acpica:
  ACPICA: Allow address_space_handler Install and _REG execution as 2 separate steps
  ACPICA: include/acpi/acpixf.h: Fix indentation
  ACPICA: Fix operand resolution
parents bee74dcb 54c516ae
...@@ -389,9 +389,11 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) ...@@ -389,9 +389,11 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
/* /*
* All opcodes require operand resolution, with the only exceptions * All opcodes require operand resolution, with the only exceptions
* being the object_type and size_of operators. * being the object_type and size_of operators as well as opcodes that
* take no arguments.
*/ */
if (!(walk_state->op_info->flags & AML_NO_OPERAND_RESOLVE)) { if (!(walk_state->op_info->flags & AML_NO_OPERAND_RESOLVE) &&
(walk_state->op_info->flags & AML_HAS_ARGS)) {
/* Resolve all operands */ /* Resolve all operands */
......
...@@ -20,13 +20,14 @@ ACPI_MODULE_NAME("evxfregn") ...@@ -20,13 +20,14 @@ ACPI_MODULE_NAME("evxfregn")
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_install_address_space_handler * FUNCTION: acpi_install_address_space_handler_internal
* *
* PARAMETERS: device - Handle for the device * PARAMETERS: device - Handle for the device
* space_id - The address space ID * space_id - The address space ID
* handler - Address of the handler * handler - Address of the handler
* setup - Address of the setup function * setup - Address of the setup function
* context - Value passed to the handler on each access * context - Value passed to the handler on each access
* Run_reg - Run _REG methods for this address space?
* *
* RETURN: Status * RETURN: Status
* *
...@@ -37,13 +38,16 @@ ACPI_MODULE_NAME("evxfregn") ...@@ -37,13 +38,16 @@ ACPI_MODULE_NAME("evxfregn")
* are executed here, and these methods can only be safely executed after * are executed here, and these methods can only be safely executed after
* the default handlers have been installed and the hardware has been * the default handlers have been installed and the hardware has been
* initialized (via acpi_enable_subsystem.) * initialized (via acpi_enable_subsystem.)
* To avoid this problem pass FALSE for Run_Reg and later on call
* acpi_execute_reg_methods() to execute _REG.
* *
******************************************************************************/ ******************************************************************************/
acpi_status static acpi_status
acpi_install_address_space_handler(acpi_handle device, acpi_install_address_space_handler_internal(acpi_handle device,
acpi_adr_space_type space_id, acpi_adr_space_type space_id,
acpi_adr_space_handler handler, acpi_adr_space_handler handler,
acpi_adr_space_setup setup, void *context) acpi_adr_space_setup setup,
void *context, u8 run_reg)
{ {
struct acpi_namespace_node *node; struct acpi_namespace_node *node;
acpi_status status; acpi_status status;
...@@ -80,14 +84,40 @@ acpi_install_address_space_handler(acpi_handle device, ...@@ -80,14 +84,40 @@ acpi_install_address_space_handler(acpi_handle device,
/* Run all _REG methods for this address space */ /* Run all _REG methods for this address space */
if (run_reg) {
acpi_ev_execute_reg_methods(node, space_id, ACPI_REG_CONNECT); acpi_ev_execute_reg_methods(node, space_id, ACPI_REG_CONNECT);
}
unlock_and_exit: unlock_and_exit:
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
acpi_status
acpi_install_address_space_handler(acpi_handle device,
acpi_adr_space_type space_id,
acpi_adr_space_handler handler,
acpi_adr_space_setup setup, void *context)
{
return acpi_install_address_space_handler_internal(device, space_id,
handler, setup,
context, TRUE);
}
ACPI_EXPORT_SYMBOL(acpi_install_address_space_handler) ACPI_EXPORT_SYMBOL(acpi_install_address_space_handler)
acpi_status
acpi_install_address_space_handler_no_reg(acpi_handle device,
acpi_adr_space_type space_id,
acpi_adr_space_handler handler,
acpi_adr_space_setup setup,
void *context)
{
return acpi_install_address_space_handler_internal(device, space_id,
handler, setup,
context, FALSE);
}
ACPI_EXPORT_SYMBOL(acpi_install_address_space_handler_no_reg)
/******************************************************************************* /*******************************************************************************
* *
...@@ -228,3 +258,51 @@ acpi_remove_address_space_handler(acpi_handle device, ...@@ -228,3 +258,51 @@ acpi_remove_address_space_handler(acpi_handle device,
} }
ACPI_EXPORT_SYMBOL(acpi_remove_address_space_handler) ACPI_EXPORT_SYMBOL(acpi_remove_address_space_handler)
/*******************************************************************************
*
* FUNCTION: acpi_execute_reg_methods
*
* PARAMETERS: device - Handle for the device
* space_id - The address space ID
*
* RETURN: Status
*
* DESCRIPTION: Execute _REG for all op_regions of a given space_id.
*
******************************************************************************/
acpi_status
acpi_execute_reg_methods(acpi_handle device, acpi_adr_space_type space_id)
{
struct acpi_namespace_node *node;
acpi_status status;
ACPI_FUNCTION_TRACE(acpi_execute_reg_methods);
/* Parameter validation */
if (!device) {
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Convert and validate the device handle */
node = acpi_ns_validate_handle(device);
if (node) {
/* Run all _REG methods for this address space */
acpi_ev_execute_reg_methods(node, space_id, ACPI_REG_CONNECT);
} else {
status = AE_BAD_PARAMETER;
}
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
return_ACPI_STATUS(status);
}
ACPI_EXPORT_SYMBOL(acpi_execute_reg_methods)
...@@ -652,6 +652,16 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status ...@@ -652,6 +652,16 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
acpi_adr_space_setup acpi_adr_space_setup
setup, setup,
void *context)) void *context))
ACPI_EXTERNAL_RETURN_STATUS(acpi_status
acpi_install_address_space_handler_no_reg
(acpi_handle device, acpi_adr_space_type space_id,
acpi_adr_space_handler handler,
acpi_adr_space_setup setup,
void *context))
ACPI_EXTERNAL_RETURN_STATUS(acpi_status
acpi_execute_reg_methods(acpi_handle device,
acpi_adr_space_type
space_id))
ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_EXTERNAL_RETURN_STATUS(acpi_status
acpi_remove_address_space_handler(acpi_handle acpi_remove_address_space_handler(acpi_handle
device, device,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment