Skip to content

Commit

Permalink
ACPICA: Never run _REG on system_memory and system_IO
Browse files Browse the repository at this point in the history
These address spaces are defined by the ACPI spec to be
"always available", and thus _REG should never be run on them.
Provides compatibility with other ACPI implementations.

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 Oct 4, 2018
1 parent 9e9f873 commit 8b1cafd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/acevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ acpi_ev_default_region_setup(acpi_handle handle,

acpi_status acpi_ev_initialize_region(union acpi_operand_object *region_obj);

u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node);

/*
* evsci - SCI (System Control Interrupt) handling/dispatch
*/
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,9 @@ struct acpi_simple_repair_info {
/* Info for running the _REG methods */

struct acpi_reg_walk_info {
acpi_adr_space_type space_id;
u32 function;
u32 reg_run_count;
acpi_adr_space_type space_id;
};

/*****************************************************************************
Expand Down
17 changes: 15 additions & 2 deletions drivers/acpi/acpica/evregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,19 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,

ACPI_FUNCTION_TRACE(ev_execute_reg_methods);

/*
* These address spaces do not need a call to _REG, since the ACPI
* specification defines them as: "must always be accessible". Since
* they never change state (never become unavailable), no need to ever
* call _REG on them. Also, a data_table is not a "real" address space,
* so do not call _REG. September 2018.
*/
if ((space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) ||
(space_id == ACPI_ADR_SPACE_SYSTEM_IO) ||
(space_id == ACPI_ADR_SPACE_DATA_TABLE)) {
return_VOID;
}

info.space_id = space_id;
info.function = function;
info.reg_run_count = 0;
Expand Down Expand Up @@ -714,8 +727,8 @@ acpi_ev_reg_run(acpi_handle obj_handle,
}

/*
* We only care about regions.and objects that are allowed to have address
* space handlers
* We only care about regions and objects that are allowed to have
* address space handlers
*/
if ((node->type != ACPI_TYPE_REGION) && (node != acpi_gbl_root_node)) {
return (AE_OK);
Expand Down
6 changes: 1 addition & 5 deletions drivers/acpi/acpica/evrgnini.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME("evrgnini")

/* Local prototypes */
static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node);

/*******************************************************************************
*
* FUNCTION: acpi_ev_system_memory_region_setup
Expand All @@ -33,7 +30,6 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node);
* DESCRIPTION: Setup a system_memory operation region
*
******************************************************************************/

acpi_status
acpi_ev_system_memory_region_setup(acpi_handle handle,
u32 function,
Expand Down Expand Up @@ -313,7 +309,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
*
******************************************************************************/

static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
{
acpi_status status;
struct acpi_pnp_device_id *hid;
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/acpica/evxfregn.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ acpi_remove_address_space_handler(acpi_handle device,
*/
region_obj =
handler_obj->address_space.region_list;

}

/* Remove this Handler object from the list */
Expand Down

0 comments on commit 8b1cafd

Please sign in to comment.