Skip to contentSkip to conversation

AcpiClearGpe() and recent changes

Devel Jukka Ruohonen 2 participants 3 messages Jun 6, 2010 – Jun 10, 2010 ACPI component architecture (acpica)

lore
Share & tools
lore

Jukka Ruohonen

author
#0 lore raw

Hello.

I have a question about this recent change:

31 March 2010. Summary of changes for version 20100331:

1) ACPI CA Core Subsystem:

Completed a major update for the GPE support in order to improve support for shared GPEs and to simplify both host OS and ACPICA code. Added a reference count mechanism to support shared GPEs that require multiple device drivers. Several external interfaces have changed. One external interface has been removed. One new external interface was added. Most of the GPE external interfaces now use the GPE spinlock instead of the events mutex (and the Flags parameter for many GPE interfaces has been removed.) See the updated ACPICA Programmer Reference for details. Matthew Garrett, Bob Moore, Rafael Wysocki. ACPICA BZ 831.

Now the AcpiClearGpe() function operates with a spin mutex on AcpiGbl_GpeLock. Previously it was possible to avoid getting a lock if the ACPI_NOT_ISR was not specified, and thus it was possible to also call AcpiClearGpe() from a GPE handler. If my reading is correct, this is no longer possible because the GPE dispatch functions obtain the same AcpiGbl_GpeLock already before calling the custom handler installed via AcpiInstallGpeHandler().

The documentation however claims that "this function [AcpiClearGpe()] may be called from an interrupt service routine (typically a GPE handler) or a device driver".

Am I missing or misinterpreting something?

- Jukka.

#1 lore raw

I'm not entirely sure at the moment, but we are about to make some additional GPE changes since some issues with the reference count mechanism have been uncovered.

Do you have a need to call AcpiClearGpe from interrupt level?

Quoted 48 lines

-----Original Message-----
From: devel-bounces(a)acpica.org [mailto:devel-bounces(a)acpica.org] On Behalf Of Jukka Ruohonen
Sent: Sunday, June 06, 2010 2:17 AM
To: devel(a)acpica.org
Subject: [Devel] AcpiClearGpe() and recent changes

Hello.

I have a question about this recent change:

31 March 2010. Summary of changes for version 20100331:

1) ACPI CA Core Subsystem:

Completed a major update for the GPE support in order to improve support for shared GPEs and to simplify both host OS and ACPICA code. Added a reference count mechanism to support shared GPEs that require multiple device drivers. Several external interfaces have changed. One external interface has been removed. One new external interface was added. Most of the GPE external interfaces now use
the
GPE spinlock instead of the events mutex (and the Flags parameter for many GPE interfaces has been removed.) See the updated ACPICA Programmer Reference for details. Matthew Garrett, Bob Moore,
Rafael
Wysocki. ACPICA BZ 831.

Now the AcpiClearGpe() function operates with a spin mutex on AcpiGbl_GpeLock.
Previously it was possible to avoid getting a lock if the ACPI_NOT_ISR was not specified, and thus it was possible to also call AcpiClearGpe() from a GPE handler. If my reading is correct, this is no longer possible because the GPE dispatch functions obtain the same AcpiGbl_GpeLock already before calling the custom handler installed via AcpiInstallGpeHandler().

The documentation however claims that "this function [AcpiClearGpe()] may be
called from an interrupt service routine (typically a GPE handler) or a device driver".

Am I missing or misinterpreting something?

- Jukka.
_______________________________________________
Devel mailing list
Devel(a)acpica.org
http://lists.acpica.org/listinfo/devel

author
#2 lore raw
Quoted 5 lines · Robert

I'm not entirely sure at the moment, but we are about to make some additional GPE changes since some issues with the reference count mechanism have been uncovered.

Do you have a need to call AcpiClearGpe from interrupt level?

No.

I was mainly after the inconsistency in the API. As AcpiClearGpe() uses unconditionally the same lock that has been acquired earlier by one of the dispatching functions, this leads to a panic or other comparable condition, depending on the implementation.

So perhaps this could be solved at the documentation level by nothing that AcpiClearGpe() may NOT be used from a GPE handler.

- Jukka.