Lines 620-626
EcGpeQueryHandler(void *Context)
Link Here
|
620 |
struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; |
620 |
struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; |
621 |
UINT8 Data; |
621 |
UINT8 Data; |
622 |
ACPI_STATUS Status; |
622 |
ACPI_STATUS Status; |
623 |
int retry, sci_enqueued; |
623 |
int retry; |
624 |
char qxx[5]; |
624 |
char qxx[5]; |
625 |
|
625 |
|
626 |
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); |
626 |
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); |
Lines 641-647
EcGpeQueryHandler(void *Context)
Link Here
|
641 |
* that may arise from running the query from causing another query |
641 |
* that may arise from running the query from causing another query |
642 |
* to be queued, we clear the pending flag only after running it. |
642 |
* to be queued, we clear the pending flag only after running it. |
643 |
*/ |
643 |
*/ |
644 |
sci_enqueued = sc->ec_sci_pend; |
|
|
645 |
for (retry = 0; retry < 2; retry++) { |
644 |
for (retry = 0; retry < 2; retry++) { |
646 |
Status = EcCommand(sc, EC_COMMAND_QUERY); |
645 |
Status = EcCommand(sc, EC_COMMAND_QUERY); |
647 |
if (ACPI_SUCCESS(Status)) |
646 |
if (ACPI_SUCCESS(Status)) |
Lines 682-694
EcGpeQueryHandler(void *Context)
Link Here
|
682 |
qxx, AcpiFormatException(Status)); |
681 |
qxx, AcpiFormatException(Status)); |
683 |
} |
682 |
} |
684 |
|
683 |
|
685 |
/* Reenable runtime GPE if its execution was deferred. */ |
684 |
/* Reenable runtime GPE. */ |
686 |
if (sci_enqueued) { |
685 |
Status = AcpiFinishGpe(sc->ec_gpehandle, sc->ec_gpebit); |
687 |
Status = AcpiFinishGpe(sc->ec_gpehandle, sc->ec_gpebit); |
686 |
if (ACPI_FAILURE(Status)) |
688 |
if (ACPI_FAILURE(Status)) |
687 |
device_printf(sc->ec_dev, "reenabling runtime GPE failed: %s\n", |
689 |
device_printf(sc->ec_dev, "reenabling runtime GPE failed: %s\n", |
688 |
AcpiFormatException(Status)); |
690 |
AcpiFormatException(Status)); |
|
|
691 |
} |
692 |
} |
689 |
} |
693 |
|
690 |
|
694 |
/* |
691 |
/* |
Lines 722-734
EcGpeHandler(ACPI_HANDLE GpeDevice, UINT32 GpeNumb
Link Here
|
722 |
if ((EcStatus & EC_EVENT_SCI) && !sc->ec_sci_pend) { |
719 |
if ((EcStatus & EC_EVENT_SCI) && !sc->ec_sci_pend) { |
723 |
CTR0(KTR_ACPI, "ec gpe queueing query handler"); |
720 |
CTR0(KTR_ACPI, "ec gpe queueing query handler"); |
724 |
Status = AcpiOsExecute(OSL_GPE_HANDLER, EcGpeQueryHandler, Context); |
721 |
Status = AcpiOsExecute(OSL_GPE_HANDLER, EcGpeQueryHandler, Context); |
725 |
if (ACPI_SUCCESS(Status)) { |
722 |
if (ACPI_SUCCESS(Status)) |
726 |
sc->ec_sci_pend = TRUE; |
723 |
sc->ec_sci_pend = TRUE; |
727 |
return (0); |
724 |
else |
728 |
} else |
|
|
729 |
printf("EcGpeHandler: queuing GPE query handler failed\n"); |
725 |
printf("EcGpeHandler: queuing GPE query handler failed\n"); |
730 |
} |
726 |
} |
731 |
return (ACPI_REENABLE_GPE); |
727 |
return (0); |
732 |
} |
728 |
} |
733 |
|
729 |
|
734 |
static ACPI_STATUS |
730 |
static ACPI_STATUS |