From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Len Brown <lenb@kernel.org>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
"Lin, Ming M" <ming.m.lin@intel.com>,
Matthew Garrett <mjg59@srcf.ucam.org>,
"Moore, Robert" <robert.moore@intel.com>,
Linux-pm mailing list <linux-pm@lists.linux-foundation.org>,
len.brown@intel.com, Alexey Starikovskiy <astarikovskiy@suse.de>
Subject: [PATCH 6/6] ACPI / ACPICA: Drop acpi_set_gpe
Date: Fri, 25 Jun 2010 01:23:41 +0200 [thread overview]
Message-ID: <201006250123.41796.rjw@sisk.pl> (raw)
In-Reply-To: <201006250117.45148.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
The acpi_set_gpe() function is a little awkward, because it doesn't
really work as advertised in the "disable" case. Namely, if a GPE
has been enabled with acpi_enable_gpe() and triggered a notification
to occur, and if acpi_set_gpe() is used to disable it before
acpi_ev_asynch_enable_gpe() runs, the GPE will be immediately enabled
by the latter as though the acpi_set_gpe() had no effect.
Thus, since it's been possible to make all of its callers use
alternative operations to disable or enable GPEs, acpi_set_gpe() can
be dropped.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/acpi/acpica/evxfevnt.c | 60 -----------------------------------------
include/acpi/acpixf.h | 2 -
include/acpi/actypes.h | 2 -
3 files changed, 1 insertion(+), 63 deletions(-)
Index: linux-2.6/drivers/acpi/acpica/evxfevnt.c
===================================================================
--- linux-2.6.orig/drivers/acpi/acpica/evxfevnt.c
+++ linux-2.6/drivers/acpi/acpica/evxfevnt.c
@@ -271,66 +271,6 @@ ACPI_EXPORT_SYMBOL(acpi_gpe_wakeup)
/*******************************************************************************
*
- * FUNCTION: acpi_set_gpe
- *
- * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
- * gpe_number - GPE level within the GPE block
- * action - ACPI_GPE_ENABLE or ACPI_GPE_DISABLE
- *
- * RETURN: Status
- *
- * DESCRIPTION: Enable or disable an individual GPE. This function bypasses
- * the reference count mechanism used in the acpi_enable_gpe and
- * acpi_disable_gpe interfaces -- and should be used with care.
- *
- * Note: Typically used to disable a runtime GPE for short period of time,
- * then re-enable it, without disturbing the existing reference counts. This
- * is useful, for example, in the Embedded Controller (EC) driver.
- *
- ******************************************************************************/
-acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action)
-{
- struct acpi_gpe_event_info *gpe_event_info;
- acpi_status status;
- acpi_cpu_flags flags;
-
- ACPI_FUNCTION_TRACE(acpi_set_gpe);
-
- flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
-
- /* Ensure that we have a valid GPE number */
-
- gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
- if (!gpe_event_info) {
- status = AE_BAD_PARAMETER;
- goto unlock_and_exit;
- }
-
- /* Perform the action */
-
- switch (action) {
- case ACPI_GPE_ENABLE:
- status = acpi_ev_enable_gpe(gpe_event_info);
- break;
-
- case ACPI_GPE_DISABLE:
- status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE);
- break;
-
- default:
- status = AE_BAD_PARAMETER;
- break;
- }
-
- unlock_and_exit:
- acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
- return_ACPI_STATUS(status);
-}
-
-ACPI_EXPORT_SYMBOL(acpi_set_gpe)
-
-/*******************************************************************************
- *
* FUNCTION: acpi_enable_gpe
*
* PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
Index: linux-2.6/include/acpi/acpixf.h
===================================================================
--- linux-2.6.orig/include/acpi/acpixf.h
+++ linux-2.6/include/acpi/acpixf.h
@@ -283,8 +283,6 @@ acpi_status acpi_get_event_status(u32 ev
*/
acpi_status acpi_gpe_wakeup(acpi_handle gpe_device, u32 gpe_number, u8 action);
-acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action);
-
acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number);
acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number);
Index: linux-2.6/include/acpi/actypes.h
===================================================================
--- linux-2.6.orig/include/acpi/actypes.h
+++ linux-2.6/include/acpi/actypes.h
@@ -663,7 +663,7 @@ typedef u32 acpi_event_status;
#define ACPI_GPE_MAX 0xFF
#define ACPI_NUM_GPE 256
-/* Actions for acpi_set_gpe, acpi_hw_low_set_gpe and acpi_gpe_wakeup */
+/* Actions for acpi_hw_low_set_gpe and acpi_gpe_wakeup */
#define ACPI_GPE_ENABLE 0
#define ACPI_GPE_DISABLE 1
next prev parent reply other threads:[~2010-06-24 23:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-24 23:17 [PATCH 0/6] ACPI: Simplifications of the GPE-handling code Rafael J. Wysocki
2010-06-24 23:18 ` [PATCH 1/6] ACPI: Introduce acpi_gpe_wakeup() Rafael J. Wysocki
2010-06-28 18:16 ` Len Brown
2010-06-24 23:19 ` [PATCH 2/6] ACPI: Remove wakeup GPE reference counting which is not used Rafael J. Wysocki
2010-06-28 18:17 ` Len Brown
2010-06-24 23:20 ` [PATCH 3/6] ACPI / EC: Drop suspend and resume routines Rafael J. Wysocki
2010-06-28 18:20 ` Len Brown
2010-06-24 23:21 ` [PATCH 4/6] ACPI / EC: Do not use acpi_set_gpe Rafael J. Wysocki
2010-06-28 18:21 ` Len Brown
2010-06-24 23:22 ` [PATCH 5/6] ACPI / ACPICA: Use low-level GPE enable during GPE block initialization Rafael J. Wysocki
2010-06-28 18:25 ` Len Brown
2010-06-24 23:23 ` Rafael J. Wysocki [this message]
2010-06-28 18:25 ` [PATCH 6/6] ACPI / ACPICA: Drop acpi_set_gpe Len Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201006250123.41796.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=astarikovskiy@suse.de \
--cc=len.brown@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=ming.m.lin@intel.com \
--cc=mjg59@srcf.ucam.org \
--cc=robert.moore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox