]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ACPICA: Events: Introduce ACPI_REG_DISCONNECT invocation to acpi_ev_execute_reg_methods()
authorLv Zheng <lv.zheng@intel.com>
Tue, 29 Dec 2015 06:03:43 +0000 (14:03 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 1 Jan 2016 02:47:38 +0000 (03:47 +0100)
ACPICA commit 1cf1a1e090f61f0c27f1dcf1905c7cc79a9c51c8

It is likely that we should synchronously invoke _REG(DISCONNECT) only when
the acpi_remove_address_space_handler() is invoked because of dependencies.
If it is invoked when the object is not referenced, problem may occur
if the operation region fields accessed in _REG are no longer driven by any
device driver.

Noticed that _REG(CONNECT)/_REG(DISCONNECT) only mean to inform the AML of
the handler availability, no return value is required for the caller.

This patch only introduces ACPI_REG_DISCONNECT invaocation, but doesn't
introduce a real change. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/1cf1a1e0
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/acevents.h
drivers/acpi/acpica/aclocal.h
drivers/acpi/acpica/evregion.c
drivers/acpi/acpica/evxfregn.c

index 772ee3c1bdc3d149aa5bd6c7f49fd055152b901b..d18f1840907177e9c928e2d24f2dc1653070393a 100644 (file)
@@ -200,9 +200,9 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
 
 void acpi_ev_associate_reg_method(union acpi_operand_object *region_obj);
 
-acpi_status
+void
 acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
-                           acpi_adr_space_type space_id);
+                           acpi_adr_space_type space_id, u32 function);
 
 acpi_status
 acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function);
index 034402dbc13a6c7cc89f65d9d3c55404b6517a4e..24928ec444de5f2d4a98ceda181bc0a171299e9d 100644 (file)
@@ -428,6 +428,7 @@ struct acpi_simple_repair_info {
 
 struct acpi_reg_walk_info {
        acpi_adr_space_type space_id;
+       u32 function;
        u32 reg_run_count;
 };
 
index cf6e8785491c380267dea15eb6118f9eb2dc1612..a43178f20c593db410ba5ccda6c6259d6676d71c 100644 (file)
@@ -97,10 +97,9 @@ acpi_status acpi_ev_initialize_op_regions(void)
                if (acpi_ev_has_default_handler(acpi_gbl_root_node,
                                                acpi_gbl_default_address_spaces
                                                [i])) {
-                       status =
-                           acpi_ev_execute_reg_methods(acpi_gbl_root_node,
-                                                       acpi_gbl_default_address_spaces
-                                                       [i]);
+                       acpi_ev_execute_reg_methods(acpi_gbl_root_node,
+                                                   acpi_gbl_default_address_spaces
+                                                   [i], ACPI_REG_CONNECT);
                }
        }
 
@@ -683,24 +682,25 @@ cleanup1:
  *
  * PARAMETERS:  node            - Namespace node for the device
  *              space_id        - The address space ID
+ *              function        - Passed to _REG: On (1) or Off (0)
  *
- * RETURN:      Status
+ * RETURN:      None
  *
  * DESCRIPTION: Run all _REG methods for the input Space ID;
  *              Note: assumes namespace is locked, or system init time.
  *
  ******************************************************************************/
 
-acpi_status
+void
 acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
-                           acpi_adr_space_type space_id)
+                           acpi_adr_space_type space_id, u32 function)
 {
-       acpi_status status;
        struct acpi_reg_walk_info info;
 
        ACPI_FUNCTION_TRACE(ev_execute_reg_methods);
 
        info.space_id = space_id;
+       info.function = function;
        info.reg_run_count = 0;
 
        ACPI_DEBUG_PRINT_RAW((ACPI_DB_NAMES,
@@ -713,9 +713,9 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
         * regions and _REG methods. (i.e. handlers must be installed for all
         * regions of this Space ID before we can run any _REG methods)
         */
-       status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, node, ACPI_UINT32_MAX,
-                                       ACPI_NS_WALK_UNLOCK, acpi_ev_reg_run,
-                                       NULL, &info, NULL);
+       (void)acpi_ns_walk_namespace(ACPI_TYPE_ANY, node, ACPI_UINT32_MAX,
+                                    ACPI_NS_WALK_UNLOCK, acpi_ev_reg_run, NULL,
+                                    &info, NULL);
 
        /* Special case for EC: handle "orphan" _REG methods with no region */
 
@@ -728,7 +728,7 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
                              info.reg_run_count,
                              acpi_ut_get_region_name(info.space_id)));
 
-       return_ACPI_STATUS(status);
+       return_VOID;
 }
 
 /*******************************************************************************
@@ -787,7 +787,7 @@ acpi_ev_reg_run(acpi_handle obj_handle,
        }
 
        info->reg_run_count++;
-       status = acpi_ev_execute_reg_method(obj_desc, ACPI_REG_CONNECT);
+       status = acpi_ev_execute_reg_method(obj_desc, info->function);
        return (status);
 }
 
index 29f9f3999dfcbcd9912153d407f81fd89bed1c6e..35f9e60ce2b7f091971fb4aa36bb62ecacfe8f66 100644 (file)
@@ -114,7 +114,7 @@ acpi_install_address_space_handler(acpi_handle device,
 
        /* Run all _REG methods for this address space */
 
-       status = acpi_ev_execute_reg_methods(node, space_id);
+       acpi_ev_execute_reg_methods(node, space_id, ACPI_REG_CONNECT);
 
 unlock_and_exit:
        (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);