]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ACPICA: Never run _REG on system_memory and system_IO
authorBob Moore <robert.moore@intel.com>
Wed, 3 Oct 2018 18:45:38 +0000 (11:45 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 28 Nov 2019 04:59:27 +0000 (23:59 -0500)
BugLink: https://bugs.launchpad.net/bugs/1854216
[ Upstream commit 8b1cafdcb4b75c5027c52f1e82b47ebe727ad7ed ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/acpi/acpica/acevents.h
drivers/acpi/acpica/aclocal.h
drivers/acpi/acpica/evregion.c
drivers/acpi/acpica/evrgnini.c
drivers/acpi/acpica/evxfregn.c

index a2adfd42f85ccbcd0d6774f51e4600939cd9d8c3..bfddcd989974fa5a112f26ac626ccfc64d096269 100644 (file)
@@ -245,6 +245,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
  */
index 0d45b8bb1678945eb296cdabce11f229cb349b65..b10e92de7dd841c4eeaccf276212f61f9da8f080 100644 (file)
@@ -429,9 +429,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;
 };
 
 /*****************************************************************************
index 28b447ff92df6ef7803026ca99a22d974729109a..3a3277f982923baca0713d53f39ca583e6269408 100644 (file)
@@ -677,6 +677,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;
@@ -738,8 +751,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);
index 93ec528bcd9a967770f0c3d9d5a4968e36f2ac28..3b48f1ecb55b1cc5597b9d18e81bf165cd882a3c 100644 (file)
@@ -50,9 +50,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
@@ -67,7 +64,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,
@@ -347,7 +343,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;
index beba9d56a0d8711142fffa9ae5c20cda1f4d7f5e..742a9fe6e235d676e966fb254b61e357e2bc72ab 100644 (file)
@@ -227,7 +227,6 @@ acpi_remove_address_space_handler(acpi_handle device,
                                 */
                                region_obj =
                                    handler_obj->address_space.region_list;
-
                        }
 
                        /* Remove this Handler object from the list */