diff options
Diffstat (limited to 'drivers/acpi/events/evmisc.c')
-rw-r--r-- | drivers/acpi/events/evmisc.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c index 0909ba69577e..6eef4efddcf6 100644 --- a/drivers/acpi/events/evmisc.c +++ b/drivers/acpi/events/evmisc.c | |||
@@ -49,12 +49,13 @@ | |||
49 | #define _COMPONENT ACPI_EVENTS | 49 | #define _COMPONENT ACPI_EVENTS |
50 | ACPI_MODULE_NAME("evmisc") | 50 | ACPI_MODULE_NAME("evmisc") |
51 | 51 | ||
52 | /* Names for Notify() values, used for debug output */ | ||
52 | #ifdef ACPI_DEBUG_OUTPUT | 53 | #ifdef ACPI_DEBUG_OUTPUT |
53 | static const char *acpi_notify_value_names[] = { | 54 | static const char *acpi_notify_value_names[] = { |
54 | "Bus Check", | 55 | "Bus Check", |
55 | "Device Check", | 56 | "Device Check", |
56 | "Device Wake", | 57 | "Device Wake", |
57 | "Eject request", | 58 | "Eject Request", |
58 | "Device Check Light", | 59 | "Device Check Light", |
59 | "Frequency Mismatch", | 60 | "Frequency Mismatch", |
60 | "Bus Mode Mismatch", | 61 | "Bus Mode Mismatch", |
@@ -124,7 +125,7 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
124 | union acpi_generic_state *notify_info; | 125 | union acpi_generic_state *notify_info; |
125 | acpi_status status = AE_OK; | 126 | acpi_status status = AE_OK; |
126 | 127 | ||
127 | ACPI_FUNCTION_NAME("ev_queue_notify_request"); | 128 | ACPI_FUNCTION_NAME(ev_queue_notify_request); |
128 | 129 | ||
129 | /* | 130 | /* |
130 | * For value 3 (Ejection Request), some device method may need to be run. | 131 | * For value 3 (Ejection Request), some device method may need to be run. |
@@ -150,6 +151,7 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
150 | 151 | ||
151 | obj_desc = acpi_ns_get_attached_object(node); | 152 | obj_desc = acpi_ns_get_attached_object(node); |
152 | if (obj_desc) { | 153 | if (obj_desc) { |
154 | |||
153 | /* We have the notify object, Get the right handler */ | 155 | /* We have the notify object, Get the right handler */ |
154 | 156 | ||
155 | switch (node->type) { | 157 | switch (node->type) { |
@@ -184,14 +186,15 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, | |||
184 | return (AE_NO_MEMORY); | 186 | return (AE_NO_MEMORY); |
185 | } | 187 | } |
186 | 188 | ||
187 | notify_info->common.data_type = ACPI_DESC_TYPE_STATE_NOTIFY; | 189 | notify_info->common.descriptor_type = |
190 | ACPI_DESC_TYPE_STATE_NOTIFY; | ||
188 | notify_info->notify.node = node; | 191 | notify_info->notify.node = node; |
189 | notify_info->notify.value = (u16) notify_value; | 192 | notify_info->notify.value = (u16) notify_value; |
190 | notify_info->notify.handler_obj = handler_obj; | 193 | notify_info->notify.handler_obj = handler_obj; |
191 | 194 | ||
192 | status = acpi_os_queue_for_execution(OSD_PRIORITY_HIGH, | 195 | status = |
193 | acpi_ev_notify_dispatch, | 196 | acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch, |
194 | notify_info); | 197 | notify_info); |
195 | if (ACPI_FAILURE(status)) { | 198 | if (ACPI_FAILURE(status)) { |
196 | acpi_ut_delete_generic_state(notify_info); | 199 | acpi_ut_delete_generic_state(notify_info); |
197 | } | 200 | } |
@@ -240,6 +243,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context) | |||
240 | * to the device. | 243 | * to the device. |
241 | */ | 244 | */ |
242 | if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) { | 245 | if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) { |
246 | |||
243 | /* Global system notification handler */ | 247 | /* Global system notification handler */ |
244 | 248 | ||
245 | if (acpi_gbl_system_notify.handler) { | 249 | if (acpi_gbl_system_notify.handler) { |
@@ -297,6 +301,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread(void *context) | |||
297 | /* Signal threads that are waiting for the lock */ | 301 | /* Signal threads that are waiting for the lock */ |
298 | 302 | ||
299 | if (acpi_gbl_global_lock_thread_count) { | 303 | if (acpi_gbl_global_lock_thread_count) { |
304 | |||
300 | /* Send sufficient units to the semaphore */ | 305 | /* Send sufficient units to the semaphore */ |
301 | 306 | ||
302 | status = | 307 | status = |
@@ -335,15 +340,16 @@ static u32 acpi_ev_global_lock_handler(void *context) | |||
335 | */ | 340 | */ |
336 | ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired); | 341 | ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired); |
337 | if (acquired) { | 342 | if (acquired) { |
343 | |||
338 | /* Got the lock, now wake all threads waiting for it */ | 344 | /* Got the lock, now wake all threads waiting for it */ |
339 | 345 | ||
340 | acpi_gbl_global_lock_acquired = TRUE; | 346 | acpi_gbl_global_lock_acquired = TRUE; |
341 | 347 | ||
342 | /* Run the Global Lock thread which will signal all waiting threads */ | 348 | /* Run the Global Lock thread which will signal all waiting threads */ |
343 | 349 | ||
344 | status = acpi_os_queue_for_execution(OSD_PRIORITY_HIGH, | 350 | status = |
345 | acpi_ev_global_lock_thread, | 351 | acpi_os_execute(OSL_GLOBAL_LOCK_HANDLER, |
346 | context); | 352 | acpi_ev_global_lock_thread, context); |
347 | if (ACPI_FAILURE(status)) { | 353 | if (ACPI_FAILURE(status)) { |
348 | ACPI_EXCEPTION((AE_INFO, status, | 354 | ACPI_EXCEPTION((AE_INFO, status, |
349 | "Could not queue Global Lock thread")); | 355 | "Could not queue Global Lock thread")); |
@@ -371,7 +377,7 @@ acpi_status acpi_ev_init_global_lock_handler(void) | |||
371 | { | 377 | { |
372 | acpi_status status; | 378 | acpi_status status; |
373 | 379 | ||
374 | ACPI_FUNCTION_TRACE("ev_init_global_lock_handler"); | 380 | ACPI_FUNCTION_TRACE(ev_init_global_lock_handler); |
375 | 381 | ||
376 | acpi_gbl_global_lock_present = TRUE; | 382 | acpi_gbl_global_lock_present = TRUE; |
377 | status = acpi_install_fixed_event_handler(ACPI_EVENT_GLOBAL, | 383 | status = acpi_install_fixed_event_handler(ACPI_EVENT_GLOBAL, |
@@ -413,7 +419,7 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout) | |||
413 | acpi_status status = AE_OK; | 419 | acpi_status status = AE_OK; |
414 | u8 acquired = FALSE; | 420 | u8 acquired = FALSE; |
415 | 421 | ||
416 | ACPI_FUNCTION_TRACE("ev_acquire_global_lock"); | 422 | ACPI_FUNCTION_TRACE(ev_acquire_global_lock); |
417 | 423 | ||
418 | #ifndef ACPI_APPLICATION | 424 | #ifndef ACPI_APPLICATION |
419 | /* Make sure that we actually have a global lock */ | 425 | /* Make sure that we actually have a global lock */ |
@@ -439,6 +445,7 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout) | |||
439 | 445 | ||
440 | ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired); | 446 | ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired); |
441 | if (acquired) { | 447 | if (acquired) { |
448 | |||
442 | /* We got the lock */ | 449 | /* We got the lock */ |
443 | 450 | ||
444 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 451 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
@@ -458,8 +465,9 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout) | |||
458 | * Acquire the global lock semaphore first. | 465 | * Acquire the global lock semaphore first. |
459 | * Since this wait will block, we must release the interpreter | 466 | * Since this wait will block, we must release the interpreter |
460 | */ | 467 | */ |
461 | status = acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore, | 468 | status = |
462 | timeout); | 469 | acpi_ex_system_wait_semaphore(acpi_gbl_global_lock_semaphore, |
470 | timeout); | ||
463 | return_ACPI_STATUS(status); | 471 | return_ACPI_STATUS(status); |
464 | } | 472 | } |
465 | 473 | ||
@@ -480,7 +488,7 @@ acpi_status acpi_ev_release_global_lock(void) | |||
480 | u8 pending = FALSE; | 488 | u8 pending = FALSE; |
481 | acpi_status status = AE_OK; | 489 | acpi_status status = AE_OK; |
482 | 490 | ||
483 | ACPI_FUNCTION_TRACE("ev_release_global_lock"); | 491 | ACPI_FUNCTION_TRACE(ev_release_global_lock); |
484 | 492 | ||
485 | if (!acpi_gbl_global_lock_thread_count) { | 493 | if (!acpi_gbl_global_lock_thread_count) { |
486 | ACPI_WARNING((AE_INFO, | 494 | ACPI_WARNING((AE_INFO, |
@@ -492,6 +500,7 @@ acpi_status acpi_ev_release_global_lock(void) | |||
492 | 500 | ||
493 | acpi_gbl_global_lock_thread_count--; | 501 | acpi_gbl_global_lock_thread_count--; |
494 | if (acpi_gbl_global_lock_thread_count) { | 502 | if (acpi_gbl_global_lock_thread_count) { |
503 | |||
495 | /* There are still some threads holding the lock, cannot release */ | 504 | /* There are still some threads holding the lock, cannot release */ |
496 | 505 | ||
497 | return_ACPI_STATUS(AE_OK); | 506 | return_ACPI_STATUS(AE_OK); |
@@ -533,7 +542,7 @@ void acpi_ev_terminate(void) | |||
533 | acpi_native_uint i; | 542 | acpi_native_uint i; |
534 | acpi_status status; | 543 | acpi_status status; |
535 | 544 | ||
536 | ACPI_FUNCTION_TRACE("ev_terminate"); | 545 | ACPI_FUNCTION_TRACE(ev_terminate); |
537 | 546 | ||
538 | if (acpi_gbl_events_initialized) { | 547 | if (acpi_gbl_events_initialized) { |
539 | /* | 548 | /* |
@@ -573,7 +582,7 @@ void acpi_ev_terminate(void) | |||
573 | if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) { | 582 | if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) { |
574 | status = acpi_disable(); | 583 | status = acpi_disable(); |
575 | if (ACPI_FAILURE(status)) { | 584 | if (ACPI_FAILURE(status)) { |
576 | ACPI_WARNING((AE_INFO, "acpi_disable failed")); | 585 | ACPI_WARNING((AE_INFO, "AcpiDisable failed")); |
577 | } | 586 | } |
578 | } | 587 | } |
579 | return_VOID; | 588 | return_VOID; |