Commit ecc1165b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPICA: Dispatch active GPEs at init time

In some cases GPEs are already active when they are enabled by
acpi_ev_initialize_gpe_block() and whatever happens next may depend
on the result of handling the events signaled by them, so the
events should not be discarded (which is what happens currently) and
they should be handled as soon as reasonably possible.

For this reason, modify acpi_ev_initialize_gpe_block() to
dispatch GPEs with the status flag set in-band right after
enabling them.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 98529b92
...@@ -440,9 +440,11 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, ...@@ -440,9 +440,11 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
void *ignored) void *ignored)
{ {
acpi_status status; acpi_status status;
acpi_event_status event_status;
struct acpi_gpe_event_info *gpe_event_info; struct acpi_gpe_event_info *gpe_event_info;
u32 gpe_enabled_count; u32 gpe_enabled_count;
u32 gpe_index; u32 gpe_index;
u32 gpe_number;
u32 i; u32 i;
u32 j; u32 j;
...@@ -470,30 +472,38 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, ...@@ -470,30 +472,38 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
gpe_index = (i * ACPI_GPE_REGISTER_WIDTH) + j; gpe_index = (i * ACPI_GPE_REGISTER_WIDTH) + j;
gpe_event_info = &gpe_block->event_info[gpe_index]; gpe_event_info = &gpe_block->event_info[gpe_index];
gpe_number = gpe_block->block_base_number + gpe_index;
/* /*
* Ignore GPEs that have no corresponding _Lxx/_Exx method * Ignore GPEs that have no corresponding _Lxx/_Exx method
* and GPEs that are used to wake the system * and GPEs that are used for wakeup
*/ */
if ((ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) == if ((ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) !=
ACPI_GPE_DISPATCH_NONE) ACPI_GPE_DISPATCH_METHOD)
|| (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
ACPI_GPE_DISPATCH_HANDLER)
|| (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
ACPI_GPE_DISPATCH_RAW_HANDLER)
|| (gpe_event_info->flags & ACPI_GPE_CAN_WAKE)) { || (gpe_event_info->flags & ACPI_GPE_CAN_WAKE)) {
continue; continue;
} }
event_status = 0;
(void)acpi_hw_get_gpe_status(gpe_event_info,
&event_status);
status = acpi_ev_add_gpe_reference(gpe_event_info); status = acpi_ev_add_gpe_reference(gpe_event_info);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, ACPI_EXCEPTION((AE_INFO, status,
"Could not enable GPE 0x%02X", "Could not enable GPE 0x%02X",
gpe_index + gpe_number));
gpe_block->block_base_number));
continue; continue;
} }
if (event_status & ACPI_EVENT_FLAG_STATUS_SET) {
ACPI_INFO(("GPE 0x%02X active on init",
gpe_number));
(void)acpi_ev_gpe_dispatch(gpe_block->node,
gpe_event_info,
gpe_number);
}
gpe_enabled_count++; gpe_enabled_count++;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment