aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/events/evmisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/events/evmisc.c')
-rw-r--r--drivers/acpi/events/evmisc.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 00f33ed4c12e..21449f36b5f8 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -63,6 +63,10 @@ static const char *acpi_notify_value_names[] = {
63}; 63};
64#endif 64#endif
65 65
66/* Pointer to FACS needed for the Global Lock */
67
68static struct acpi_table_facs *facs = NULL;
69
66/* Local prototypes */ 70/* Local prototypes */
67 71
68static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context); 72static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context);
@@ -306,7 +310,7 @@ static u32 acpi_ev_global_lock_handler(void *context)
306 * If we don't get it now, it will be marked pending and we will 310 * If we don't get it now, it will be marked pending and we will
307 * take another interrupt when it becomes free. 311 * take another interrupt when it becomes free.
308 */ 312 */
309 ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired); 313 ACPI_ACQUIRE_GLOBAL_LOCK(facs, acquired);
310 if (acquired) { 314 if (acquired) {
311 315
312 /* Got the lock, now wake all threads waiting for it */ 316 /* Got the lock, now wake all threads waiting for it */
@@ -342,6 +346,13 @@ acpi_status acpi_ev_init_global_lock_handler(void)
342 346
343 ACPI_FUNCTION_TRACE(ev_init_global_lock_handler); 347 ACPI_FUNCTION_TRACE(ev_init_global_lock_handler);
344 348
349 status =
350 acpi_get_table(ACPI_SIG_FACS, 0,
351 (struct acpi_table_header **)&facs);
352 if (ACPI_FAILURE(status)) {
353 return_ACPI_STATUS(status);
354 }
355
345 acpi_gbl_global_lock_present = TRUE; 356 acpi_gbl_global_lock_present = TRUE;
346 status = acpi_install_fixed_event_handler(ACPI_EVENT_GLOBAL, 357 status = acpi_install_fixed_event_handler(ACPI_EVENT_GLOBAL,
347 acpi_ev_global_lock_handler, 358 acpi_ev_global_lock_handler,
@@ -414,7 +425,7 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
414 425
415 /* Attempt to acquire the actual hardware lock */ 426 /* Attempt to acquire the actual hardware lock */
416 427
417 ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired); 428 ACPI_ACQUIRE_GLOBAL_LOCK(facs, acquired);
418 if (acquired) { 429 if (acquired) {
419 430
420 /* We got the lock */ 431 /* We got the lock */
@@ -438,6 +449,7 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
438 */ 449 */
439 status = acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore, 450 status = acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore,
440 ACPI_WAIT_FOREVER); 451 ACPI_WAIT_FOREVER);
452
441 return_ACPI_STATUS(status); 453 return_ACPI_STATUS(status);
442} 454}
443 455
@@ -472,8 +484,7 @@ acpi_status acpi_ev_release_global_lock(void)
472 484
473 /* Allow any thread to release the lock */ 485 /* Allow any thread to release the lock */
474 486
475 ACPI_RELEASE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, 487 ACPI_RELEASE_GLOBAL_LOCK(facs, pending);
476 pending);
477 488
478 /* 489 /*
479 * If the pending bit was set, we must write GBL_RLS to the control 490 * If the pending bit was set, we must write GBL_RLS to the control