aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/evxface.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/evxface.c')
-rw-r--r--drivers/acpi/acpica/evxface.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index ae668f32cf16..ddffd6847914 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2012, Intel Corp. 8 * Copyright (C) 2000 - 2013, Intel Corp.
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
@@ -56,13 +56,13 @@ ACPI_MODULE_NAME("evxface")
56 * 56 *
57 * FUNCTION: acpi_install_notify_handler 57 * FUNCTION: acpi_install_notify_handler
58 * 58 *
59 * PARAMETERS: Device - The device for which notifies will be handled 59 * PARAMETERS: device - The device for which notifies will be handled
60 * handler_type - The type of handler: 60 * handler_type - The type of handler:
61 * ACPI_SYSTEM_NOTIFY: System Handler (00-7F) 61 * ACPI_SYSTEM_NOTIFY: System Handler (00-7F)
62 * ACPI_DEVICE_NOTIFY: Device Handler (80-FF) 62 * ACPI_DEVICE_NOTIFY: Device Handler (80-FF)
63 * ACPI_ALL_NOTIFY: Both System and Device 63 * ACPI_ALL_NOTIFY: Both System and Device
64 * Handler - Address of the handler 64 * handler - Address of the handler
65 * Context - Value passed to the handler on each GPE 65 * context - Value passed to the handler on each GPE
66 * 66 *
67 * RETURN: Status 67 * RETURN: Status
68 * 68 *
@@ -217,12 +217,12 @@ ACPI_EXPORT_SYMBOL(acpi_install_notify_handler)
217 * 217 *
218 * FUNCTION: acpi_remove_notify_handler 218 * FUNCTION: acpi_remove_notify_handler
219 * 219 *
220 * PARAMETERS: Device - The device for which the handler is installed 220 * PARAMETERS: device - The device for which the handler is installed
221 * handler_type - The type of handler: 221 * handler_type - The type of handler:
222 * ACPI_SYSTEM_NOTIFY: System Handler (00-7F) 222 * ACPI_SYSTEM_NOTIFY: System Handler (00-7F)
223 * ACPI_DEVICE_NOTIFY: Device Handler (80-FF) 223 * ACPI_DEVICE_NOTIFY: Device Handler (80-FF)
224 * ACPI_ALL_NOTIFY: Both System and Device 224 * ACPI_ALL_NOTIFY: Both System and Device
225 * Handler - Address of the handler 225 * handler - Address of the handler
226 * 226 *
227 * RETURN: Status 227 * RETURN: Status
228 * 228 *
@@ -249,7 +249,8 @@ acpi_remove_notify_handler(acpi_handle device,
249 (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) { 249 (handler_type > ACPI_MAX_NOTIFY_HANDLER_TYPE)) {
250 return_ACPI_STATUS(AE_BAD_PARAMETER); 250 return_ACPI_STATUS(AE_BAD_PARAMETER);
251 } 251 }
252 /* Make sure all deferred tasks are completed */ 252
253 /* Make sure all deferred notify tasks are completed */
253 254
254 acpi_os_wait_events_complete(); 255 acpi_os_wait_events_complete();
255 256
@@ -596,7 +597,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
596 return_ACPI_STATUS(status); 597 return_ACPI_STATUS(status);
597 } 598 }
598 599
599 /* Allocate memory for the handler object */ 600 /* Allocate and init handler object (before lock) */
600 601
601 handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_handler_info)); 602 handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_handler_info));
602 if (!handler) { 603 if (!handler) {
@@ -622,16 +623,15 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
622 goto free_and_exit; 623 goto free_and_exit;
623 } 624 }
624 625
625 /* Allocate and init handler object */
626
627 handler->address = address; 626 handler->address = address;
628 handler->context = context; 627 handler->context = context;
629 handler->method_node = gpe_event_info->dispatch.method_node; 628 handler->method_node = gpe_event_info->dispatch.method_node;
630 handler->original_flags = gpe_event_info->flags & 629 handler->original_flags = (u8)(gpe_event_info->flags &
631 (ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); 630 (ACPI_GPE_XRUPT_TYPE_MASK |
631 ACPI_GPE_DISPATCH_MASK));
632 632
633 /* 633 /*
634 * If the GPE is associated with a method, it might have been enabled 634 * If the GPE is associated with a method, it may have been enabled
635 * automatically during initialization, in which case it has to be 635 * automatically during initialization, in which case it has to be
636 * disabled now to avoid spurious execution of the handler. 636 * disabled now to avoid spurious execution of the handler.
637 */ 637 */
@@ -646,7 +646,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
646 646
647 gpe_event_info->dispatch.handler = handler; 647 gpe_event_info->dispatch.handler = handler;
648 648
649 /* Setup up dispatch flags to indicate handler (vs. method) */ 649 /* Setup up dispatch flags to indicate handler (vs. method/notify) */
650 650
651 gpe_event_info->flags &= 651 gpe_event_info->flags &=
652 ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); 652 ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
@@ -697,7 +697,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
697 return_ACPI_STATUS(AE_BAD_PARAMETER); 697 return_ACPI_STATUS(AE_BAD_PARAMETER);
698 } 698 }
699 699
700 /* Make sure all deferred tasks are completed */ 700 /* Make sure all deferred GPE tasks are completed */
701 701
702 acpi_os_wait_events_complete(); 702 acpi_os_wait_events_complete();
703 703
@@ -747,10 +747,10 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
747 * enabled, it should be enabled at this point to restore the 747 * enabled, it should be enabled at this point to restore the
748 * post-initialization configuration. 748 * post-initialization configuration.
749 */ 749 */
750 750 if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) &&
751 if ((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) 751 handler->originally_enabled) {
752 && handler->originally_enabled)
753 (void)acpi_ev_add_gpe_reference(gpe_event_info); 752 (void)acpi_ev_add_gpe_reference(gpe_event_info);
753 }
754 754
755 /* Now we can free the handler object */ 755 /* Now we can free the handler object */
756 756