diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-08-10 13:07:07 +0300 |
---|---|---|
committer | Lv Zheng <lv.zheng@intel.com> | 2017-10-12 11:10:05 +0800 |
commit | 16c41214d82d86dce7ed8b31e3cc3340719ffc76 (patch) | |
tree | c67bbc8b6333c59cd00efd4f0b361524616e5b39 /source/components/events | |
parent | b9dcce0ad8ecb69f1edfc8244db9917554102382 (diff) | |
download | acpica-16c41214d82d86dce7ed8b31e3cc3340719ffc76.tar.gz |
Events: Dispatch active GPEs at init time
In some cases GPEs are already active when they are enabled by
AcpiEvInitializeGpeBlock() 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 AcpiEvInitializeGpeBlock() to
dispatch GPEs with the status flag set in-band right after
enabling them.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'source/components/events')
-rw-r--r-- | source/components/events/evgpeblk.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source/components/events/evgpeblk.c b/source/components/events/evgpeblk.c index e7495368a..7ef6ea5f3 100644 --- a/source/components/events/evgpeblk.c +++ b/source/components/events/evgpeblk.c @@ -588,9 +588,11 @@ AcpiEvInitializeGpeBlock ( void *Ignored) { ACPI_STATUS Status; + ACPI_EVENT_STATUS EventStatus; ACPI_GPE_EVENT_INFO *GpeEventInfo; UINT32 GpeEnabledCount; UINT32 GpeIndex; + UINT32 GpeNumber; UINT32 i; UINT32 j; @@ -622,28 +624,39 @@ AcpiEvInitializeGpeBlock ( GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j; GpeEventInfo = &GpeBlock->EventInfo[GpeIndex]; + GpeNumber = GpeBlock->BlockBaseNumber + GpeIndex; /* * Ignore GPEs that have no corresponding _Lxx/_Exx method * and GPEs that are used to wake the system */ - if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_NONE) || - (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_HANDLER) || - (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_RAW_HANDLER) || + if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) != ACPI_GPE_DISPATCH_METHOD) || (GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE)) { continue; } + EventStatus = 0; + (void) AcpiHwGetGpeStatus (GpeEventInfo, &EventStatus); + Status = AcpiEvAddGpeReference (GpeEventInfo); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "Could not enable GPE 0x%02X", - GpeIndex + GpeBlock->BlockBaseNumber)); + GpeNumber)); continue; } + if (EventStatus & ACPI_EVENT_FLAG_STATUS_SET) + { + ACPI_INFO (("GPE 0x%02X active on init", + GpeNumber)); + (void) AcpiEvGpeDispatch (GpeBlock->Node, + GpeEventInfo, + GpeNumber); + } + GpeEnabledCount++; } } |