aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/events
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/events')
-rw-r--r--drivers/acpi/events/evevent.c63
-rw-r--r--drivers/acpi/events/evgpe.c54
-rw-r--r--drivers/acpi/events/evgpeblk.c215
-rw-r--r--drivers/acpi/events/evmisc.c26
-rw-r--r--drivers/acpi/events/evregion.c63
-rw-r--r--drivers/acpi/events/evrgnini.c8
-rw-r--r--drivers/acpi/events/evsci.c6
-rw-r--r--drivers/acpi/events/evxface.c19
-rw-r--r--drivers/acpi/events/evxfevnt.c34
-rw-r--r--drivers/acpi/events/evxfregn.c2
10 files changed, 306 insertions, 184 deletions
diff --git a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c
index 842d1e3fb37b..c9ac05c4685f 100644
--- a/drivers/acpi/events/evevent.c
+++ b/drivers/acpi/events/evevent.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -73,7 +73,7 @@ acpi_status acpi_ev_initialize_events(void)
73 /* Make sure we have ACPI tables */ 73 /* Make sure we have ACPI tables */
74 74
75 if (!acpi_gbl_DSDT) { 75 if (!acpi_gbl_DSDT) {
76 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "No ACPI tables present!\n")); 76 ACPI_WARNING((AE_INFO, "No ACPI tables present!"));
77 return_ACPI_STATUS(AE_NO_ACPI_TABLES); 77 return_ACPI_STATUS(AE_NO_ACPI_TABLES);
78 } 78 }
79 79
@@ -84,14 +84,15 @@ acpi_status acpi_ev_initialize_events(void)
84 */ 84 */
85 status = acpi_ev_fixed_event_initialize(); 85 status = acpi_ev_fixed_event_initialize();
86 if (ACPI_FAILURE(status)) { 86 if (ACPI_FAILURE(status)) {
87 ACPI_REPORT_ERROR(("Unable to initialize fixed events, %s\n", 87 ACPI_EXCEPTION((AE_INFO, status,
88 acpi_format_exception(status))); 88 "Unable to initialize fixed events"));
89 return_ACPI_STATUS(status); 89 return_ACPI_STATUS(status);
90 } 90 }
91 91
92 status = acpi_ev_gpe_initialize(); 92 status = acpi_ev_gpe_initialize();
93 if (ACPI_FAILURE(status)) { 93 if (ACPI_FAILURE(status)) {
94 ACPI_REPORT_ERROR(("Unable to initialize general purpose events, %s\n", acpi_format_exception(status))); 94 ACPI_EXCEPTION((AE_INFO, status,
95 "Unable to initialize general purpose events"));
95 return_ACPI_STATUS(status); 96 return_ACPI_STATUS(status);
96 } 97 }
97 98
@@ -100,6 +101,48 @@ acpi_status acpi_ev_initialize_events(void)
100 101
101/******************************************************************************* 102/*******************************************************************************
102 * 103 *
104 * FUNCTION: acpi_ev_install_fadt_gpes
105 *
106 * PARAMETERS: None
107 *
108 * RETURN: Status
109 *
110 * DESCRIPTION: Completes initialization of the FADT-defined GPE blocks
111 * (0 and 1). This causes the _PRW methods to be run, so the HW
112 * must be fully initialized at this point, including global lock
113 * support.
114 *
115 ******************************************************************************/
116
117acpi_status acpi_ev_install_fadt_gpes(void)
118{
119 acpi_status status;
120
121 ACPI_FUNCTION_TRACE("ev_install_fadt_gpes");
122
123 /* Namespace must be locked */
124
125 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
126 if (ACPI_FAILURE(status)) {
127 return (status);
128 }
129
130 /* FADT GPE Block 0 */
131
132 (void)acpi_ev_initialize_gpe_block(acpi_gbl_fadt_gpe_device,
133 acpi_gbl_gpe_fadt_blocks[0]);
134
135 /* FADT GPE Block 1 */
136
137 (void)acpi_ev_initialize_gpe_block(acpi_gbl_fadt_gpe_device,
138 acpi_gbl_gpe_fadt_blocks[1]);
139
140 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
141 return_ACPI_STATUS(AE_OK);
142}
143
144/*******************************************************************************
145 *
103 * FUNCTION: acpi_ev_install_xrupt_handlers 146 * FUNCTION: acpi_ev_install_xrupt_handlers
104 * 147 *
105 * PARAMETERS: None 148 * PARAMETERS: None
@@ -120,7 +163,8 @@ acpi_status acpi_ev_install_xrupt_handlers(void)
120 163
121 status = acpi_ev_install_sci_handler(); 164 status = acpi_ev_install_sci_handler();
122 if (ACPI_FAILURE(status)) { 165 if (ACPI_FAILURE(status)) {
123 ACPI_REPORT_ERROR(("Unable to install System Control Interrupt Handler, %s\n", acpi_format_exception(status))); 166 ACPI_EXCEPTION((AE_INFO, status,
167 "Unable to install System Control Interrupt handler"));
124 return_ACPI_STATUS(status); 168 return_ACPI_STATUS(status);
125 } 169 }
126 170
@@ -128,7 +172,8 @@ acpi_status acpi_ev_install_xrupt_handlers(void)
128 172
129 status = acpi_ev_init_global_lock_handler(); 173 status = acpi_ev_init_global_lock_handler();
130 if (ACPI_FAILURE(status)) { 174 if (ACPI_FAILURE(status)) {
131 ACPI_REPORT_ERROR(("Unable to initialize Global Lock handler, %s\n", acpi_format_exception(status))); 175 ACPI_EXCEPTION((AE_INFO, status,
176 "Unable to initialize Global Lock handler"));
132 return_ACPI_STATUS(status); 177 return_ACPI_STATUS(status);
133 } 178 }
134 179
@@ -262,7 +307,9 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
262 enable_register_id, 0, 307 enable_register_id, 0,
263 ACPI_MTX_DO_NOT_LOCK); 308 ACPI_MTX_DO_NOT_LOCK);
264 309
265 ACPI_REPORT_ERROR(("No installed handler for fixed event [%08X]\n", event)); 310 ACPI_ERROR((AE_INFO,
311 "No installed handler for fixed event [%08X]",
312 event));
266 313
267 return (ACPI_INTERRUPT_NOT_HANDLED); 314 return (ACPI_INTERRUPT_NOT_HANDLED);
268 } 315 }
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index b2f232df13d8..f64f977dd3d5 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -372,14 +372,14 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
372 372
373u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) 373u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
374{ 374{
375 acpi_status status;
376 struct acpi_gpe_block_info *gpe_block;
377 struct acpi_gpe_register_info *gpe_register_info;
375 u32 int_status = ACPI_INTERRUPT_NOT_HANDLED; 378 u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
376 u8 enabled_status_byte; 379 u8 enabled_status_byte;
377 struct acpi_gpe_register_info *gpe_register_info;
378 u32 status_reg; 380 u32 status_reg;
379 u32 enable_reg; 381 u32 enable_reg;
380 u32 flags; 382 acpi_cpu_flags flags;
381 acpi_status status;
382 struct acpi_gpe_block_info *gpe_block;
383 acpi_native_uint i; 383 acpi_native_uint i;
384 acpi_native_uint j; 384 acpi_native_uint j;
385 385
@@ -546,7 +546,11 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
546 546
547 status = acpi_ns_evaluate_by_handle(&info); 547 status = acpi_ns_evaluate_by_handle(&info);
548 if (ACPI_FAILURE(status)) { 548 if (ACPI_FAILURE(status)) {
549 ACPI_REPORT_ERROR(("%s while evaluating method [%4.4s] for GPE[%2X]\n", acpi_format_exception(status), acpi_ut_get_node_name(local_gpe_event_info.dispatch.method_node), gpe_number)); 549 ACPI_EXCEPTION((AE_INFO, status,
550 "While evaluating method [%4.4s] for GPE[%2X]",
551 acpi_ut_get_node_name
552 (local_gpe_event_info.dispatch.
553 method_node), gpe_number));
550 } 554 }
551 } 555 }
552 556
@@ -599,8 +603,10 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
599 ACPI_GPE_EDGE_TRIGGERED) { 603 ACPI_GPE_EDGE_TRIGGERED) {
600 status = acpi_hw_clear_gpe(gpe_event_info); 604 status = acpi_hw_clear_gpe(gpe_event_info);
601 if (ACPI_FAILURE(status)) { 605 if (ACPI_FAILURE(status)) {
602 ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n", acpi_format_exception(status), gpe_number)); 606 ACPI_EXCEPTION((AE_INFO, status,
603 return_VALUE(ACPI_INTERRUPT_NOT_HANDLED); 607 "Unable to clear GPE[%2X]",
608 gpe_number));
609 return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
604 } 610 }
605 } 611 }
606 612
@@ -637,8 +643,10 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
637 ACPI_GPE_LEVEL_TRIGGERED) { 643 ACPI_GPE_LEVEL_TRIGGERED) {
638 status = acpi_hw_clear_gpe(gpe_event_info); 644 status = acpi_hw_clear_gpe(gpe_event_info);
639 if (ACPI_FAILURE(status)) { 645 if (ACPI_FAILURE(status)) {
640 ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to clear GPE[%2X]\n", acpi_format_exception(status), gpe_number)); 646 ACPI_EXCEPTION((AE_INFO, status,
641 return_VALUE(ACPI_INTERRUPT_NOT_HANDLED); 647 "Unable to clear GPE[%2X]",
648 gpe_number));
649 return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
642 } 650 }
643 } 651 }
644 break; 652 break;
@@ -651,8 +659,10 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
651 */ 659 */
652 status = acpi_ev_disable_gpe(gpe_event_info); 660 status = acpi_ev_disable_gpe(gpe_event_info);
653 if (ACPI_FAILURE(status)) { 661 if (ACPI_FAILURE(status)) {
654 ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to disable GPE[%2X]\n", acpi_format_exception(status), gpe_number)); 662 ACPI_EXCEPTION((AE_INFO, status,
655 return_VALUE(ACPI_INTERRUPT_NOT_HANDLED); 663 "Unable to disable GPE[%2X]",
664 gpe_number));
665 return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
656 } 666 }
657 667
658 /* 668 /*
@@ -663,7 +673,9 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
663 acpi_ev_asynch_execute_gpe_method, 673 acpi_ev_asynch_execute_gpe_method,
664 gpe_event_info); 674 gpe_event_info);
665 if (ACPI_FAILURE(status)) { 675 if (ACPI_FAILURE(status)) {
666 ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to queue handler for GPE[%2X] - event disabled\n", acpi_format_exception(status), gpe_number)); 676 ACPI_EXCEPTION((AE_INFO, status,
677 "Unable to queue handler for GPE[%2X] - event disabled",
678 gpe_number));
667 } 679 }
668 break; 680 break;
669 681
@@ -671,7 +683,9 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
671 683
672 /* No handler or method to run! */ 684 /* No handler or method to run! */
673 685
674 ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: No handler or method for GPE[%2X], disabling event\n", gpe_number)); 686 ACPI_ERROR((AE_INFO,
687 "No handler or method for GPE[%2X], disabling event",
688 gpe_number));
675 689
676 /* 690 /*
677 * Disable the GPE. The GPE will remain disabled until the ACPI 691 * Disable the GPE. The GPE will remain disabled until the ACPI
@@ -679,13 +693,15 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
679 */ 693 */
680 status = acpi_ev_disable_gpe(gpe_event_info); 694 status = acpi_ev_disable_gpe(gpe_event_info);
681 if (ACPI_FAILURE(status)) { 695 if (ACPI_FAILURE(status)) {
682 ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: %s, Unable to disable GPE[%2X]\n", acpi_format_exception(status), gpe_number)); 696 ACPI_EXCEPTION((AE_INFO, status,
683 return_VALUE(ACPI_INTERRUPT_NOT_HANDLED); 697 "Unable to disable GPE[%2X]",
698 gpe_number));
699 return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
684 } 700 }
685 break; 701 break;
686 } 702 }
687 703
688 return_VALUE(ACPI_INTERRUPT_HANDLED); 704 return_UINT32(ACPI_INTERRUPT_HANDLED);
689} 705}
690 706
691#ifdef ACPI_GPE_NOTIFY_CHECK 707#ifdef ACPI_GPE_NOTIFY_CHECK
@@ -722,7 +738,9 @@ acpi_ev_check_for_wake_only_gpe(struct acpi_gpe_event_info *gpe_event_info)
722 738
723 acpi_ev_set_gpe_type(gpe_event_info, ACPI_GPE_TYPE_WAKE); 739 acpi_ev_set_gpe_type(gpe_event_info, ACPI_GPE_TYPE_WAKE);
724 740
725 ACPI_REPORT_INFO(("GPE %p was updated from wake/run to wake-only\n", gpe_event_info)); 741 ACPI_INFO((AE_INFO,
742 "GPE %p was updated from wake/run to wake-only",
743 gpe_event_info));
726 744
727 /* This was a wake-only GPE */ 745 /* This was a wake-only GPE */
728 746
diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c
index b312eb33c43e..0fd00b5ad650 100644
--- a/drivers/acpi/events/evgpeblk.c
+++ b/drivers/acpi/events/evgpeblk.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -78,7 +78,7 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block);
78 * 78 *
79 * RETURN: TRUE if the gpe_event is valid 79 * RETURN: TRUE if the gpe_event is valid
80 * 80 *
81 * DESCRIPTION: Validate a GPE event. DO NOT CALL FROM INTERRUPT LEVEL. 81 * DESCRIPTION: Validate a GPE event. DO NOT CALL FROM INTERRUPT LEVEL.
82 * Should be called only when the GPE lists are semaphore locked 82 * Should be called only when the GPE lists are semaphore locked
83 * and not subject to change. 83 * and not subject to change.
84 * 84 *
@@ -136,7 +136,7 @@ acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback)
136 struct acpi_gpe_block_info *gpe_block; 136 struct acpi_gpe_block_info *gpe_block;
137 struct acpi_gpe_xrupt_info *gpe_xrupt_info; 137 struct acpi_gpe_xrupt_info *gpe_xrupt_info;
138 acpi_status status = AE_OK; 138 acpi_status status = AE_OK;
139 u32 flags; 139 acpi_cpu_flags flags;
140 140
141 ACPI_FUNCTION_TRACE("ev_walk_gpe_list"); 141 ACPI_FUNCTION_TRACE("ev_walk_gpe_list");
142 142
@@ -264,7 +264,7 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
264 * 2) Edge/Level determination is based on the 2nd character 264 * 2) Edge/Level determination is based on the 2nd character
265 * of the method name 265 * of the method name
266 * 266 *
267 * NOTE: Default GPE type is RUNTIME. May be changed later to WAKE 267 * NOTE: Default GPE type is RUNTIME. May be changed later to WAKE
268 * if a _PRW object is found that points to this GPE. 268 * if a _PRW object is found that points to this GPE.
269 */ 269 */
270 switch (name[1]) { 270 switch (name[1]) {
@@ -279,9 +279,9 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
279 default: 279 default:
280 /* Unknown method type, just ignore it! */ 280 /* Unknown method type, just ignore it! */
281 281
282 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 282 ACPI_ERROR((AE_INFO,
283 "Unknown GPE method type: %s (name not of form _Lxx or _Exx)\n", 283 "Unknown GPE method type: %s (name not of form _Lxx or _Exx)",
284 name)); 284 name));
285 return_ACPI_STATUS(AE_OK); 285 return_ACPI_STATUS(AE_OK);
286 } 286 }
287 287
@@ -291,9 +291,9 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
291 if (gpe_number == ACPI_UINT32_MAX) { 291 if (gpe_number == ACPI_UINT32_MAX) {
292 /* Conversion failed; invalid method, just ignore it */ 292 /* Conversion failed; invalid method, just ignore it */
293 293
294 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 294 ACPI_ERROR((AE_INFO,
295 "Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)\n", 295 "Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)",
296 name)); 296 name));
297 return_ACPI_STATUS(AE_OK); 297 return_ACPI_STATUS(AE_OK);
298 } 298 }
299 299
@@ -313,14 +313,14 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
313 313
314 /* 314 /*
315 * Now we can add this information to the gpe_event_info block 315 * Now we can add this information to the gpe_event_info block
316 * for use during dispatch of this GPE. Default type is RUNTIME, although 316 * for use during dispatch of this GPE. Default type is RUNTIME, although
317 * this may change when the _PRW methods are executed later. 317 * this may change when the _PRW methods are executed later.
318 */ 318 */
319 gpe_event_info = 319 gpe_event_info =
320 &gpe_block->event_info[gpe_number - gpe_block->block_base_number]; 320 &gpe_block->event_info[gpe_number - gpe_block->block_base_number];
321 321
322 gpe_event_info->flags = (u8) (type | ACPI_GPE_DISPATCH_METHOD | 322 gpe_event_info->flags = (u8)
323 ACPI_GPE_TYPE_RUNTIME); 323 (type | ACPI_GPE_DISPATCH_METHOD | ACPI_GPE_TYPE_RUNTIME);
324 324
325 gpe_event_info->dispatch.method_node = 325 gpe_event_info->dispatch.method_node =
326 (struct acpi_namespace_node *)obj_handle; 326 (struct acpi_namespace_node *)obj_handle;
@@ -341,11 +341,11 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
341 * 341 *
342 * PARAMETERS: Callback from walk_namespace 342 * PARAMETERS: Callback from walk_namespace
343 * 343 *
344 * RETURN: Status. NOTE: We ignore errors so that the _PRW walk is 344 * RETURN: Status. NOTE: We ignore errors so that the _PRW walk is
345 * not aborted on a single _PRW failure. 345 * not aborted on a single _PRW failure.
346 * 346 *
347 * DESCRIPTION: Called from acpi_walk_namespace. Expects each object to be a 347 * DESCRIPTION: Called from acpi_walk_namespace. Expects each object to be a
348 * Device. Run the _PRW method. If present, extract the GPE 348 * Device. Run the _PRW method. If present, extract the GPE
349 * number and mark the GPE as a WAKE GPE. 349 * number and mark the GPE as a WAKE GPE.
350 * 350 *
351 ******************************************************************************/ 351 ******************************************************************************/
@@ -443,6 +443,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
443 443
444 gpe_event_info->flags &= 444 gpe_event_info->flags &=
445 ~(ACPI_GPE_WAKE_ENABLED | ACPI_GPE_RUN_ENABLED); 445 ~(ACPI_GPE_WAKE_ENABLED | ACPI_GPE_RUN_ENABLED);
446
446 status = 447 status =
447 acpi_ev_set_gpe_type(gpe_event_info, ACPI_GPE_TYPE_WAKE); 448 acpi_ev_set_gpe_type(gpe_event_info, ACPI_GPE_TYPE_WAKE);
448 if (ACPI_FAILURE(status)) { 449 if (ACPI_FAILURE(status)) {
@@ -466,7 +467,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
466 * 467 *
467 * RETURN: A GPE interrupt block 468 * RETURN: A GPE interrupt block
468 * 469 *
469 * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt 470 * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
470 * block per unique interrupt level used for GPEs. 471 * block per unique interrupt level used for GPEs.
471 * Should be called only when the GPE lists are semaphore locked 472 * Should be called only when the GPE lists are semaphore locked
472 * and not subject to change. 473 * and not subject to change.
@@ -479,7 +480,7 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32
479 struct acpi_gpe_xrupt_info *next_gpe_xrupt; 480 struct acpi_gpe_xrupt_info *next_gpe_xrupt;
480 struct acpi_gpe_xrupt_info *gpe_xrupt; 481 struct acpi_gpe_xrupt_info *gpe_xrupt;
481 acpi_status status; 482 acpi_status status;
482 u32 flags; 483 acpi_cpu_flags flags;
483 484
484 ACPI_FUNCTION_TRACE("ev_get_gpe_xrupt_block"); 485 ACPI_FUNCTION_TRACE("ev_get_gpe_xrupt_block");
485 486
@@ -526,9 +527,9 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32
526 acpi_ev_gpe_xrupt_handler, 527 acpi_ev_gpe_xrupt_handler,
527 gpe_xrupt); 528 gpe_xrupt);
528 if (ACPI_FAILURE(status)) { 529 if (ACPI_FAILURE(status)) {
529 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 530 ACPI_ERROR((AE_INFO,
530 "Could not install GPE interrupt handler at level 0x%X\n", 531 "Could not install GPE interrupt handler at level 0x%X",
531 interrupt_number)); 532 interrupt_number));
532 return_PTR(NULL); 533 return_PTR(NULL);
533 } 534 }
534 } 535 }
@@ -553,7 +554,7 @@ static acpi_status
553acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt) 554acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)
554{ 555{
555 acpi_status status; 556 acpi_status status;
556 u32 flags; 557 acpi_cpu_flags flags;
557 558
558 ACPI_FUNCTION_TRACE("ev_delete_gpe_xrupt"); 559 ACPI_FUNCTION_TRACE("ev_delete_gpe_xrupt");
559 560
@@ -566,8 +567,9 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)
566 567
567 /* Disable this interrupt */ 568 /* Disable this interrupt */
568 569
569 status = acpi_os_remove_interrupt_handler(gpe_xrupt->interrupt_number, 570 status =
570 acpi_ev_gpe_xrupt_handler); 571 acpi_os_remove_interrupt_handler(gpe_xrupt->interrupt_number,
572 acpi_ev_gpe_xrupt_handler);
571 if (ACPI_FAILURE(status)) { 573 if (ACPI_FAILURE(status)) {
572 return_ACPI_STATUS(status); 574 return_ACPI_STATUS(status);
573 } 575 }
@@ -610,7 +612,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
610 struct acpi_gpe_block_info *next_gpe_block; 612 struct acpi_gpe_block_info *next_gpe_block;
611 struct acpi_gpe_xrupt_info *gpe_xrupt_block; 613 struct acpi_gpe_xrupt_info *gpe_xrupt_block;
612 acpi_status status; 614 acpi_status status;
613 u32 flags; 615 acpi_cpu_flags flags;
614 616
615 ACPI_FUNCTION_TRACE("ev_install_gpe_block"); 617 ACPI_FUNCTION_TRACE("ev_install_gpe_block");
616 618
@@ -663,7 +665,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
663acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block) 665acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
664{ 666{
665 acpi_status status; 667 acpi_status status;
666 u32 flags; 668 acpi_cpu_flags flags;
667 669
668 ACPI_FUNCTION_TRACE("ev_install_gpe_block"); 670 ACPI_FUNCTION_TRACE("ev_install_gpe_block");
669 671
@@ -743,22 +745,22 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
743 sizeof(struct 745 sizeof(struct
744 acpi_gpe_register_info)); 746 acpi_gpe_register_info));
745 if (!gpe_register_info) { 747 if (!gpe_register_info) {
746 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 748 ACPI_ERROR((AE_INFO,
747 "Could not allocate the gpe_register_info table\n")); 749 "Could not allocate the gpe_register_info table"));
748 return_ACPI_STATUS(AE_NO_MEMORY); 750 return_ACPI_STATUS(AE_NO_MEMORY);
749 } 751 }
750 752
751 /* 753 /*
752 * Allocate the GPE event_info block. There are eight distinct GPEs 754 * Allocate the GPE event_info block. There are eight distinct GPEs
753 * per register. Initialization to zeros is sufficient. 755 * per register. Initialization to zeros is sufficient.
754 */ 756 */
755 gpe_event_info = ACPI_MEM_CALLOCATE(((acpi_size) gpe_block-> 757 gpe_event_info = ACPI_MEM_CALLOCATE(((acpi_size) gpe_block->
756 register_count * 758 register_count *
757 ACPI_GPE_REGISTER_WIDTH) * 759 ACPI_GPE_REGISTER_WIDTH) *
758 sizeof(struct acpi_gpe_event_info)); 760 sizeof(struct acpi_gpe_event_info));
759 if (!gpe_event_info) { 761 if (!gpe_event_info) {
760 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 762 ACPI_ERROR((AE_INFO,
761 "Could not allocate the gpe_event_info table\n")); 763 "Could not allocate the gpe_event_info table"));
762 status = AE_NO_MEMORY; 764 status = AE_NO_MEMORY;
763 goto error_exit; 765 goto error_exit;
764 } 766 }
@@ -769,9 +771,9 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
769 gpe_block->event_info = gpe_event_info; 771 gpe_block->event_info = gpe_event_info;
770 772
771 /* 773 /*
772 * Initialize the GPE Register and Event structures. A goal of these 774 * Initialize the GPE Register and Event structures. A goal of these
773 * tables is to hide the fact that there are two separate GPE register sets 775 * tables is to hide the fact that there are two separate GPE register sets
774 * in a given gpe hardware block, the status registers occupy the first half, 776 * in a given GPE hardware block, the status registers occupy the first half,
775 * and the enable registers occupy the second half. 777 * and the enable registers occupy the second half.
776 */ 778 */
777 this_register = gpe_register_info; 779 this_register = gpe_register_info;
@@ -812,11 +814,8 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
812 this_event++; 814 this_event++;
813 } 815 }
814 816
815 /* 817 /* Disable all GPEs within this register */
816 * Clear the status/enable registers. Note that status registers 818
817 * are cleared by writing a '1', while enable registers are cleared
818 * by writing a '0'.
819 */
820 status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0x00, 819 status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0x00,
821 &this_register-> 820 &this_register->
822 enable_address); 821 enable_address);
@@ -824,6 +823,8 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
824 goto error_exit; 823 goto error_exit;
825 } 824 }
826 825
826 /* Clear any pending GPE events within this register */
827
827 status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0xFF, 828 status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0xFF,
828 &this_register-> 829 &this_register->
829 status_address); 830 status_address);
@@ -860,7 +861,9 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
860 * 861 *
861 * RETURN: Status 862 * RETURN: Status
862 * 863 *
863 * DESCRIPTION: Create and Install a block of GPE registers 864 * DESCRIPTION: Create and Install a block of GPE registers. All GPEs within
865 * the block are disabled at exit.
866 * Note: Assumes namespace is locked.
864 * 867 *
865 ******************************************************************************/ 868 ******************************************************************************/
866 869
@@ -872,14 +875,8 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
872 u32 interrupt_number, 875 u32 interrupt_number,
873 struct acpi_gpe_block_info **return_gpe_block) 876 struct acpi_gpe_block_info **return_gpe_block)
874{ 877{
875 struct acpi_gpe_block_info *gpe_block;
876 struct acpi_gpe_event_info *gpe_event_info;
877 acpi_native_uint i;
878 acpi_native_uint j;
879 u32 wake_gpe_count;
880 u32 gpe_enabled_count;
881 acpi_status status; 878 acpi_status status;
882 struct acpi_gpe_walk_info gpe_info; 879 struct acpi_gpe_block_info *gpe_block;
883 880
884 ACPI_FUNCTION_TRACE("ev_create_gpe_block"); 881 ACPI_FUNCTION_TRACE("ev_create_gpe_block");
885 882
@@ -896,22 +893,24 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
896 893
897 /* Initialize the new GPE block */ 894 /* Initialize the new GPE block */
898 895
896 gpe_block->node = gpe_device;
899 gpe_block->register_count = register_count; 897 gpe_block->register_count = register_count;
900 gpe_block->block_base_number = gpe_block_base_number; 898 gpe_block->block_base_number = gpe_block_base_number;
901 gpe_block->node = gpe_device;
902 899
903 ACPI_MEMCPY(&gpe_block->block_address, gpe_block_address, 900 ACPI_MEMCPY(&gpe_block->block_address, gpe_block_address,
904 sizeof(struct acpi_generic_address)); 901 sizeof(struct acpi_generic_address));
905 902
906 /* Create the register_info and event_info sub-structures */ 903 /*
907 904 * Create the register_info and event_info sub-structures
905 * Note: disables and clears all GPEs in the block
906 */
908 status = acpi_ev_create_gpe_info_blocks(gpe_block); 907 status = acpi_ev_create_gpe_info_blocks(gpe_block);
909 if (ACPI_FAILURE(status)) { 908 if (ACPI_FAILURE(status)) {
910 ACPI_MEM_FREE(gpe_block); 909 ACPI_MEM_FREE(gpe_block);
911 return_ACPI_STATUS(status); 910 return_ACPI_STATUS(status);
912 } 911 }
913 912
914 /* Install the new block in the global list(s) */ 913 /* Install the new block in the global lists */
915 914
916 status = acpi_ev_install_gpe_block(gpe_block, interrupt_number); 915 status = acpi_ev_install_gpe_block(gpe_block, interrupt_number);
917 if (ACPI_FAILURE(status)) { 916 if (ACPI_FAILURE(status)) {
@@ -926,16 +925,70 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
926 acpi_ev_save_method_info, gpe_block, 925 acpi_ev_save_method_info, gpe_block,
927 NULL); 926 NULL);
928 927
928 /* Return the new block */
929
930 if (return_gpe_block) {
931 (*return_gpe_block) = gpe_block;
932 }
933
934 ACPI_DEBUG_PRINT((ACPI_DB_INIT,
935 "GPE %02X to %02X [%4.4s] %u regs on int 0x%X\n",
936 (u32) gpe_block->block_base_number,
937 (u32) (gpe_block->block_base_number +
938 ((gpe_block->register_count *
939 ACPI_GPE_REGISTER_WIDTH) - 1)),
940 gpe_device->name.ascii, gpe_block->register_count,
941 interrupt_number));
942
943 return_ACPI_STATUS(AE_OK);
944}
945
946/*******************************************************************************
947 *
948 * FUNCTION: acpi_ev_initialize_gpe_block
949 *
950 * PARAMETERS: gpe_device - Handle to the parent GPE block
951 * gpe_block - Gpe Block info
952 *
953 * RETURN: Status
954 *
955 * DESCRIPTION: Initialize and enable a GPE block. First find and run any
956 * _PRT methods associated with the block, then enable the
957 * appropriate GPEs.
958 * Note: Assumes namespace is locked.
959 *
960 ******************************************************************************/
961
962acpi_status
963acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
964 struct acpi_gpe_block_info *gpe_block)
965{
966 acpi_status status;
967 struct acpi_gpe_event_info *gpe_event_info;
968 struct acpi_gpe_walk_info gpe_info;
969 u32 wake_gpe_count;
970 u32 gpe_enabled_count;
971 acpi_native_uint i;
972 acpi_native_uint j;
973
974 ACPI_FUNCTION_TRACE("ev_initialize_gpe_block");
975
976 /* Ignore a null GPE block (e.g., if no GPE block 1 exists) */
977
978 if (!gpe_block) {
979 return_ACPI_STATUS(AE_OK);
980 }
981
929 /* 982 /*
930 * Runtime option: Should Wake GPEs be enabled at runtime? The default 983 * Runtime option: Should wake GPEs be enabled at runtime? The default
931 * is No, they should only be enabled just as the machine goes to sleep. 984 * is no, they should only be enabled just as the machine goes to sleep.
932 */ 985 */
933 if (acpi_gbl_leave_wake_gpes_disabled) { 986 if (acpi_gbl_leave_wake_gpes_disabled) {
934 /* 987 /*
935 * Differentiate RUNTIME vs WAKE GPEs, via the _PRW control methods. 988 * Differentiate runtime vs wake GPEs, via the _PRW control methods.
936 * (Each GPE that has one or more _PRWs that reference it is by 989 * Each GPE that has one or more _PRWs that reference it is by
937 * definition a WAKE GPE and will not be enabled while the machine 990 * definition a wake GPE and will not be enabled while the machine
938 * is running.) 991 * is running.
939 */ 992 */
940 gpe_info.gpe_block = gpe_block; 993 gpe_info.gpe_block = gpe_block;
941 gpe_info.gpe_device = gpe_device; 994 gpe_info.gpe_device = gpe_device;
@@ -948,9 +1001,12 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
948 } 1001 }
949 1002
950 /* 1003 /*
951 * Enable all GPEs in this block that are 1) "runtime" or "run/wake" GPEs, 1004 * Enable all GPEs in this block that have these attributes:
952 * and 2) have a corresponding _Lxx or _Exx method. All other GPEs must 1005 * 1) are "runtime" or "run/wake" GPEs, and
953 * be enabled via the acpi_enable_gpe() external interface. 1006 * 2) have a corresponding _Lxx or _Exx method
1007 *
1008 * Any other GPEs within this block must be enabled via the acpi_enable_gpe()
1009 * external interface.
954 */ 1010 */
955 wake_gpe_count = 0; 1011 wake_gpe_count = 0;
956 gpe_enabled_count = 0; 1012 gpe_enabled_count = 0;
@@ -976,32 +1032,19 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
976 } 1032 }
977 } 1033 }
978 1034
979 /* Dump info about this GPE block */
980
981 ACPI_DEBUG_PRINT((ACPI_DB_INIT,
982 "GPE %02X to %02X [%4.4s] %u regs on int 0x%X\n",
983 (u32) gpe_block->block_base_number,
984 (u32) (gpe_block->block_base_number +
985 ((gpe_block->register_count *
986 ACPI_GPE_REGISTER_WIDTH) - 1)),
987 gpe_device->name.ascii, gpe_block->register_count,
988 interrupt_number));
989
990 /* Enable all valid GPEs found above */
991
992 status = acpi_hw_enable_runtime_gpe_block(NULL, gpe_block);
993
994 ACPI_DEBUG_PRINT((ACPI_DB_INIT, 1035 ACPI_DEBUG_PRINT((ACPI_DB_INIT,
995 "Found %u Wake, Enabled %u Runtime GPEs in this block\n", 1036 "Found %u Wake, Enabled %u Runtime GPEs in this block\n",
996 wake_gpe_count, gpe_enabled_count)); 1037 wake_gpe_count, gpe_enabled_count));
997 1038
998 /* Return the new block */ 1039 /* Enable all valid runtime GPEs found above */
999 1040
1000 if (return_gpe_block) { 1041 status = acpi_hw_enable_runtime_gpe_block(NULL, gpe_block);
1001 (*return_gpe_block) = gpe_block; 1042 if (ACPI_FAILURE(status)) {
1043 ACPI_ERROR((AE_INFO, "Could not enable GPEs in gpe_block %p",
1044 gpe_block));
1002 } 1045 }
1003 1046
1004 return_ACPI_STATUS(AE_OK); 1047 return_ACPI_STATUS(status);
1005} 1048}
1006 1049
1007/******************************************************************************* 1050/*******************************************************************************
@@ -1072,8 +1115,8 @@ acpi_status acpi_ev_gpe_initialize(void)
1072 &acpi_gbl_gpe_fadt_blocks[0]); 1115 &acpi_gbl_gpe_fadt_blocks[0]);
1073 1116
1074 if (ACPI_FAILURE(status)) { 1117 if (ACPI_FAILURE(status)) {
1075 ACPI_REPORT_ERROR(("Could not create GPE Block 0, %s\n", 1118 ACPI_EXCEPTION((AE_INFO, status,
1076 acpi_format_exception(status))); 1119 "Could not create GPE Block 0"));
1077 } 1120 }
1078 } 1121 }
1079 1122
@@ -1086,7 +1129,12 @@ acpi_status acpi_ev_gpe_initialize(void)
1086 1129
1087 if ((register_count0) && 1130 if ((register_count0) &&
1088 (gpe_number_max >= acpi_gbl_FADT->gpe1_base)) { 1131 (gpe_number_max >= acpi_gbl_FADT->gpe1_base)) {
1089 ACPI_REPORT_ERROR(("GPE0 block (GPE 0 to %d) overlaps the GPE1 block (GPE %d to %d) - Ignoring GPE1\n", gpe_number_max, acpi_gbl_FADT->gpe1_base, acpi_gbl_FADT->gpe1_base + ((register_count1 * ACPI_GPE_REGISTER_WIDTH) - 1))); 1132 ACPI_ERROR((AE_INFO,
1133 "GPE0 block (GPE 0 to %d) overlaps the GPE1 block (GPE %d to %d) - Ignoring GPE1",
1134 gpe_number_max, acpi_gbl_FADT->gpe1_base,
1135 acpi_gbl_FADT->gpe1_base +
1136 ((register_count1 *
1137 ACPI_GPE_REGISTER_WIDTH) - 1)));
1090 1138
1091 /* Ignore GPE1 block by setting the register count to zero */ 1139 /* Ignore GPE1 block by setting the register count to zero */
1092 1140
@@ -1104,7 +1152,8 @@ acpi_status acpi_ev_gpe_initialize(void)
1104 [1]); 1152 [1]);
1105 1153
1106 if (ACPI_FAILURE(status)) { 1154 if (ACPI_FAILURE(status)) {
1107 ACPI_REPORT_ERROR(("Could not create GPE Block 1, %s\n", acpi_format_exception(status))); 1155 ACPI_EXCEPTION((AE_INFO, status,
1156 "Could not create GPE Block 1"));
1108 } 1157 }
1109 1158
1110 /* 1159 /*
@@ -1130,7 +1179,9 @@ acpi_status acpi_ev_gpe_initialize(void)
1130 /* Check for Max GPE number out-of-range */ 1179 /* Check for Max GPE number out-of-range */
1131 1180
1132 if (gpe_number_max > ACPI_GPE_MAX) { 1181 if (gpe_number_max > ACPI_GPE_MAX) {
1133 ACPI_REPORT_ERROR(("Maximum GPE number from FADT is too large: 0x%X\n", gpe_number_max)); 1182 ACPI_ERROR((AE_INFO,
1183 "Maximum GPE number from FADT is too large: 0x%X",
1184 gpe_number_max));
1134 status = AE_BAD_VALUE; 1185 status = AE_BAD_VALUE;
1135 goto cleanup; 1186 goto cleanup;
1136 } 1187 }
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 7e57b8470f55..0909ba69577e 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -303,7 +303,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread(void *context)
303 acpi_os_signal_semaphore(acpi_gbl_global_lock_semaphore, 303 acpi_os_signal_semaphore(acpi_gbl_global_lock_semaphore,
304 acpi_gbl_global_lock_thread_count); 304 acpi_gbl_global_lock_thread_count);
305 if (ACPI_FAILURE(status)) { 305 if (ACPI_FAILURE(status)) {
306 ACPI_REPORT_ERROR(("Could not signal Global Lock semaphore\n")); 306 ACPI_ERROR((AE_INFO,
307 "Could not signal Global Lock semaphore"));
307 } 308 }
308 } 309 }
309} 310}
@@ -344,7 +345,8 @@ static u32 acpi_ev_global_lock_handler(void *context)
344 acpi_ev_global_lock_thread, 345 acpi_ev_global_lock_thread,
345 context); 346 context);
346 if (ACPI_FAILURE(status)) { 347 if (ACPI_FAILURE(status)) {
347 ACPI_REPORT_ERROR(("Could not queue Global Lock thread, %s\n", acpi_format_exception(status))); 348 ACPI_EXCEPTION((AE_INFO, status,
349 "Could not queue Global Lock thread"));
348 350
349 return (ACPI_INTERRUPT_NOT_HANDLED); 351 return (ACPI_INTERRUPT_NOT_HANDLED);
350 } 352 }
@@ -384,7 +386,8 @@ acpi_status acpi_ev_init_global_lock_handler(void)
384 * with an error. 386 * with an error.
385 */ 387 */
386 if (status == AE_NO_HARDWARE_RESPONSE) { 388 if (status == AE_NO_HARDWARE_RESPONSE) {
387 ACPI_REPORT_ERROR(("No response from Global Lock hardware, disabling lock\n")); 389 ACPI_ERROR((AE_INFO,
390 "No response from Global Lock hardware, disabling lock"));
388 391
389 acpi_gbl_global_lock_present = FALSE; 392 acpi_gbl_global_lock_present = FALSE;
390 status = AE_OK; 393 status = AE_OK;
@@ -480,7 +483,8 @@ acpi_status acpi_ev_release_global_lock(void)
480 ACPI_FUNCTION_TRACE("ev_release_global_lock"); 483 ACPI_FUNCTION_TRACE("ev_release_global_lock");
481 484
482 if (!acpi_gbl_global_lock_thread_count) { 485 if (!acpi_gbl_global_lock_thread_count) {
483 ACPI_REPORT_WARNING(("Cannot release HW Global Lock, it has not been acquired\n")); 486 ACPI_WARNING((AE_INFO,
487 "Cannot release HW Global Lock, it has not been acquired"));
484 return_ACPI_STATUS(AE_NOT_ACQUIRED); 488 return_ACPI_STATUS(AE_NOT_ACQUIRED);
485 } 489 }
486 490
@@ -542,9 +546,9 @@ void acpi_ev_terminate(void)
542 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { 546 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
543 status = acpi_disable_event((u32) i, 0); 547 status = acpi_disable_event((u32) i, 0);
544 if (ACPI_FAILURE(status)) { 548 if (ACPI_FAILURE(status)) {
545 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 549 ACPI_ERROR((AE_INFO,
546 "Could not disable fixed event %d\n", 550 "Could not disable fixed event %d",
547 (u32) i)); 551 (u32) i));
548 } 552 }
549 } 553 }
550 554
@@ -556,8 +560,7 @@ void acpi_ev_terminate(void)
556 560
557 status = acpi_ev_remove_sci_handler(); 561 status = acpi_ev_remove_sci_handler();
558 if (ACPI_FAILURE(status)) { 562 if (ACPI_FAILURE(status)) {
559 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 563 ACPI_ERROR((AE_INFO, "Could not remove SCI handler"));
560 "Could not remove SCI handler\n"));
561 } 564 }
562 } 565 }
563 566
@@ -570,8 +573,7 @@ void acpi_ev_terminate(void)
570 if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) { 573 if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) {
571 status = acpi_disable(); 574 status = acpi_disable();
572 if (ACPI_FAILURE(status)) { 575 if (ACPI_FAILURE(status)) {
573 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 576 ACPI_WARNING((AE_INFO, "acpi_disable failed"));
574 "acpi_disable failed\n"));
575 } 577 }
576 } 578 }
577 return_VOID; 579 return_VOID;
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
index 84fad082d80d..6da58e776413 100644
--- a/drivers/acpi/events/evregion.c
+++ b/drivers/acpi/events/evregion.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -295,12 +295,12 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
295 295
296 handler_desc = region_obj->region.handler; 296 handler_desc = region_obj->region.handler;
297 if (!handler_desc) { 297 if (!handler_desc) {
298 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 298 ACPI_ERROR((AE_INFO,
299 "No handler for Region [%4.4s] (%p) [%s]\n", 299 "No handler for Region [%4.4s] (%p) [%s]",
300 acpi_ut_get_node_name(region_obj->region. 300 acpi_ut_get_node_name(region_obj->region.node),
301 node), region_obj, 301 region_obj,
302 acpi_ut_get_region_name(region_obj->region. 302 acpi_ut_get_region_name(region_obj->region.
303 space_id))); 303 space_id)));
304 304
305 return_ACPI_STATUS(AE_NOT_EXIST); 305 return_ACPI_STATUS(AE_NOT_EXIST);
306 } 306 }
@@ -317,12 +317,11 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
317 if (!region_setup) { 317 if (!region_setup) {
318 /* No initialization routine, exit with error */ 318 /* No initialization routine, exit with error */
319 319
320 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 320 ACPI_ERROR((AE_INFO,
321 "No init routine for region(%p) [%s]\n", 321 "No init routine for region(%p) [%s]",
322 region_obj, 322 region_obj,
323 acpi_ut_get_region_name(region_obj-> 323 acpi_ut_get_region_name(region_obj->region.
324 region. 324 space_id)));
325 space_id)));
326 return_ACPI_STATUS(AE_NOT_EXIST); 325 return_ACPI_STATUS(AE_NOT_EXIST);
327 } 326 }
328 327
@@ -347,12 +346,11 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
347 /* Check for failure of the Region Setup */ 346 /* Check for failure of the Region Setup */
348 347
349 if (ACPI_FAILURE(status)) { 348 if (ACPI_FAILURE(status)) {
350 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 349 ACPI_EXCEPTION((AE_INFO, status,
351 "Region Init: %s [%s]\n", 350 "During region initialization: [%s]",
352 acpi_format_exception(status), 351 acpi_ut_get_region_name(region_obj->
353 acpi_ut_get_region_name(region_obj-> 352 region.
354 region. 353 space_id)));
355 space_id)));
356 return_ACPI_STATUS(status); 354 return_ACPI_STATUS(status);
357 } 355 }
358 356
@@ -406,10 +404,9 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
406 region_obj2->extra.region_context); 404 region_obj2->extra.region_context);
407 405
408 if (ACPI_FAILURE(status)) { 406 if (ACPI_FAILURE(status)) {
409 ACPI_REPORT_ERROR(("Handler for [%s] returned %s\n", 407 ACPI_EXCEPTION((AE_INFO, status, "Returned by Handler for [%s]",
410 acpi_ut_get_region_name(region_obj->region. 408 acpi_ut_get_region_name(region_obj->region.
411 space_id), 409 space_id)));
412 acpi_format_exception(status)));
413 } 410 }
414 411
415 if (! 412 if (!
@@ -501,12 +498,10 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
501 498
502 status = acpi_ev_execute_reg_method(region_obj, 0); 499 status = acpi_ev_execute_reg_method(region_obj, 0);
503 if (ACPI_FAILURE(status)) { 500 if (ACPI_FAILURE(status)) {
504 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 501 ACPI_EXCEPTION((AE_INFO, status,
505 "%s from region _REG, [%s]\n", 502 "from region _REG, [%s]",
506 acpi_format_exception(status), 503 acpi_ut_get_region_name
507 acpi_ut_get_region_name 504 (region_obj->region.space_id)));
508 (region_obj->region.
509 space_id)));
510 } 505 }
511 506
512 if (acpi_ns_is_locked) { 507 if (acpi_ns_is_locked) {
@@ -528,12 +523,10 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
528 /* Init routine may fail, Just ignore errors */ 523 /* Init routine may fail, Just ignore errors */
529 524
530 if (ACPI_FAILURE(status)) { 525 if (ACPI_FAILURE(status)) {
531 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 526 ACPI_EXCEPTION((AE_INFO, status,
532 "%s from region init, [%s]\n", 527 "from region init, [%s]",
533 acpi_format_exception(status), 528 acpi_ut_get_region_name
534 acpi_ut_get_region_name 529 (region_obj->region.space_id)));
535 (region_obj->region.
536 space_id)));
537 } 530 }
538 531
539 region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE); 532 region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE);
diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c
index a1bd2da27c45..baed8c1a1b9f 100644
--- a/drivers/acpi/events/evrgnini.c
+++ b/drivers/acpi/events/evrgnini.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -233,7 +233,11 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
233 */ 233 */
234 status = AE_OK; 234 status = AE_OK;
235 } else { 235 } else {
236 ACPI_REPORT_ERROR(("Could not install pci_config handler for Root Bridge %4.4s, %s\n", acpi_ut_get_node_name(pci_root_node), acpi_format_exception(status))); 236 ACPI_EXCEPTION((AE_INFO,
237 status,
238 "Could not install pci_config handler for Root Bridge %4.4s",
239 acpi_ut_get_node_name
240 (pci_root_node)));
237 } 241 }
238 } 242 }
239 break; 243 break;
diff --git a/drivers/acpi/events/evsci.c b/drivers/acpi/events/evsci.c
index 141835977002..9a622169008a 100644
--- a/drivers/acpi/events/evsci.c
+++ b/drivers/acpi/events/evsci.c
@@ -6,7 +6,7 @@
6 ******************************************************************************/ 6 ******************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2005, R. Byron Moore 9 * Copyright (C) 2000 - 2006, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -88,7 +88,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)
88 */ 88 */
89 interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list); 89 interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
90 90
91 return_VALUE(interrupt_handled); 91 return_UINT32(interrupt_handled);
92} 92}
93 93
94/******************************************************************************* 94/*******************************************************************************
@@ -121,7 +121,7 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)
121 */ 121 */
122 interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list); 122 interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
123 123
124 return_VALUE(interrupt_handled); 124 return_UINT32(interrupt_handled);
125} 125}
126 126
127/****************************************************************************** 127/******************************************************************************
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index 43b33d19cdf9..b38b39dde543 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -143,8 +143,8 @@ acpi_install_fixed_event_handler(u32 event,
143 if (ACPI_SUCCESS(status)) 143 if (ACPI_SUCCESS(status))
144 status = acpi_enable_event(event, 0); 144 status = acpi_enable_event(event, 0);
145 if (ACPI_FAILURE(status)) { 145 if (ACPI_FAILURE(status)) {
146 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 146 ACPI_WARNING((AE_INFO, "Could not enable fixed event %X",
147 "Could not enable fixed event.\n")); 147 event));
148 148
149 /* Remove the handler */ 149 /* Remove the handler */
150 150
@@ -204,10 +204,11 @@ acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
204 acpi_gbl_fixed_event_handlers[event].context = NULL; 204 acpi_gbl_fixed_event_handlers[event].context = NULL;
205 205
206 if (ACPI_FAILURE(status)) { 206 if (ACPI_FAILURE(status)) {
207 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 207 ACPI_WARNING((AE_INFO,
208 "Could not write to fixed event enable register.\n")); 208 "Could not write to fixed event enable register %X",
209 event));
209 } else { 210 } else {
210 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X.\n", 211 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n",
211 event)); 212 event));
212 } 213 }
213 214
@@ -434,7 +435,7 @@ acpi_remove_notify_handler(acpi_handle device,
434 435
435 if (device == ACPI_ROOT_OBJECT) { 436 if (device == ACPI_ROOT_OBJECT) {
436 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 437 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
437 "Removing notify handler for ROOT object.\n")); 438 "Removing notify handler for namespace root object\n"));
438 439
439 if (((handler_type & ACPI_SYSTEM_NOTIFY) && 440 if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
440 !acpi_gbl_system_notify.handler) || 441 !acpi_gbl_system_notify.handler) ||
@@ -562,7 +563,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
562 struct acpi_gpe_event_info *gpe_event_info; 563 struct acpi_gpe_event_info *gpe_event_info;
563 struct acpi_handler_info *handler; 564 struct acpi_handler_info *handler;
564 acpi_status status; 565 acpi_status status;
565 u32 flags; 566 acpi_cpu_flags flags;
566 567
567 ACPI_FUNCTION_TRACE("acpi_install_gpe_handler"); 568 ACPI_FUNCTION_TRACE("acpi_install_gpe_handler");
568 569
@@ -653,7 +654,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
653 struct acpi_gpe_event_info *gpe_event_info; 654 struct acpi_gpe_event_info *gpe_event_info;
654 struct acpi_handler_info *handler; 655 struct acpi_handler_info *handler;
655 acpi_status status; 656 acpi_status status;
656 u32 flags; 657 acpi_cpu_flags flags;
657 658
658 ACPI_FUNCTION_TRACE("acpi_remove_gpe_handler"); 659 ACPI_FUNCTION_TRACE("acpi_remove_gpe_handler");
659 660
diff --git a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c
index 887ff9f28a0d..ec9ce8429f15 100644
--- a/drivers/acpi/events/evxfevnt.c
+++ b/drivers/acpi/events/evxfevnt.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore 8 * Copyright (C) 2000 - 2006, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -70,8 +70,7 @@ acpi_status acpi_enable(void)
70 /* Make sure we have the FADT */ 70 /* Make sure we have the FADT */
71 71
72 if (!acpi_gbl_FADT) { 72 if (!acpi_gbl_FADT) {
73 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 73 ACPI_WARNING((AE_INFO, "No FADT information present!"));
74 "No FADT information present!\n"));
75 return_ACPI_STATUS(AE_NO_ACPI_TABLES); 74 return_ACPI_STATUS(AE_NO_ACPI_TABLES);
76 } 75 }
77 76
@@ -83,7 +82,8 @@ acpi_status acpi_enable(void)
83 82
84 status = acpi_hw_set_mode(ACPI_SYS_MODE_ACPI); 83 status = acpi_hw_set_mode(ACPI_SYS_MODE_ACPI);
85 if (ACPI_FAILURE(status)) { 84 if (ACPI_FAILURE(status)) {
86 ACPI_REPORT_ERROR(("Could not transition to ACPI mode.\n")); 85 ACPI_ERROR((AE_INFO,
86 "Could not transition to ACPI mode"));
87 return_ACPI_STATUS(status); 87 return_ACPI_STATUS(status);
88 } 88 }
89 89
@@ -113,8 +113,7 @@ acpi_status acpi_disable(void)
113 ACPI_FUNCTION_TRACE("acpi_disable"); 113 ACPI_FUNCTION_TRACE("acpi_disable");
114 114
115 if (!acpi_gbl_FADT) { 115 if (!acpi_gbl_FADT) {
116 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 116 ACPI_WARNING((AE_INFO, "No FADT information present!"));
117 "No FADT information present!\n"));
118 return_ACPI_STATUS(AE_NO_ACPI_TABLES); 117 return_ACPI_STATUS(AE_NO_ACPI_TABLES);
119 } 118 }
120 119
@@ -127,8 +126,8 @@ acpi_status acpi_disable(void)
127 status = acpi_hw_set_mode(ACPI_SYS_MODE_LEGACY); 126 status = acpi_hw_set_mode(ACPI_SYS_MODE_LEGACY);
128 127
129 if (ACPI_FAILURE(status)) { 128 if (ACPI_FAILURE(status)) {
130 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 129 ACPI_ERROR((AE_INFO,
131 "Could not exit ACPI mode to legacy mode")); 130 "Could not exit ACPI mode to legacy mode"));
132 return_ACPI_STATUS(status); 131 return_ACPI_STATUS(status);
133 } 132 }
134 133
@@ -185,9 +184,9 @@ acpi_status acpi_enable_event(u32 event, u32 flags)
185 } 184 }
186 185
187 if (value != 1) { 186 if (value != 1) {
188 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 187 ACPI_ERROR((AE_INFO,
189 "Could not enable %s event\n", 188 "Could not enable %s event",
190 acpi_ut_get_event_name(event))); 189 acpi_ut_get_event_name(event)));
191 return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); 190 return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
192 } 191 }
193 192
@@ -384,9 +383,9 @@ acpi_status acpi_disable_event(u32 event, u32 flags)
384 } 383 }
385 384
386 if (value != 0) { 385 if (value != 0) {
387 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 386 ACPI_ERROR((AE_INFO,
388 "Could not disable %s events\n", 387 "Could not disable %s events",
389 acpi_ut_get_event_name(event))); 388 acpi_ut_get_event_name(event)));
390 return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); 389 return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
391 } 390 }
392 391
@@ -626,6 +625,13 @@ acpi_install_gpe_block(acpi_handle gpe_device,
626 goto unlock_and_exit; 625 goto unlock_and_exit;
627 } 626 }
628 627
628 /* Run the _PRW methods and enable the GPEs */
629
630 status = acpi_ev_initialize_gpe_block(node, gpe_block);
631 if (ACPI_FAILURE(status)) {
632 goto unlock_and_exit;
633 }
634
629 /* Get the device_object attached to the node */ 635 /* Get the device_object attached to the node */
630 636
631 obj_desc = acpi_ns_get_attached_object(node); 637 obj_desc = acpi_ns_get_attached_object(node);
diff --git a/drivers/acpi/events/evxfregn.c b/drivers/acpi/events/evxfregn.c
index 6f28ea2db5ba..abf5caca9ae5 100644
--- a/drivers/acpi/events/evxfregn.c
+++ b/drivers/acpi/events/evxfregn.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2005, R. Byron Moore 9 * Copyright (C) 2000 - 2006, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without