aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/events
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/events')
-rw-r--r--drivers/acpi/events/evevent.c46
-rw-r--r--drivers/acpi/events/evgpe.c38
-rw-r--r--drivers/acpi/events/evgpeblk.c189
-rw-r--r--drivers/acpi/events/evmisc.c12
-rw-r--r--drivers/acpi/events/evregion.c45
-rw-r--r--drivers/acpi/events/evrgnini.c2
-rw-r--r--drivers/acpi/events/evsci.c6
-rw-r--r--drivers/acpi/events/evxface.c17
-rw-r--r--drivers/acpi/events/evxfevnt.c30
-rw-r--r--drivers/acpi/events/evxfregn.c2
10 files changed, 225 insertions, 162 deletions
diff --git a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c
index 842d1e3fb37b..b380ae1044b7 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_REPORT_WARNING(("No ACPI tables present!\n"));
77 return_ACPI_STATUS(AE_NO_ACPI_TABLES); 77 return_ACPI_STATUS(AE_NO_ACPI_TABLES);
78 } 78 }
79 79
@@ -100,6 +100,48 @@ acpi_status acpi_ev_initialize_events(void)
100 100
101/******************************************************************************* 101/*******************************************************************************
102 * 102 *
103 * FUNCTION: acpi_ev_install_fadt_gpes
104 *
105 * PARAMETERS: None
106 *
107 * RETURN: Status
108 *
109 * DESCRIPTION: Completes initialization of the FADT-defined GPE blocks
110 * (0 and 1). This causes the _PRW methods to be run, so the HW
111 * must be fully initialized at this point, including global lock
112 * support.
113 *
114 ******************************************************************************/
115
116acpi_status acpi_ev_install_fadt_gpes(void)
117{
118 acpi_status status;
119
120 ACPI_FUNCTION_TRACE("ev_install_fadt_gpes");
121
122 /* Namespace must be locked */
123
124 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
125 if (ACPI_FAILURE(status)) {
126 return (status);
127 }
128
129 /* FADT GPE Block 0 */
130
131 (void)acpi_ev_initialize_gpe_block(acpi_gbl_fadt_gpe_device,
132 acpi_gbl_gpe_fadt_blocks[0]);
133
134 /* FADT GPE Block 1 */
135
136 (void)acpi_ev_initialize_gpe_block(acpi_gbl_fadt_gpe_device,
137 acpi_gbl_gpe_fadt_blocks[1]);
138
139 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
140 return_ACPI_STATUS(AE_OK);
141}
142
143/*******************************************************************************
144 *
103 * FUNCTION: acpi_ev_install_xrupt_handlers 145 * FUNCTION: acpi_ev_install_xrupt_handlers
104 * 146 *
105 * PARAMETERS: None 147 * PARAMETERS: None
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index b2f232df13d8..353b907edbfa 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_native_uint 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
@@ -599,8 +599,10 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
599 ACPI_GPE_EDGE_TRIGGERED) { 599 ACPI_GPE_EDGE_TRIGGERED) {
600 status = acpi_hw_clear_gpe(gpe_event_info); 600 status = acpi_hw_clear_gpe(gpe_event_info);
601 if (ACPI_FAILURE(status)) { 601 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)); 602 ACPI_REPORT_ERROR(("%s, Unable to clear GPE[%2X]\n",
603 return_VALUE(ACPI_INTERRUPT_NOT_HANDLED); 603 acpi_format_exception(status),
604 gpe_number));
605 return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
604 } 606 }
605 } 607 }
606 608
@@ -637,8 +639,8 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
637 ACPI_GPE_LEVEL_TRIGGERED) { 639 ACPI_GPE_LEVEL_TRIGGERED) {
638 status = acpi_hw_clear_gpe(gpe_event_info); 640 status = acpi_hw_clear_gpe(gpe_event_info);
639 if (ACPI_FAILURE(status)) { 641 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)); 642 ACPI_REPORT_ERROR(("%s, Unable to clear GPE[%2X]\n", acpi_format_exception(status), gpe_number));
641 return_VALUE(ACPI_INTERRUPT_NOT_HANDLED); 643 return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
642 } 644 }
643 } 645 }
644 break; 646 break;
@@ -651,8 +653,10 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
651 */ 653 */
652 status = acpi_ev_disable_gpe(gpe_event_info); 654 status = acpi_ev_disable_gpe(gpe_event_info);
653 if (ACPI_FAILURE(status)) { 655 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)); 656 ACPI_REPORT_ERROR(("%s, Unable to disable GPE[%2X]\n",
655 return_VALUE(ACPI_INTERRUPT_NOT_HANDLED); 657 acpi_format_exception(status),
658 gpe_number));
659 return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
656 } 660 }
657 661
658 /* 662 /*
@@ -663,7 +667,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
663 acpi_ev_asynch_execute_gpe_method, 667 acpi_ev_asynch_execute_gpe_method,
664 gpe_event_info); 668 gpe_event_info);
665 if (ACPI_FAILURE(status)) { 669 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)); 670 ACPI_REPORT_ERROR(("%s, Unable to queue handler for GPE[%2X] - event disabled\n", acpi_format_exception(status), gpe_number));
667 } 671 }
668 break; 672 break;
669 673
@@ -671,7 +675,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
671 675
672 /* No handler or method to run! */ 676 /* No handler or method to run! */
673 677
674 ACPI_REPORT_ERROR(("acpi_ev_gpe_dispatch: No handler or method for GPE[%2X], disabling event\n", gpe_number)); 678 ACPI_REPORT_ERROR(("No handler or method for GPE[%2X], disabling event\n", gpe_number));
675 679
676 /* 680 /*
677 * Disable the GPE. The GPE will remain disabled until the ACPI 681 * Disable the GPE. The GPE will remain disabled until the ACPI
@@ -679,13 +683,15 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
679 */ 683 */
680 status = acpi_ev_disable_gpe(gpe_event_info); 684 status = acpi_ev_disable_gpe(gpe_event_info);
681 if (ACPI_FAILURE(status)) { 685 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)); 686 ACPI_REPORT_ERROR(("%s, Unable to disable GPE[%2X]\n",
683 return_VALUE(ACPI_INTERRUPT_NOT_HANDLED); 687 acpi_format_exception(status),
688 gpe_number));
689 return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
684 } 690 }
685 break; 691 break;
686 } 692 }
687 693
688 return_VALUE(ACPI_INTERRUPT_HANDLED); 694 return_UINT32(ACPI_INTERRUPT_HANDLED);
689} 695}
690 696
691#ifdef ACPI_GPE_NOTIFY_CHECK 697#ifdef ACPI_GPE_NOTIFY_CHECK
diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c
index b312eb33c43e..3b9bbdda551d 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_native_uint 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,7 @@ 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_REPORT_ERROR(("Unknown GPE method type: %s (name not of form _Lxx or _Exx)\n", name));
283 "Unknown GPE method type: %s (name not of form _Lxx or _Exx)\n",
284 name));
285 return_ACPI_STATUS(AE_OK); 283 return_ACPI_STATUS(AE_OK);
286 } 284 }
287 285
@@ -291,9 +289,7 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
291 if (gpe_number == ACPI_UINT32_MAX) { 289 if (gpe_number == ACPI_UINT32_MAX) {
292 /* Conversion failed; invalid method, just ignore it */ 290 /* Conversion failed; invalid method, just ignore it */
293 291
294 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 292 ACPI_REPORT_ERROR(("Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)\n", name));
295 "Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)\n",
296 name));
297 return_ACPI_STATUS(AE_OK); 293 return_ACPI_STATUS(AE_OK);
298 } 294 }
299 295
@@ -313,14 +309,14 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
313 309
314 /* 310 /*
315 * Now we can add this information to the gpe_event_info block 311 * 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 312 * for use during dispatch of this GPE. Default type is RUNTIME, although
317 * this may change when the _PRW methods are executed later. 313 * this may change when the _PRW methods are executed later.
318 */ 314 */
319 gpe_event_info = 315 gpe_event_info =
320 &gpe_block->event_info[gpe_number - gpe_block->block_base_number]; 316 &gpe_block->event_info[gpe_number - gpe_block->block_base_number];
321 317
322 gpe_event_info->flags = (u8) (type | ACPI_GPE_DISPATCH_METHOD | 318 gpe_event_info->flags = (u8)
323 ACPI_GPE_TYPE_RUNTIME); 319 (type | ACPI_GPE_DISPATCH_METHOD | ACPI_GPE_TYPE_RUNTIME);
324 320
325 gpe_event_info->dispatch.method_node = 321 gpe_event_info->dispatch.method_node =
326 (struct acpi_namespace_node *)obj_handle; 322 (struct acpi_namespace_node *)obj_handle;
@@ -341,11 +337,11 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
341 * 337 *
342 * PARAMETERS: Callback from walk_namespace 338 * PARAMETERS: Callback from walk_namespace
343 * 339 *
344 * RETURN: Status. NOTE: We ignore errors so that the _PRW walk is 340 * RETURN: Status. NOTE: We ignore errors so that the _PRW walk is
345 * not aborted on a single _PRW failure. 341 * not aborted on a single _PRW failure.
346 * 342 *
347 * DESCRIPTION: Called from acpi_walk_namespace. Expects each object to be a 343 * DESCRIPTION: Called from acpi_walk_namespace. Expects each object to be a
348 * Device. Run the _PRW method. If present, extract the GPE 344 * Device. Run the _PRW method. If present, extract the GPE
349 * number and mark the GPE as a WAKE GPE. 345 * number and mark the GPE as a WAKE GPE.
350 * 346 *
351 ******************************************************************************/ 347 ******************************************************************************/
@@ -443,6 +439,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
443 439
444 gpe_event_info->flags &= 440 gpe_event_info->flags &=
445 ~(ACPI_GPE_WAKE_ENABLED | ACPI_GPE_RUN_ENABLED); 441 ~(ACPI_GPE_WAKE_ENABLED | ACPI_GPE_RUN_ENABLED);
442
446 status = 443 status =
447 acpi_ev_set_gpe_type(gpe_event_info, ACPI_GPE_TYPE_WAKE); 444 acpi_ev_set_gpe_type(gpe_event_info, ACPI_GPE_TYPE_WAKE);
448 if (ACPI_FAILURE(status)) { 445 if (ACPI_FAILURE(status)) {
@@ -466,7 +463,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
466 * 463 *
467 * RETURN: A GPE interrupt block 464 * RETURN: A GPE interrupt block
468 * 465 *
469 * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt 466 * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
470 * block per unique interrupt level used for GPEs. 467 * block per unique interrupt level used for GPEs.
471 * Should be called only when the GPE lists are semaphore locked 468 * Should be called only when the GPE lists are semaphore locked
472 * and not subject to change. 469 * and not subject to change.
@@ -479,7 +476,7 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32
479 struct acpi_gpe_xrupt_info *next_gpe_xrupt; 476 struct acpi_gpe_xrupt_info *next_gpe_xrupt;
480 struct acpi_gpe_xrupt_info *gpe_xrupt; 477 struct acpi_gpe_xrupt_info *gpe_xrupt;
481 acpi_status status; 478 acpi_status status;
482 u32 flags; 479 acpi_native_uint flags;
483 480
484 ACPI_FUNCTION_TRACE("ev_get_gpe_xrupt_block"); 481 ACPI_FUNCTION_TRACE("ev_get_gpe_xrupt_block");
485 482
@@ -526,9 +523,7 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32
526 acpi_ev_gpe_xrupt_handler, 523 acpi_ev_gpe_xrupt_handler,
527 gpe_xrupt); 524 gpe_xrupt);
528 if (ACPI_FAILURE(status)) { 525 if (ACPI_FAILURE(status)) {
529 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 526 ACPI_REPORT_ERROR(("Could not install GPE interrupt handler at level 0x%X\n", interrupt_number));
530 "Could not install GPE interrupt handler at level 0x%X\n",
531 interrupt_number));
532 return_PTR(NULL); 527 return_PTR(NULL);
533 } 528 }
534 } 529 }
@@ -553,7 +548,7 @@ static acpi_status
553acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt) 548acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)
554{ 549{
555 acpi_status status; 550 acpi_status status;
556 u32 flags; 551 acpi_native_uint flags;
557 552
558 ACPI_FUNCTION_TRACE("ev_delete_gpe_xrupt"); 553 ACPI_FUNCTION_TRACE("ev_delete_gpe_xrupt");
559 554
@@ -566,8 +561,9 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)
566 561
567 /* Disable this interrupt */ 562 /* Disable this interrupt */
568 563
569 status = acpi_os_remove_interrupt_handler(gpe_xrupt->interrupt_number, 564 status =
570 acpi_ev_gpe_xrupt_handler); 565 acpi_os_remove_interrupt_handler(gpe_xrupt->interrupt_number,
566 acpi_ev_gpe_xrupt_handler);
571 if (ACPI_FAILURE(status)) { 567 if (ACPI_FAILURE(status)) {
572 return_ACPI_STATUS(status); 568 return_ACPI_STATUS(status);
573 } 569 }
@@ -610,7 +606,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
610 struct acpi_gpe_block_info *next_gpe_block; 606 struct acpi_gpe_block_info *next_gpe_block;
611 struct acpi_gpe_xrupt_info *gpe_xrupt_block; 607 struct acpi_gpe_xrupt_info *gpe_xrupt_block;
612 acpi_status status; 608 acpi_status status;
613 u32 flags; 609 acpi_native_uint flags;
614 610
615 ACPI_FUNCTION_TRACE("ev_install_gpe_block"); 611 ACPI_FUNCTION_TRACE("ev_install_gpe_block");
616 612
@@ -663,7 +659,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) 659acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
664{ 660{
665 acpi_status status; 661 acpi_status status;
666 u32 flags; 662 acpi_native_uint flags;
667 663
668 ACPI_FUNCTION_TRACE("ev_install_gpe_block"); 664 ACPI_FUNCTION_TRACE("ev_install_gpe_block");
669 665
@@ -743,22 +739,20 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
743 sizeof(struct 739 sizeof(struct
744 acpi_gpe_register_info)); 740 acpi_gpe_register_info));
745 if (!gpe_register_info) { 741 if (!gpe_register_info) {
746 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 742 ACPI_REPORT_ERROR(("Could not allocate the gpe_register_info table\n"));
747 "Could not allocate the gpe_register_info table\n"));
748 return_ACPI_STATUS(AE_NO_MEMORY); 743 return_ACPI_STATUS(AE_NO_MEMORY);
749 } 744 }
750 745
751 /* 746 /*
752 * Allocate the GPE event_info block. There are eight distinct GPEs 747 * Allocate the GPE event_info block. There are eight distinct GPEs
753 * per register. Initialization to zeros is sufficient. 748 * per register. Initialization to zeros is sufficient.
754 */ 749 */
755 gpe_event_info = ACPI_MEM_CALLOCATE(((acpi_size) gpe_block-> 750 gpe_event_info = ACPI_MEM_CALLOCATE(((acpi_size) gpe_block->
756 register_count * 751 register_count *
757 ACPI_GPE_REGISTER_WIDTH) * 752 ACPI_GPE_REGISTER_WIDTH) *
758 sizeof(struct acpi_gpe_event_info)); 753 sizeof(struct acpi_gpe_event_info));
759 if (!gpe_event_info) { 754 if (!gpe_event_info) {
760 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 755 ACPI_REPORT_ERROR(("Could not allocate the gpe_event_info table\n"));
761 "Could not allocate the gpe_event_info table\n"));
762 status = AE_NO_MEMORY; 756 status = AE_NO_MEMORY;
763 goto error_exit; 757 goto error_exit;
764 } 758 }
@@ -769,9 +763,9 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
769 gpe_block->event_info = gpe_event_info; 763 gpe_block->event_info = gpe_event_info;
770 764
771 /* 765 /*
772 * Initialize the GPE Register and Event structures. A goal of these 766 * 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 767 * 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, 768 * in a given GPE hardware block, the status registers occupy the first half,
775 * and the enable registers occupy the second half. 769 * and the enable registers occupy the second half.
776 */ 770 */
777 this_register = gpe_register_info; 771 this_register = gpe_register_info;
@@ -812,11 +806,8 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
812 this_event++; 806 this_event++;
813 } 807 }
814 808
815 /* 809 /* Disable all GPEs within this register */
816 * Clear the status/enable registers. Note that status registers 810
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, 811 status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0x00,
821 &this_register-> 812 &this_register->
822 enable_address); 813 enable_address);
@@ -824,6 +815,8 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
824 goto error_exit; 815 goto error_exit;
825 } 816 }
826 817
818 /* Clear any pending GPE events within this register */
819
827 status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0xFF, 820 status = acpi_hw_low_level_write(ACPI_GPE_REGISTER_WIDTH, 0xFF,
828 &this_register-> 821 &this_register->
829 status_address); 822 status_address);
@@ -860,7 +853,9 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
860 * 853 *
861 * RETURN: Status 854 * RETURN: Status
862 * 855 *
863 * DESCRIPTION: Create and Install a block of GPE registers 856 * DESCRIPTION: Create and Install a block of GPE registers. All GPEs within
857 * the block are disabled at exit.
858 * Note: Assumes namespace is locked.
864 * 859 *
865 ******************************************************************************/ 860 ******************************************************************************/
866 861
@@ -872,14 +867,8 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
872 u32 interrupt_number, 867 u32 interrupt_number,
873 struct acpi_gpe_block_info **return_gpe_block) 868 struct acpi_gpe_block_info **return_gpe_block)
874{ 869{
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; 870 acpi_status status;
882 struct acpi_gpe_walk_info gpe_info; 871 struct acpi_gpe_block_info *gpe_block;
883 872
884 ACPI_FUNCTION_TRACE("ev_create_gpe_block"); 873 ACPI_FUNCTION_TRACE("ev_create_gpe_block");
885 874
@@ -896,22 +885,24 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
896 885
897 /* Initialize the new GPE block */ 886 /* Initialize the new GPE block */
898 887
888 gpe_block->node = gpe_device;
899 gpe_block->register_count = register_count; 889 gpe_block->register_count = register_count;
900 gpe_block->block_base_number = gpe_block_base_number; 890 gpe_block->block_base_number = gpe_block_base_number;
901 gpe_block->node = gpe_device;
902 891
903 ACPI_MEMCPY(&gpe_block->block_address, gpe_block_address, 892 ACPI_MEMCPY(&gpe_block->block_address, gpe_block_address,
904 sizeof(struct acpi_generic_address)); 893 sizeof(struct acpi_generic_address));
905 894
906 /* Create the register_info and event_info sub-structures */ 895 /*
907 896 * Create the register_info and event_info sub-structures
897 * Note: disables and clears all GPEs in the block
898 */
908 status = acpi_ev_create_gpe_info_blocks(gpe_block); 899 status = acpi_ev_create_gpe_info_blocks(gpe_block);
909 if (ACPI_FAILURE(status)) { 900 if (ACPI_FAILURE(status)) {
910 ACPI_MEM_FREE(gpe_block); 901 ACPI_MEM_FREE(gpe_block);
911 return_ACPI_STATUS(status); 902 return_ACPI_STATUS(status);
912 } 903 }
913 904
914 /* Install the new block in the global list(s) */ 905 /* Install the new block in the global lists */
915 906
916 status = acpi_ev_install_gpe_block(gpe_block, interrupt_number); 907 status = acpi_ev_install_gpe_block(gpe_block, interrupt_number);
917 if (ACPI_FAILURE(status)) { 908 if (ACPI_FAILURE(status)) {
@@ -926,16 +917,70 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
926 acpi_ev_save_method_info, gpe_block, 917 acpi_ev_save_method_info, gpe_block,
927 NULL); 918 NULL);
928 919
920 /* Return the new block */
921
922 if (return_gpe_block) {
923 (*return_gpe_block) = gpe_block;
924 }
925
926 ACPI_DEBUG_PRINT((ACPI_DB_INIT,
927 "GPE %02X to %02X [%4.4s] %u regs on int 0x%X\n",
928 (u32) gpe_block->block_base_number,
929 (u32) (gpe_block->block_base_number +
930 ((gpe_block->register_count *
931 ACPI_GPE_REGISTER_WIDTH) - 1)),
932 gpe_device->name.ascii, gpe_block->register_count,
933 interrupt_number));
934
935 return_ACPI_STATUS(AE_OK);
936}
937
938/*******************************************************************************
939 *
940 * FUNCTION: acpi_ev_initialize_gpe_block
941 *
942 * PARAMETERS: gpe_device - Handle to the parent GPE block
943 * gpe_block - Gpe Block info
944 *
945 * RETURN: Status
946 *
947 * DESCRIPTION: Initialize and enable a GPE block. First find and run any
948 * _PRT methods associated with the block, then enable the
949 * appropriate GPEs.
950 * Note: Assumes namespace is locked.
951 *
952 ******************************************************************************/
953
954acpi_status
955acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
956 struct acpi_gpe_block_info *gpe_block)
957{
958 acpi_status status;
959 struct acpi_gpe_event_info *gpe_event_info;
960 struct acpi_gpe_walk_info gpe_info;
961 u32 wake_gpe_count;
962 u32 gpe_enabled_count;
963 acpi_native_uint i;
964 acpi_native_uint j;
965
966 ACPI_FUNCTION_TRACE("ev_initialize_gpe_block");
967
968 /* Ignore a null GPE block (e.g., if no GPE block 1 exists) */
969
970 if (!gpe_block) {
971 return_ACPI_STATUS(AE_OK);
972 }
973
929 /* 974 /*
930 * Runtime option: Should Wake GPEs be enabled at runtime? The default 975 * 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. 976 * is no, they should only be enabled just as the machine goes to sleep.
932 */ 977 */
933 if (acpi_gbl_leave_wake_gpes_disabled) { 978 if (acpi_gbl_leave_wake_gpes_disabled) {
934 /* 979 /*
935 * Differentiate RUNTIME vs WAKE GPEs, via the _PRW control methods. 980 * Differentiate runtime vs wake GPEs, via the _PRW control methods.
936 * (Each GPE that has one or more _PRWs that reference it is by 981 * 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 982 * definition a wake GPE and will not be enabled while the machine
938 * is running.) 983 * is running.
939 */ 984 */
940 gpe_info.gpe_block = gpe_block; 985 gpe_info.gpe_block = gpe_block;
941 gpe_info.gpe_device = gpe_device; 986 gpe_info.gpe_device = gpe_device;
@@ -948,9 +993,12 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
948 } 993 }
949 994
950 /* 995 /*
951 * Enable all GPEs in this block that are 1) "runtime" or "run/wake" GPEs, 996 * Enable all GPEs in this block that have these attributes:
952 * and 2) have a corresponding _Lxx or _Exx method. All other GPEs must 997 * 1) are "runtime" or "run/wake" GPEs, and
953 * be enabled via the acpi_enable_gpe() external interface. 998 * 2) have a corresponding _Lxx or _Exx method
999 *
1000 * Any other GPEs within this block must be enabled via the acpi_enable_gpe()
1001 * external interface.
954 */ 1002 */
955 wake_gpe_count = 0; 1003 wake_gpe_count = 0;
956 gpe_enabled_count = 0; 1004 gpe_enabled_count = 0;
@@ -976,32 +1024,19 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
976 } 1024 }
977 } 1025 }
978 1026
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, 1027 ACPI_DEBUG_PRINT((ACPI_DB_INIT,
995 "Found %u Wake, Enabled %u Runtime GPEs in this block\n", 1028 "Found %u Wake, Enabled %u Runtime GPEs in this block\n",
996 wake_gpe_count, gpe_enabled_count)); 1029 wake_gpe_count, gpe_enabled_count));
997 1030
998 /* Return the new block */ 1031 /* Enable all valid runtime GPEs found above */
999 1032
1000 if (return_gpe_block) { 1033 status = acpi_hw_enable_runtime_gpe_block(NULL, gpe_block);
1001 (*return_gpe_block) = gpe_block; 1034 if (ACPI_FAILURE(status)) {
1035 ACPI_REPORT_ERROR(("Could not enable GPEs in gpe_block %p\n",
1036 gpe_block));
1002 } 1037 }
1003 1038
1004 return_ACPI_STATUS(AE_OK); 1039 return_ACPI_STATUS(status);
1005} 1040}
1006 1041
1007/******************************************************************************* 1042/*******************************************************************************
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 7e57b8470f55..78883239784a 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
@@ -542,9 +542,7 @@ void acpi_ev_terminate(void)
542 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { 542 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
543 status = acpi_disable_event((u32) i, 0); 543 status = acpi_disable_event((u32) i, 0);
544 if (ACPI_FAILURE(status)) { 544 if (ACPI_FAILURE(status)) {
545 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 545 ACPI_REPORT_ERROR(("Could not disable fixed event %d\n", (u32) i));
546 "Could not disable fixed event %d\n",
547 (u32) i));
548 } 546 }
549 } 547 }
550 548
@@ -556,8 +554,7 @@ void acpi_ev_terminate(void)
556 554
557 status = acpi_ev_remove_sci_handler(); 555 status = acpi_ev_remove_sci_handler();
558 if (ACPI_FAILURE(status)) { 556 if (ACPI_FAILURE(status)) {
559 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 557 ACPI_REPORT_ERROR(("Could not remove SCI handler\n"));
560 "Could not remove SCI handler\n"));
561 } 558 }
562 } 559 }
563 560
@@ -570,8 +567,7 @@ void acpi_ev_terminate(void)
570 if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) { 567 if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) {
571 status = acpi_disable(); 568 status = acpi_disable();
572 if (ACPI_FAILURE(status)) { 569 if (ACPI_FAILURE(status)) {
573 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 570 ACPI_REPORT_WARNING(("acpi_disable failed\n"));
574 "acpi_disable failed\n"));
575 } 571 }
576 } 572 }
577 return_VOID; 573 return_VOID;
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
index 84fad082d80d..900e5b32e595 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,11 @@ 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_REPORT_ERROR(("No handler for Region [%4.4s] (%p) [%s]\n",
299 "No handler for Region [%4.4s] (%p) [%s]\n", 299 acpi_ut_get_node_name(region_obj->region.
300 acpi_ut_get_node_name(region_obj->region. 300 node), region_obj,
301 node), region_obj, 301 acpi_ut_get_region_name(region_obj->region.
302 acpi_ut_get_region_name(region_obj->region. 302 space_id)));
303 space_id)));
304 303
305 return_ACPI_STATUS(AE_NOT_EXIST); 304 return_ACPI_STATUS(AE_NOT_EXIST);
306 } 305 }
@@ -317,12 +316,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
317 if (!region_setup) { 316 if (!region_setup) {
318 /* No initialization routine, exit with error */ 317 /* No initialization routine, exit with error */
319 318
320 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 319 ACPI_REPORT_ERROR(("No init routine for region(%p) [%s]\n", region_obj, acpi_ut_get_region_name(region_obj->region.space_id)));
321 "No init routine for region(%p) [%s]\n",
322 region_obj,
323 acpi_ut_get_region_name(region_obj->
324 region.
325 space_id)));
326 return_ACPI_STATUS(AE_NOT_EXIST); 320 return_ACPI_STATUS(AE_NOT_EXIST);
327 } 321 }
328 322
@@ -347,12 +341,11 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
347 /* Check for failure of the Region Setup */ 341 /* Check for failure of the Region Setup */
348 342
349 if (ACPI_FAILURE(status)) { 343 if (ACPI_FAILURE(status)) {
350 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 344 ACPI_REPORT_ERROR(("Region Initialization: %s [%s]\n",
351 "Region Init: %s [%s]\n", 345 acpi_format_exception(status),
352 acpi_format_exception(status), 346 acpi_ut_get_region_name(region_obj->
353 acpi_ut_get_region_name(region_obj-> 347 region.
354 region. 348 space_id)));
355 space_id)));
356 return_ACPI_STATUS(status); 349 return_ACPI_STATUS(status);
357 } 350 }
358 351
@@ -501,12 +494,7 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
501 494
502 status = acpi_ev_execute_reg_method(region_obj, 0); 495 status = acpi_ev_execute_reg_method(region_obj, 0);
503 if (ACPI_FAILURE(status)) { 496 if (ACPI_FAILURE(status)) {
504 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 497 ACPI_REPORT_ERROR(("%s from region _REG, [%s]\n", acpi_format_exception(status), acpi_ut_get_region_name(region_obj->region.space_id)));
505 "%s from region _REG, [%s]\n",
506 acpi_format_exception(status),
507 acpi_ut_get_region_name
508 (region_obj->region.
509 space_id)));
510 } 498 }
511 499
512 if (acpi_ns_is_locked) { 500 if (acpi_ns_is_locked) {
@@ -528,12 +516,7 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
528 /* Init routine may fail, Just ignore errors */ 516 /* Init routine may fail, Just ignore errors */
529 517
530 if (ACPI_FAILURE(status)) { 518 if (ACPI_FAILURE(status)) {
531 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 519 ACPI_REPORT_ERROR(("%s from region init, [%s]\n", acpi_format_exception(status), acpi_ut_get_region_name(region_obj->region.space_id)));
532 "%s from region init, [%s]\n",
533 acpi_format_exception(status),
534 acpi_ut_get_region_name
535 (region_obj->region.
536 space_id)));
537 } 520 }
538 521
539 region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE); 522 region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE);
diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c
index a1bd2da27c45..de1a38e9ce22 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
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..b2f69b1ac4b5 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_REPORT_WARNING(("Could not enable fixed event %X\n",
147 "Could not enable fixed event.\n")); 147 event));
148 148
149 /* Remove the handler */ 149 /* Remove the handler */
150 150
@@ -204,10 +204,9 @@ 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_REPORT_WARNING(("Could not write to fixed event enable register %X\n", event));
208 "Could not write to fixed event enable register.\n"));
209 } else { 208 } else {
210 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X.\n", 209 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n",
211 event)); 210 event));
212 } 211 }
213 212
@@ -434,7 +433,7 @@ acpi_remove_notify_handler(acpi_handle device,
434 433
435 if (device == ACPI_ROOT_OBJECT) { 434 if (device == ACPI_ROOT_OBJECT) {
436 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 435 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
437 "Removing notify handler for ROOT object.\n")); 436 "Removing notify handler for namespace root object\n"));
438 437
439 if (((handler_type & ACPI_SYSTEM_NOTIFY) && 438 if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
440 !acpi_gbl_system_notify.handler) || 439 !acpi_gbl_system_notify.handler) ||
@@ -562,7 +561,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
562 struct acpi_gpe_event_info *gpe_event_info; 561 struct acpi_gpe_event_info *gpe_event_info;
563 struct acpi_handler_info *handler; 562 struct acpi_handler_info *handler;
564 acpi_status status; 563 acpi_status status;
565 u32 flags; 564 acpi_native_uint flags;
566 565
567 ACPI_FUNCTION_TRACE("acpi_install_gpe_handler"); 566 ACPI_FUNCTION_TRACE("acpi_install_gpe_handler");
568 567
@@ -653,7 +652,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
653 struct acpi_gpe_event_info *gpe_event_info; 652 struct acpi_gpe_event_info *gpe_event_info;
654 struct acpi_handler_info *handler; 653 struct acpi_handler_info *handler;
655 acpi_status status; 654 acpi_status status;
656 u32 flags; 655 acpi_native_uint flags;
657 656
658 ACPI_FUNCTION_TRACE("acpi_remove_gpe_handler"); 657 ACPI_FUNCTION_TRACE("acpi_remove_gpe_handler");
659 658
diff --git a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c
index 887ff9f28a0d..90eb7939e986 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_REPORT_WARNING(("No FADT information present!\n"));
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,7 @@ 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_REPORT_ERROR(("Could not transition to ACPI mode\n"));
87 return_ACPI_STATUS(status); 86 return_ACPI_STATUS(status);
88 } 87 }
89 88
@@ -113,8 +112,7 @@ acpi_status acpi_disable(void)
113 ACPI_FUNCTION_TRACE("acpi_disable"); 112 ACPI_FUNCTION_TRACE("acpi_disable");
114 113
115 if (!acpi_gbl_FADT) { 114 if (!acpi_gbl_FADT) {
116 ACPI_DEBUG_PRINT((ACPI_DB_WARN, 115 ACPI_REPORT_WARNING(("No FADT information present!\n"));
117 "No FADT information present!\n"));
118 return_ACPI_STATUS(AE_NO_ACPI_TABLES); 116 return_ACPI_STATUS(AE_NO_ACPI_TABLES);
119 } 117 }
120 118
@@ -127,8 +125,7 @@ acpi_status acpi_disable(void)
127 status = acpi_hw_set_mode(ACPI_SYS_MODE_LEGACY); 125 status = acpi_hw_set_mode(ACPI_SYS_MODE_LEGACY);
128 126
129 if (ACPI_FAILURE(status)) { 127 if (ACPI_FAILURE(status)) {
130 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 128 ACPI_REPORT_ERROR(("Could not exit ACPI mode to legacy mode"));
131 "Could not exit ACPI mode to legacy mode"));
132 return_ACPI_STATUS(status); 129 return_ACPI_STATUS(status);
133 } 130 }
134 131
@@ -185,9 +182,8 @@ acpi_status acpi_enable_event(u32 event, u32 flags)
185 } 182 }
186 183
187 if (value != 1) { 184 if (value != 1) {
188 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 185 ACPI_REPORT_ERROR(("Could not enable %s event\n",
189 "Could not enable %s event\n", 186 acpi_ut_get_event_name(event)));
190 acpi_ut_get_event_name(event)));
191 return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); 187 return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
192 } 188 }
193 189
@@ -384,9 +380,8 @@ acpi_status acpi_disable_event(u32 event, u32 flags)
384 } 380 }
385 381
386 if (value != 0) { 382 if (value != 0) {
387 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 383 ACPI_REPORT_ERROR(("Could not disable %s events\n",
388 "Could not disable %s events\n", 384 acpi_ut_get_event_name(event)));
389 acpi_ut_get_event_name(event)));
390 return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); 385 return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
391 } 386 }
392 387
@@ -626,6 +621,13 @@ acpi_install_gpe_block(acpi_handle gpe_device,
626 goto unlock_and_exit; 621 goto unlock_and_exit;
627 } 622 }
628 623
624 /* Run the _PRW methods and enable the GPEs */
625
626 status = acpi_ev_initialize_gpe_block(node, gpe_block);
627 if (ACPI_FAILURE(status)) {
628 goto unlock_and_exit;
629 }
630
629 /* Get the device_object attached to the node */ 631 /* Get the device_object attached to the node */
630 632
631 obj_desc = acpi_ns_get_attached_object(node); 633 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