^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Module Name: evmisc - Miscellaneous event manager support functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 2000 - 2020, Intel Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <acpi/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include "accommon.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include "acevents.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include "acnamesp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define _COMPONENT ACPI_EVENTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ACPI_MODULE_NAME("evmisc")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) /* Local prototypes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * FUNCTION: acpi_ev_is_notify_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * PARAMETERS: node - Node to check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * RETURN: TRUE if notifies allowed on this object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * DESCRIPTION: Check type of node for a object that supports notifies.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * TBD: This could be replaced by a flag bit in the node.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) switch (node->type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) case ACPI_TYPE_DEVICE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) case ACPI_TYPE_PROCESSOR:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) case ACPI_TYPE_THERMAL:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * These are the ONLY objects that can receive ACPI notifications
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) return (TRUE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) return (FALSE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * FUNCTION: acpi_ev_queue_notify_request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) * PARAMETERS: node - NS node for the notified object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) * notify_value - Value from the Notify() request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) * RETURN: Status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) * DESCRIPTION: Dispatch a device notification event to a previously
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) * installed handler.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) acpi_ev_queue_notify_request(struct acpi_namespace_node *node, u32 notify_value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) union acpi_operand_object *obj_desc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) union acpi_operand_object *handler_list_head = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) union acpi_generic_state *info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) u8 handler_list_id = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) acpi_status status = AE_OK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) ACPI_FUNCTION_NAME(ev_queue_notify_request);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) /* Are Notifies allowed on this object? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) if (!acpi_ev_is_notify_object(node)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) return (AE_TYPE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) /* Get the correct notify list type (System or Device) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) handler_list_id = ACPI_SYSTEM_HANDLER_LIST;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) } else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) handler_list_id = ACPI_DEVICE_HANDLER_LIST;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) /* Get the notify object attached to the namespace Node */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) obj_desc = acpi_ns_get_attached_object(node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) if (obj_desc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) /* We have an attached object, Get the correct handler list */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) handler_list_head =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) obj_desc->common_notify.notify_list[handler_list_id];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) * If there is no notify handler (Global or Local)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) * for this object, just ignore the notify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) if (!acpi_gbl_global_notify[handler_list_id].handler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) && !handler_list_head) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) ACPI_DEBUG_PRINT((ACPI_DB_INFO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) "No notify handler for Notify, ignoring (%4.4s, %X) node %p\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) acpi_ut_get_node_name(node), notify_value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) return (AE_OK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) /* Setup notify info and schedule the notify dispatcher */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) info = acpi_ut_create_generic_state();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) if (!info) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) return (AE_NO_MEMORY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) info->common.descriptor_type = ACPI_DESC_TYPE_STATE_NOTIFY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) info->notify.node = node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) info->notify.value = (u16)notify_value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) info->notify.handler_list_id = handler_list_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) info->notify.handler_list_head = handler_list_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) info->notify.global = &acpi_gbl_global_notify[handler_list_id];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) ACPI_DEBUG_PRINT((ACPI_DB_INFO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) acpi_ut_get_node_name(node),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) acpi_ut_get_type_name(node->type), notify_value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) acpi_ut_get_notify_name(notify_value, ACPI_TYPE_ANY),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) node));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) status = acpi_os_execute(OSL_NOTIFY_HANDLER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) acpi_ev_notify_dispatch, info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) acpi_ut_delete_generic_state(info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) return (status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) * FUNCTION: acpi_ev_notify_dispatch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) * PARAMETERS: context - To be passed to the notify handler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) * RETURN: None.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) * DESCRIPTION: Dispatch a device notification event to a previously
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) * installed handler.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) union acpi_generic_state *info = (union acpi_generic_state *)context;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) union acpi_operand_object *handler_obj;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) ACPI_FUNCTION_ENTRY();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) /* Invoke a global notify handler if installed */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) if (info->notify.global->handler) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) info->notify.global->handler(info->notify.node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) info->notify.value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) info->notify.global->context);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) /* Now invoke the local notify handler(s) if any are installed */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) handler_obj = info->notify.handler_list_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) while (handler_obj) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) handler_obj->notify.handler(info->notify.node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) info->notify.value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) handler_obj->notify.context);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) handler_obj =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) handler_obj->notify.next[info->notify.handler_list_id];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) /* All done with the info object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) acpi_ut_delete_generic_state(info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) #if (!ACPI_REDUCED_HARDWARE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) * FUNCTION: acpi_ev_terminate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) * PARAMETERS: none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) * RETURN: none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) * DESCRIPTION: Disable events and free memory allocated for table storage.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) void acpi_ev_terminate(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) u32 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) ACPI_FUNCTION_TRACE(ev_terminate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) if (acpi_gbl_events_initialized) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) * Disable all event-related functionality. In all cases, on error,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) * print a message but obviously we don't abort.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) /* Disable all fixed events */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) status = acpi_disable_event(i, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) ACPI_ERROR((AE_INFO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) "Could not disable fixed event %u",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) (u32) i));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) /* Disable all GPEs in all GPE blocks */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) ACPI_EXCEPTION((AE_INFO, status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) "Could not disable GPEs in GPE block"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) status = acpi_ev_remove_global_lock_handler();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) ACPI_EXCEPTION((AE_INFO, status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) "Could not remove Global Lock handler"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) acpi_gbl_events_initialized = FALSE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) /* Remove SCI handlers */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) status = acpi_ev_remove_all_sci_handlers();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) ACPI_ERROR((AE_INFO, "Could not remove SCI handler"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) /* Deallocate all handler objects installed within GPE info structs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) status = acpi_ev_walk_gpe_list(acpi_ev_delete_gpe_handlers, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) ACPI_EXCEPTION((AE_INFO, status,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) "Could not delete GPE handlers"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) /* Return to original mode if necessary */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) status = acpi_disable();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) ACPI_WARNING((AE_INFO, "AcpiDisable failed"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) return_VOID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) #endif /* !ACPI_REDUCED_HARDWARE */