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/acevents.h | |
parent | 8d5934952f26c25431dbc21aa8ae7614bb8f88c3 (diff) |
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/acevents.h')
-rw-r--r-- | drivers/acpi/acpica/acevents.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h index fa68544c7c07..1ad1608cc880 100644 --- a/drivers/acpi/acpica/acevents.h +++ b/drivers/acpi/acpica/acevents.h @@ -45,6 +45,20 @@ #define __ACEVENTS_H__ /* + * Conditions to trigger post enabling GPE polling: + * It is not sufficient to trigger edge-triggered GPE with specific GPE + * chips, software need to poll once after enabling. + */ +#ifdef ACPI_USE_GPE_POLLING +#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__) \ + ((__gpe__)->runtime_count == 1 && \ + (__gpe__)->flags & ACPI_GPE_INITIALIZED && \ + ((__gpe__)->flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_EDGE_TRIGGERED) +#else +#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__) FALSE +#endif + +/* * evevent */ acpi_status acpi_ev_initialize_events(void); |