Skip to content

Commit

Permalink
event: don't forget to uninstall the SCI handler during state reset
Browse files Browse the repository at this point in the history
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
  • Loading branch information
d-tatianin committed Dec 30, 2024
1 parent cdba73b commit 9b2898a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/uacpi/internal/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct uacpi_runtime_context {
#ifndef UACPI_REDUCED_HARDWARE
uacpi_bool is_hardware_reduced;
uacpi_bool has_global_lock;
uacpi_bool sci_handle_valid;
uacpi_handle sci_handle;
#endif
uacpi_u64 opcodes_executed;
Expand Down
8 changes: 8 additions & 0 deletions source/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -2146,6 +2146,7 @@ uacpi_status uacpi_initialize_events(void)
);
return ret;
}
g_uacpi_rt_ctx.sci_handle_valid = UACPI_TRUE;

g_uacpi_rt_ctx.global_lock_event = uacpi_kernel_create_event();
if (uacpi_unlikely(g_uacpi_rt_ctx.global_lock_event == UACPI_NULL))
Expand Down Expand Up @@ -2193,6 +2194,13 @@ void uacpi_deinitialize_events(void)
}
}

if (g_uacpi_rt_ctx.sci_handle_valid) {
uacpi_kernel_uninstall_interrupt_handler(
handle_sci, g_uacpi_rt_ctx.sci_handle
);
g_uacpi_rt_ctx.sci_handle_valid = UACPI_FALSE;
}

for (i = 0; i < UACPI_FIXED_EVENT_MAX; ++i) {
if (fixed_event_handlers[i].handler)
uacpi_uninstall_fixed_event_handler(i);
Expand Down

0 comments on commit 9b2898a

Please sign in to comment.