Since the GPE handler is directly called by ACPI-CA and it may have unknown

locks held, specify the ACPI_ISR flag to keep it from acquiring any more
mutexes (which could potentially sleep.)  This should fix "could sleep"
warning messages on the following path:

    msleep()
    AcpiOsWaitSemaphore()
    AcpiUtAcquireMutex()
    AcpiDisableGpe()
    EcGpeHandler()
    AcpiEvGpeDispatch()
    AcpiEvGpeDetect()
    AcpiEvGpeDetect()
    AcpiEvSciXruptHandler()
This commit is contained in:
Nate Lawson 2005-02-21 23:38:41 +00:00
parent 0daccb9c94
commit 1395b555de

@ -726,15 +726,20 @@ EcGpeHandler(void *Context)
KASSERT(Context != NULL, ("EcGpeHandler called with NULL"));
/* Disable further GPEs while we handle this one. */
AcpiDisableGpe(sc->ec_gpehandle, sc->ec_gpebit, ACPI_NOT_ISR);
/*
* Disable further GPEs while we handle this one. Since we are directly
* called by ACPI-CA and it may have unknown locks held, we specify the
* ACPI_ISR flag to keep it from acquiring any more mutexes (which could
* potentially sleep.)
*/
AcpiDisableGpe(sc->ec_gpehandle, sc->ec_gpebit, ACPI_ISR);
/* Schedule the GPE query handler. */
Status = AcpiOsQueueForExecution(OSD_PRIORITY_GPE, EcGpeQueryHandler,
Context);
if (ACPI_FAILURE(Status)) {
printf("Queuing GPE query handler failed.\n");
Status = AcpiEnableGpe(sc->ec_gpehandle, sc->ec_gpebit, ACPI_NOT_ISR);
Status = AcpiEnableGpe(sc->ec_gpehandle, sc->ec_gpebit, ACPI_ISR);
if (ACPI_FAILURE(Status))
printf("EcGpeHandler: AcpiEnableEvent failed\n");
}