diff options
author | Erik Schmauss <erik.schmauss@intel.com> | 2018-03-14 16:12:59 -0700 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-03-18 18:52:00 +0100 |
commit | 87cd826b5979d91d4f2ba189e0652820f2da417f (patch) | |
tree | bf6d9d3f5edf4eb692af63289b2fbf6724465f8e /drivers/acpi/acpica/evgpeblk.c | |
parent | 8d5934952f26c25431dbc21aa8ae7614bb8f88c3 (diff) | |
download | linux-87cd826b5979d91d4f2ba189e0652820f2da417f.tar.bz2 |
ACPICA: Events: Dispatch GPEs after enabling for the first time
After being enabled for the first time, the GPEs may have STS bits already
set. Setting EN bits is not sufficient to trigger the GPEs again, so this
patch polls GPEs after enabling them for the first time.
This is a cleaner version on top of the "GPE clear" fix generated according
to Mika's report and Rafael's original Linux based fix. Based on Linux
commit originated from Rafael J. Wysocki, fixed by Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/evgpeblk.c')
-rw-r--r-- | drivers/acpi/acpica/evgpeblk.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c index 7ce756cc28ab..107f3ec5dee6 100644 --- a/drivers/acpi/acpica/evgpeblk.c +++ b/drivers/acpi/acpica/evgpeblk.c @@ -437,16 +437,16 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device, acpi_status acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, struct acpi_gpe_block_info *gpe_block, - void *ignored) + void *context) { acpi_status status; - acpi_event_status event_status; struct acpi_gpe_event_info *gpe_event_info; u32 gpe_enabled_count; u32 gpe_index; u32 gpe_number; u32 i; u32 j; + u8 *is_polling_needed = context; ACPI_FUNCTION_TRACE(ev_initialize_gpe_block); @@ -473,6 +473,7 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, gpe_index = (i * ACPI_GPE_REGISTER_WIDTH) + j; gpe_event_info = &gpe_block->event_info[gpe_index]; gpe_number = gpe_block->block_base_number + gpe_index; + gpe_event_info->flags |= ACPI_GPE_INITIALIZED; /* * Ignore GPEs that have no corresponding _Lxx/_Exx method @@ -484,10 +485,6 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, continue; } - event_status = 0; - (void)acpi_hw_get_gpe_status(gpe_event_info, - &event_status); - status = acpi_ev_add_gpe_reference(gpe_event_info); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, @@ -498,12 +495,9 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, gpe_event_info->flags |= ACPI_GPE_AUTO_ENABLED; - 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); + if (is_polling_needed && + ACPI_GPE_IS_POLLING_NEEDED(gpe_event_info)) { + *is_polling_needed = TRUE; } gpe_enabled_count++; |