]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ACPICA: Add a depth argument to acpi_execute_reg_methods()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 12 Apr 2026 01:02:29 +0000 (21:02 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Apr 2026 08:35:57 +0000 (10:35 +0200)
[ Upstream commit cdf65d73e001fde600b18d7e45afadf559425ce5 ]

A subsequent change will need to pass a depth argument to
acpi_execute_reg_methods(), so prepare that function for it.

No intentional functional changes.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Cc: All applicable <stable@vger.kernel.org>
Link: https://patch.msgid.link/8451567.NyiUUSuA9g@rjwysocki.net
Stable-dep-of: 71bf41b8e913 ("ACPI: EC: Evaluate _REG outside the EC scope more carefully")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/acpica/acevents.h
drivers/acpi/acpica/evregion.c
drivers/acpi/acpica/evxfregn.c
drivers/acpi/ec.c
include/acpi/acpixf.h

index 922f559a3e5902f380099307c742ca30f63a723e..aab04e5c7b41c27bc59958e96a605993ef10ec54 100644 (file)
@@ -188,7 +188,7 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
                      u8 acpi_ns_is_locked);
 
 void
-acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
+acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, u32 max_depth,
                            acpi_adr_space_type space_id, u32 function);
 
 acpi_status
index fd6471e764f1a1f8481ef066300129d0faa6aebe..ee04eea450894dae8b1670f0991f7de3ee91d1a7 100644 (file)
@@ -65,6 +65,7 @@ acpi_status acpi_ev_initialize_op_regions(void)
                                                acpi_gbl_default_address_spaces
                                                [i])) {
                        acpi_ev_execute_reg_methods(acpi_gbl_root_node,
+                                                   ACPI_UINT32_MAX,
                                                    acpi_gbl_default_address_spaces
                                                    [i], ACPI_REG_CONNECT);
                }
@@ -665,6 +666,7 @@ cleanup1:
  * FUNCTION:    acpi_ev_execute_reg_methods
  *
  * PARAMETERS:  node            - Namespace node for the device
+ *              max_depth       - Depth to which search for _REG
  *              space_id        - The address space ID
  *              function        - Passed to _REG: On (1) or Off (0)
  *
@@ -676,7 +678,7 @@ cleanup1:
  ******************************************************************************/
 
 void
-acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
+acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, u32 max_depth,
                            acpi_adr_space_type space_id, u32 function)
 {
        struct acpi_reg_walk_info info;
@@ -710,7 +712,7 @@ 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)
         */
-       (void)acpi_ns_walk_namespace(ACPI_TYPE_ANY, node, ACPI_UINT32_MAX,
+       (void)acpi_ns_walk_namespace(ACPI_TYPE_ANY, node, max_depth,
                                     ACPI_NS_WALK_UNLOCK, acpi_ev_reg_run, NULL,
                                     &info, NULL);
 
index e94e6631502c101dd4facb6d5c59237ffa06d77a..0689eb3fceaf9cef4a213d54d45de63b8405835b 100644 (file)
@@ -85,7 +85,8 @@ acpi_install_address_space_handler_internal(acpi_handle device,
        /* 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, ACPI_UINT32_MAX, space_id,
+                                           ACPI_REG_CONNECT);
        }
 
 unlock_and_exit:
@@ -261,6 +262,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_address_space_handler)
  * FUNCTION:    acpi_execute_reg_methods
  *
  * PARAMETERS:  device          - Handle for the device
+ *              max_depth       - Depth to which search for _REG
  *              space_id        - The address space ID
  *
  * RETURN:      Status
@@ -269,7 +271,8 @@ ACPI_EXPORT_SYMBOL(acpi_remove_address_space_handler)
  *
  ******************************************************************************/
 acpi_status
-acpi_execute_reg_methods(acpi_handle device, acpi_adr_space_type space_id)
+acpi_execute_reg_methods(acpi_handle device, u32 max_depth,
+                        acpi_adr_space_type space_id)
 {
        struct acpi_namespace_node *node;
        acpi_status status;
@@ -294,7 +297,8 @@ acpi_execute_reg_methods(acpi_handle device, acpi_adr_space_type space_id)
 
                /* Run all _REG methods for this address space */
 
-               acpi_ev_execute_reg_methods(node, space_id, ACPI_REG_CONNECT);
+               acpi_ev_execute_reg_methods(node, max_depth, space_id,
+                                           ACPI_REG_CONNECT);
        } else {
                status = AE_BAD_PARAMETER;
        }
index 230fe6463cc1f5fbdfe41bcbe2a3f6e0eba2bebf..d0ce8ec19df5a2e79f5397de6e652204d93bba0b 100644 (file)
@@ -1531,7 +1531,7 @@ static int ec_install_handlers(struct acpi_ec *ec, struct acpi_device *device,
        }
 
        if (call_reg && !test_bit(EC_FLAGS_EC_REG_CALLED, &ec->flags)) {
-               acpi_execute_reg_methods(scope_handle, ACPI_ADR_SPACE_EC);
+               acpi_execute_reg_methods(scope_handle, ACPI_UINT32_MAX, ACPI_ADR_SPACE_EC);
                set_bit(EC_FLAGS_EC_REG_CALLED, &ec->flags);
        }
 
index 754efb4e633071ffea6188dc481d7f86ddd8a9a1..fb821b5e88e61daacea4a5657c70c305953e2393 100644 (file)
@@ -666,6 +666,7 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status
                             void *context))
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
                            acpi_execute_reg_methods(acpi_handle device,
+                                                    u32 nax_depth,
                                                     acpi_adr_space_type
                                                     space_id))
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status