aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2007-02-02 11:48:18 -0500
committerLen Brown <len.brown@intel.com>2007-02-02 21:14:20 -0500
commita72d47563bce9542b9a83521a4e8175076278ee9 (patch)
treea510267ef9cb9e2fe008e6fd2b0a5c57b03265a8 /drivers/acpi
parentc81da66608d65dab04730582dfdfcdcab779e2fe (diff)
ACPICA: Release global lock from interrupt handler
The ACPI Global Lock interrupt handler no longer queues the execution of a separate thread to signal the global lock semaphore. Instead, the semaphore is signaled directly from the interrupt handler. Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/events/evmisc.c50
1 files changed, 15 insertions, 35 deletions
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index f82b81cc1838..00f33ed4c12e 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -67,8 +67,6 @@ static const char *acpi_notify_value_names[] = {
67 67
68static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context); 68static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context);
69 69
70static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread(void *context);
71
72static u32 acpi_ev_global_lock_handler(void *context); 70static u32 acpi_ev_global_lock_handler(void *context);
73 71
74/******************************************************************************* 72/*******************************************************************************
@@ -282,43 +280,19 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context)
282 280
283/******************************************************************************* 281/*******************************************************************************
284 * 282 *
285 * FUNCTION: acpi_ev_global_lock_thread
286 *
287 * PARAMETERS: Context - From thread interface, not used
288 *
289 * RETURN: None
290 *
291 * DESCRIPTION: Invoked by SCI interrupt handler upon acquisition of the
292 * Global Lock. Simply signal all threads that are waiting
293 * for the lock.
294 *
295 ******************************************************************************/
296
297static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread(void *context)
298{
299 acpi_status status;
300
301 /* Signal the thread that is waiting for the lock */
302
303 /* Send a unit to the semaphore */
304
305 status = acpi_os_signal_semaphore(acpi_gbl_global_lock_semaphore, 1);
306 if (ACPI_FAILURE(status)) {
307 ACPI_ERROR((AE_INFO, "Could not signal Global Lock semaphore"));
308 }
309}
310
311/*******************************************************************************
312 *
313 * FUNCTION: acpi_ev_global_lock_handler 283 * FUNCTION: acpi_ev_global_lock_handler
314 * 284 *
315 * PARAMETERS: Context - From thread interface, not used 285 * PARAMETERS: Context - From thread interface, not used
316 * 286 *
317 * RETURN: ACPI_INTERRUPT_HANDLED or ACPI_INTERRUPT_NOT_HANDLED 287 * RETURN: ACPI_INTERRUPT_HANDLED
318 * 288 *
319 * DESCRIPTION: Invoked directly from the SCI handler when a global lock 289 * DESCRIPTION: Invoked directly from the SCI handler when a global lock
320 * release interrupt occurs. Grab the global lock and queue 290 * release interrupt occurs. Attempt to acquire the global lock,
321 * the global lock thread for execution 291 * if successful, signal the thread waiting for the lock.
292 *
293 * NOTE: Assumes that the semaphore can be signaled from interrupt level. If
294 * this is not possible for some reason, a separate thread will have to be
295 * scheduled to do this.
322 * 296 *
323 ******************************************************************************/ 297 ******************************************************************************/
324 298
@@ -338,7 +312,13 @@ static u32 acpi_ev_global_lock_handler(void *context)
338 /* Got the lock, now wake all threads waiting for it */ 312 /* Got the lock, now wake all threads waiting for it */
339 313
340 acpi_gbl_global_lock_acquired = TRUE; 314 acpi_gbl_global_lock_acquired = TRUE;
341 acpi_ev_global_lock_thread(context); 315 /* Send a unit to the semaphore */
316
317 if (ACPI_FAILURE(acpi_os_signal_semaphore(
318 acpi_gbl_global_lock_semaphore, 1))) {
319 ACPI_ERROR((AE_INFO,
320 "Could not signal Global Lock semaphore"));
321 }
342 } 322 }
343 323
344 return (ACPI_INTERRUPT_HANDLED); 324 return (ACPI_INTERRUPT_HANDLED);
@@ -480,7 +460,7 @@ acpi_status acpi_ev_release_global_lock(void)
480 460
481 ACPI_FUNCTION_TRACE(ev_release_global_lock); 461 ACPI_FUNCTION_TRACE(ev_release_global_lock);
482 462
483 /* Lock must be acquired */ 463 /* Lock must be already acquired */
484 464
485 if (!acpi_gbl_global_lock_acquired) { 465 if (!acpi_gbl_global_lock_acquired) {
486 ACPI_WARNING((AE_INFO, 466 ACPI_WARNING((AE_INFO,