aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/evxface.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-20 12:45:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-20 12:45:38 -0400
commit04afb40593f9a3007e5ea817d009529ef10fb685 (patch)
treede5a16c2b1e5f2d97a7c2eccea4677719817f282 /drivers/acpi/acpica/evxface.c
parent7f06a8b26aba1dc03b42272dc0089a800372c575 (diff)
parentcce4f632db200aef147c59084437168174b23f11 (diff)
Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (22 commits) ACPI: fix early DSDT dmi check warnings on ia64 ACPICA: Update version to 20100428. ACPICA: Update/clarify some parameter names associated with acpi_handle ACPICA: Rename acpi_ex_system_do_suspend->acpi_ex_system_do_sleep ACPICA: Prevent possible allocation overrun during object copy ACPICA: Split large file, evgpeblk ACPICA: Add GPE support for dynamically loaded ACPI tables ACPICA: Clarify/rename some root table descriptor fields ACPICA: Update version to 20100331. ACPICA: Minimize the differences between linux GPE code and ACPICA code base ACPI: add boot option acpi=copy_dsdt to fix corrupt DSDT ACPICA: Update DSDT copy/detection. ACPICA: Add subsystem option to force copy of DSDT to local memory ACPICA: Add detection of corrupted/replaced DSDT ACPICA: Add write support for DataTable operation regions ACPICA: Fix for acpi_reallocate_root_table for incorrect root table copy ACPICA: Update comments/headers, no functional change ACPICA: Update version to 20100304 ACPICA: Fix for possible fault in acpi_ex_release_mutex ACPICA: Standardize integer output for ACPICA warnings/errors ...
Diffstat (limited to 'drivers/acpi/acpica/evxface.c')
-rw-r--r--drivers/acpi/acpica/evxface.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index b40757955f9b..cc825023012a 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -142,7 +142,7 @@ acpi_install_fixed_event_handler(u32 event,
142 if (ACPI_SUCCESS(status)) 142 if (ACPI_SUCCESS(status))
143 status = acpi_enable_event(event, 0); 143 status = acpi_enable_event(event, 0);
144 if (ACPI_FAILURE(status)) { 144 if (ACPI_FAILURE(status)) {
145 ACPI_WARNING((AE_INFO, "Could not enable fixed event %X", 145 ACPI_WARNING((AE_INFO, "Could not enable fixed event 0x%X",
146 event)); 146 event));
147 147
148 /* Remove the handler */ 148 /* Remove the handler */
@@ -203,7 +203,7 @@ acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
203 203
204 if (ACPI_FAILURE(status)) { 204 if (ACPI_FAILURE(status)) {
205 ACPI_WARNING((AE_INFO, 205 ACPI_WARNING((AE_INFO,
206 "Could not write to fixed event enable register %X", 206 "Could not write to fixed event enable register 0x%X",
207 event)); 207 event));
208 } else { 208 } else {
209 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n", 209 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n",
@@ -682,14 +682,13 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
682 682
683 /* Parameter validation */ 683 /* Parameter validation */
684 684
685 if ((!address) || (type > ACPI_GPE_XRUPT_TYPE_MASK)) { 685 if ((!address) || (type & ~ACPI_GPE_XRUPT_TYPE_MASK)) {
686 status = AE_BAD_PARAMETER; 686 return_ACPI_STATUS(AE_BAD_PARAMETER);
687 goto exit;
688 } 687 }
689 688
690 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); 689 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
691 if (ACPI_FAILURE(status)) { 690 if (ACPI_FAILURE(status)) {
692 goto exit; 691 return_ACPI_STATUS(status);
693 } 692 }
694 693
695 /* Ensure that we have a valid GPE number */ 694 /* Ensure that we have a valid GPE number */
@@ -720,6 +719,13 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
720 handler->context = context; 719 handler->context = context;
721 handler->method_node = gpe_event_info->dispatch.method_node; 720 handler->method_node = gpe_event_info->dispatch.method_node;
722 721
722 /* Disable the GPE before installing the handler */
723
724 status = acpi_ev_disable_gpe(gpe_event_info);
725 if (ACPI_FAILURE (status)) {
726 goto unlock_and_exit;
727 }
728
723 /* Install the handler */ 729 /* Install the handler */
724 730
725 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); 731 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
@@ -733,12 +739,8 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
733 739
734 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 740 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
735 741
736 unlock_and_exit: 742unlock_and_exit:
737 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 743 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
738 exit:
739 if (ACPI_FAILURE(status))
740 ACPI_EXCEPTION((AE_INFO, status,
741 "Installing notify handler failed"));
742 return_ACPI_STATUS(status); 744 return_ACPI_STATUS(status);
743} 745}
744 746