mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-01 12:19:28 +00:00
If we got an OBE/IBF event, we failed to re-enable the GPE. This would
cause the EC to stop handling future events because the GPE stayed masked. Set a flag when queueing a GPE handler since it will ultimately re-enable the GPE. In all other cases, re-enable it ourselves. I reworked the patch from the submitter. Submitted by: Rong-en Fan <grafan@gmail.com>
This commit is contained in:
parent
ec002fee99
commit
6e141df200
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167730
@ -787,6 +787,7 @@ EcGpeHandler(void *Context)
|
||||
struct acpi_ec_softc *sc = Context;
|
||||
ACPI_STATUS Status;
|
||||
EC_STATUS EcStatus;
|
||||
int query_pend;
|
||||
|
||||
KASSERT(Context != NULL, ("EcGpeHandler called with NULL"));
|
||||
|
||||
@ -821,6 +822,7 @@ EcGpeHandler(void *Context)
|
||||
* it along to any potential waiters as it may be an IBE/OBF event.
|
||||
* If it is set, queue a query handler.
|
||||
*/
|
||||
query_pend = FALSE;
|
||||
if ((EcStatus & EC_EVENT_SCI) == 0) {
|
||||
CTR1(KTR_ACPI, "ec event was IBE/OBF, status %#x", EcStatus);
|
||||
sc->ec_csrvalue = EcStatus;
|
||||
@ -832,12 +834,19 @@ EcGpeHandler(void *Context)
|
||||
Context);
|
||||
if (ACPI_SUCCESS(Status)) {
|
||||
sc->ec_sci_pend = TRUE;
|
||||
} else {
|
||||
query_pend = TRUE;
|
||||
} else
|
||||
printf("Queuing GPE query handler failed.\n");
|
||||
Status = AcpiEnableGpe(sc->ec_gpehandle, sc->ec_gpebit, ACPI_ISR);
|
||||
if (ACPI_FAILURE(Status))
|
||||
printf("EcGpeHandler: AcpiEnableEvent failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If we didn't queue a query handler, which will eventually re-enable
|
||||
* the GPE, re-enable it right now so we can get more events.
|
||||
*/
|
||||
if (!query_pend) {
|
||||
Status = AcpiEnableGpe(sc->ec_gpehandle, sc->ec_gpebit, ACPI_ISR);
|
||||
if (ACPI_FAILURE(Status))
|
||||
printf("EcGpeHandler: AcpiEnableGpe failed\n");
|
||||
}
|
||||
|
||||
EcUnlock(sc);
|
||||
|
Loading…
Reference in New Issue
Block a user