From: Len Brown <len.brown@intel.com>
To: linux-acpi@vger.kernel.org
Cc: Robert Moore <robert.moore@intel.com>,
Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>,
Len Brown <len.brown@intel.com>
Subject: [PATCH 19/65] ACPICA: Disable all wake GPEs after first one recieved
Date: Fri, 24 Nov 2006 02:18:29 -0500 [thread overview]
Message-ID: <11643527812144-git-send-email-len.brown@intel.com> (raw)
Message-ID: <023eab64321d171542941abe76d9248d11a52778.1164352293.git.len.brown@intel.com> (raw)
In-Reply-To: <11643527804057-git-send-email-len.brown@intel.com>
In-Reply-To: <410c2f0190f74c35505beda6ff3f2da7819f8bac.1164352285.git.len.brown@intel.com>
From: Robert Moore <robert.moore@intel.com>
Change for GPE support: when a wake GPE is
received, now all wake GPEs are immediately disabled to
prevent the waking GPE from firing again, and to prevent
other wake GPEs from interrupting the wake process.
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/events/evgpe.c | 78 +++++++++---------------------------------
include/acpi/acglobal.h | 68 ++++++++++++++++++-------------------
include/acpi/actypes.h | 6 +---
3 files changed, 51 insertions(+), 101 deletions(-)
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index d9f71dd..df92c9e 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -635,20 +635,23 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve
}
}
- /* Save current system state */
-
- if (acpi_gbl_system_awake_and_running) {
- ACPI_SET_BIT(gpe_event_info->flags, ACPI_GPE_SYSTEM_RUNNING);
- } else {
- ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_SYSTEM_RUNNING);
+ if (!acpi_gbl_system_awake_and_running) {
+ /*
+ * We just woke up because of a wake GPE. Disable any further GPEs
+ * until we are fully up and running (Only wake GPEs should be enabled
+ * at this time, but we just brute-force disable them all.)
+ * 1) We must disable this particular wake GPE so it won't fire again
+ * 2) We want to disable all wake GPEs, since we are now awake
+ */
+ (void)acpi_hw_disable_all_gpes();
}
/*
- * Dispatch the GPE to either an installed handler, or the control
- * method associated with this GPE (_Lxx or _Exx).
- * If a handler exists, we invoke it and do not attempt to run the method.
- * If there is neither a handler nor a method, we disable the level to
- * prevent further events from coming in here.
+ * Dispatch the GPE to either an installed handler, or the control method
+ * associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke
+ * it and do not attempt to run the method. If there is neither a handler
+ * nor a method, we disable this GPE to prevent further such pointless
+ * events from firing.
*/
switch (gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) {
case ACPI_GPE_DISPATCH_HANDLER:
@@ -679,8 +682,8 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve
case ACPI_GPE_DISPATCH_METHOD:
/*
- * Disable GPE, so it doesn't keep firing before the method has a
- * chance to run.
+ * Disable the GPE, so it doesn't keep firing before the method has a
+ * chance to run (it runs asynchronously with interrupts enabled).
*/
status = acpi_ev_disable_gpe(gpe_event_info);
if (ACPI_FAILURE(status)) {
@@ -713,7 +716,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve
gpe_number));
/*
- * Disable the GPE. The GPE will remain disabled until the ACPI
+ * Disable the GPE. The GPE will remain disabled until the ACPI
* Core Subsystem is restarted, or a handler is installed.
*/
status = acpi_ev_disable_gpe(gpe_event_info);
@@ -728,50 +731,3 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_eve
return_UINT32(ACPI_INTERRUPT_HANDLED);
}
-
-#ifdef ACPI_GPE_NOTIFY_CHECK
-/*******************************************************************************
- * TBD: NOT USED, PROTOTYPE ONLY AND WILL PROBABLY BE REMOVED
- *
- * FUNCTION: acpi_ev_check_for_wake_only_gpe
- *
- * PARAMETERS: gpe_event_info - info for this GPE
- *
- * RETURN: Status
- *
- * DESCRIPTION: Determine if a a GPE is "wake-only".
- *
- * Called from Notify() code in interpreter when a "DeviceWake"
- * Notify comes in.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ev_check_for_wake_only_gpe(struct acpi_gpe_event_info *gpe_event_info)
-{
- acpi_status status;
-
- ACPI_FUNCTION_TRACE(ev_check_for_wake_only_gpe);
-
- if ((gpe_event_info) && /* Only >0 for _Lxx/_Exx */
- ((gpe_event_info->flags & ACPI_GPE_SYSTEM_MASK) == ACPI_GPE_SYSTEM_RUNNING)) { /* System state at GPE time */
- /* This must be a wake-only GPE, disable it */
-
- status = acpi_ev_disable_gpe(gpe_event_info);
-
- /* Set GPE to wake-only. Do not change wake disabled/enabled status */
-
- acpi_ev_set_gpe_type(gpe_event_info, ACPI_GPE_TYPE_WAKE);
-
- ACPI_INFO((AE_INFO,
- "GPE %p was updated from wake/run to wake-only",
- gpe_event_info));
-
- /* This was a wake-only GPE */
-
- return_ACPI_STATUS(AE_WAKE_ONLY_GPE);
- }
-
- return_ACPI_STATUS(AE_OK);
-}
-#endif
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 019b86e..a2b8340 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -58,41 +58,6 @@
#define ACPI_INIT_GLOBAL(a,b) a
#endif
-/*
- * Keep local copies of these FADT-based registers. NOTE: These globals
- * are first in this file for alignment reasons on 64-bit systems.
- */
-ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
-ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
-
-/*****************************************************************************
- *
- * Debug support
- *
- ****************************************************************************/
-
-/* Runtime configuration of debug print levels */
-
-extern u32 acpi_dbg_level;
-extern u32 acpi_dbg_layer;
-
-/* Procedure nesting level for debug output */
-
-extern u32 acpi_gbl_nesting_level;
-
-/* Event counters */
-
-ACPI_EXTERN u32 acpi_gpe_count;
-
-/* Support for dynamic control method tracing mechanism */
-
-ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
-ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
-ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
-ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
-ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
-ACPI_EXTERN u32 acpi_gbl_trace_flags;
-
/*****************************************************************************
*
* Runtime configuration (static defaults that can be overriden at runtime)
@@ -139,6 +104,34 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl
/*****************************************************************************
*
+ * Debug support
+ *
+ ****************************************************************************/
+
+/* Runtime configuration of debug print levels */
+
+extern u32 acpi_dbg_level;
+extern u32 acpi_dbg_layer;
+
+/* Procedure nesting level for debug output */
+
+extern u32 acpi_gbl_nesting_level;
+
+/* Event counters */
+
+ACPI_EXTERN u32 acpi_gpe_count;
+
+/* Support for dynamic control method tracing mechanism */
+
+ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
+ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
+ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
+ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
+ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
+ACPI_EXTERN u32 acpi_gbl_trace_flags;
+
+/*****************************************************************************
+ *
* ACPI Table globals
*
****************************************************************************/
@@ -153,6 +146,11 @@ ACPI_EXTERN struct acpi_internal_rsdt ac
ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT;
extern acpi_native_uint acpi_gbl_permanent_mmap;
+/* These addresses are calculated from FADT address values */
+
+ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
+ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
+
/*
* Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is
* determined by the revision of the DSDT: If the DSDT revision is less than
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index b0cdee6..fe9eb0e 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -592,7 +592,7 @@ typedef u32 acpi_event_status;
* | | | +--- Type of dispatch -- to method, handler, or none
* | | +--- Enabled for runtime?
* | +--- Enabled for wake?
- * +--- System state when GPE ocurred (running/waking)
+ * +--- Unused
*/
#define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01
#define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01
@@ -618,10 +618,6 @@ typedef u32 acpi_event_status;
#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */
-#define ACPI_GPE_SYSTEM_MASK (u8) 0x80
-#define ACPI_GPE_SYSTEM_RUNNING (u8) 0x80
-#define ACPI_GPE_SYSTEM_WAKING (u8) 0x00
-
/*
* Flags for GPE and Lock interfaces
*/
--
1.4.4.1
next prev parent reply other threads:[~2006-11-24 7:15 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-24 7:18 contents of the acpica branch Len Brown
2006-11-24 7:18 ` [PATCH 1/65] ACPICA: Update function header Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 2/65] ACPICA: Handle mis-matched package length Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 3/65] ACPICA: Handle case NumElements > Package length Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 4/65] ACPICA: Delete recursive feature of ACPI Global Lock Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 5/65] ACPICA: Release global lock from interrupt handler Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 6/65] ACPICA: Cast acpi_thread_id to UINT32 for debug output only Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 7/65] ACPICA: fix for object premature deletion Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 8/65] ACPICA: Temporary fix for BankValue parameter Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 9/65] ACPICA: Update version to 20060721 Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 10/65] ACPICA: Update debug output Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 12/65] ACPICA: misc fixes for new Table Manager: Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 13/65] ACPICA: Update comments for individual table fields Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 14/65] ACPICA: Fix for FADT conversion in 64-bit mode Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 15/65] ACPICA: Lint changes Len Brown
2006-11-24 7:18 ` Len Brown
[not found] ` <1164352776767-git-send-email-len.brown@intel.com>
2006-11-24 7:18 ` [PATCH 17/65] ACPICA: Add support for DMAR table Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 18/65] ACPICA: Add acpi_gpe_count global to track the number of GPE events Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` Len Brown [this message]
2006-11-24 7:18 ` [PATCH 19/65] ACPICA: Disable all wake GPEs after first one recieved Len Brown
2006-11-24 7:18 ` [PATCH 20/65] ACPICA: Fix unalignment in acpi_ut_repair_name Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 21/65] ACPICA: Store GPE number instead of bitmask Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 22/65] ACPICA: Split acpi_format_exception into two parts Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 23/65] ACPICA: Update version to 20060831 Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 24/65] ACPICA: Cleanup of FADT verification function Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 25/65] ACPICA: Create tbfadt.c to hold all FADT-related functions Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 26/65] ACPICA: Re-implement interpreters' "serialized mode" Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 27/65] ACPICA: Delete stale FADT functions outside tbfadt.c Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 28/65] ACPICA: Update comments in tbfadt.c Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 29/65] ACPICA: add ASF comment Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 30/65] ACPICA: re-factor table init routines for benefit of iASL Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 31/65] ACPICA: Allow type ANY to be the target of the Scope operator Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 32/65] ACPICA: IsResourceTemplate now returns ACPI_STATUS Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 33/65] ACPICA: Add declarations for ASF! sub-tables Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 34/65] ACPICA: FADT verification is now table driven Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 35/65] ACPICA: Report error if method creates 2 objects with the same name Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 36/65] ACPICA: New common routine for creating and verifying a local FADT Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 37/65] ACPICA: Fix memory leak in table load error path Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 38/65] ACPICA: Fix trace output name and whitespace Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 39/65] ACPICA: Update version to 20060912 Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 40/65] ACPICA: Add full table name to disassembler output Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 41/65] ACPICA: Fix for Global Lock semaphore Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 42/65] ACPICA: Remove obsolete Flags parameter Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 43/65] ACPICA: Use faster ByIndex interface to get FACS Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 44/65] ACPICA: On AML mutex force-release, set depth to zero (was 1) Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 45/65] ACPICA: Update interpreter error paths to always report the error Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 46/65] ACPICA: Fix for possible memory leak and fault Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 47/65] ACPICA: Add new subsystem state bit that is set after SubsystemInitialize is called Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 48/65] ACPICA: Update version to 20060927 Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:18 ` [PATCH 49/65] ACPICA: Restructured module into multiple functions Len Brown
2006-11-24 7:18 ` Len Brown
2006-11-24 7:19 ` [PATCH 50/65] ACPICA: Eliminate control method 2-pass parse/execute Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 51/65] ACPICA: Fix race condition with AcpiWalkNamespace Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 52/65] ACPICA: _CID support for PCI Root Bridge detection Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 53/65] ACPICA: Use manifest constants for parse pass number Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 54/65] ACPICA: Update comments Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 55/65] ACPICA: Abort downward walk on temporary node detection Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 56/65] ACPICA: Fixes for parameter validation Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 57/65] ACPICA: Update version to 20061011 Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 58/65] ACPICA: Update debug output routines for data structure changes Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 59/65] ACPICA: Miscellaneous table manager updates and optimizations Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 60/65] ACPICA: Fixes for load() operator Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 61/65] ACPICA: Ensure that all structures in acobject.h are aligned, via #pragma Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 62/65] ACPICA: Add ACPI_MAX macro Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 63/65] ACPICA: Fail AcpiEnable if ACPI tables not loaded Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 64/65] ACPICA: Add include of actables.h Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 7:19 ` [PATCH 65/65] ACPICA: version update Len Brown
2006-11-24 7:19 ` Len Brown
2006-11-24 20:32 ` contents of the acpica branch Rafael J. Wysocki
2006-11-24 22:25 ` Rafael J. Wysocki
2006-11-27 2:12 ` 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=11643527812144-git-send-email-len.brown@intel.com \
--to=len.brown@intel.com \
--cc=alexey.y.starikovskiy@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.