]> git.hungrycats.org Git - linux/commitdiff
merge ACPICA
authorLen Brown <len.brown@intel.com>
Tue, 22 Jun 2004 12:27:51 +0000 (08:27 -0400)
committerLen Brown <len.brown@intel.com>
Tue, 22 Jun 2004 12:27:51 +0000 (08:27 -0400)
1  2 
drivers/acpi/ec.c
drivers/acpi/events/evxface.c
drivers/acpi/osl.c

Simple merge
index d33b99057bd6060a4f288c477730bba0d5cc4950,f52a685f5e9e389fe38e8868455fab6bdbdb56a4..15ff704911c69041c6232fcc668f498300ec1171
@@@ -406,16 -415,7 +415,16 @@@ acpi_remove_notify_handler 
                        goto unlock_and_exit;
                }
  
-               if (handler_type == ACPI_SYSTEM_NOTIFY) {
 +              /* Make sure all deferred tasks are completed */
 +
 +              (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
 +              acpi_os_wait_events_complete(NULL);
 +              status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
 +              if (ACPI_FAILURE (status)) {
 +                      return_ACPI_STATUS (status);
 +              }
 +
+               if (handler_type & ACPI_SYSTEM_NOTIFY) {
                        acpi_gbl_system_notify.node  = NULL;
                        acpi_gbl_system_notify.handler = NULL;
                        acpi_gbl_system_notify.context = NULL;
  
                /* Object exists - make sure there's an existing handler */
  
-               if (handler_type == ACPI_SYSTEM_NOTIFY) {
+               if (handler_type & ACPI_SYSTEM_NOTIFY) {
                        notify_obj = obj_desc->common_notify.system_notify;
-               }
-               else {
-                       notify_obj = obj_desc->common_notify.device_notify;
-               }
+                       if ((!notify_obj) ||
+                                (notify_obj->notify.handler != handler)) {
+                               status = AE_BAD_PARAMETER;
+                               goto unlock_and_exit;
+                       }
++                      /* Make sure all deferred tasks are completed */
  
-               if ((!notify_obj) ||
-                       (notify_obj->notify.handler != handler)) {
-                       status = AE_BAD_PARAMETER;
-                       goto unlock_and_exit;
-               }
 -                      /* Remove the handler */
++                      (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
++                      acpi_os_wait_events_complete(NULL);
++                      status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
++                      if (ACPI_FAILURE (status)) {
++                              return_ACPI_STATUS (status);
++                      }
  
-               /* Make sure all deferred tasks are completed */
++                      /* Remove the handler */
+                       obj_desc->common_notify.system_notify = NULL;
+                       acpi_ut_remove_reference (notify_obj);
+               }
  
-               (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
-               acpi_os_wait_events_complete(NULL);
-               status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
-               if (ACPI_FAILURE (status)) {
-                       return_ACPI_STATUS (status);
-               }
+               if (handler_type & ACPI_DEVICE_NOTIFY) {
+                       notify_obj = obj_desc->common_notify.device_notify;
+                       if ((!notify_obj) ||
+                                (notify_obj->notify.handler != handler)) {
+                               status = AE_BAD_PARAMETER;
+                               goto unlock_and_exit;
+                       }
++                      /* Make sure all deferred tasks are completed */
  
-               /* Remove the handler */
 -                      /* Remove the handler */
++                      (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
++                      acpi_os_wait_events_complete(NULL);
++                      status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
++                      if (ACPI_FAILURE (status)) {
++                              return_ACPI_STATUS (status);
++                      }
  
-               if (handler_type == ACPI_SYSTEM_NOTIFY) {
-                       obj_desc->common_notify.system_notify = NULL;
-               }
-               else {
++                      /* Remove the handler */
                        obj_desc->common_notify.device_notify = NULL;
+                       acpi_ut_remove_reference (notify_obj);
                }
- 
-               acpi_ut_remove_reference (notify_obj);
        }
  
  
@@@ -632,15 -643,13 +666,22 @@@ acpi_remove_gpe_handler 
                goto unlock_and_exit;
        }
  
+       /* Disable the GPE before removing the handler */
+ 
+       status = acpi_ev_disable_gpe (gpe_event_info);
+       if (ACPI_FAILURE (status)) {
+               goto unlock_and_exit;
+       }
+ 
 +      /* Make sure all deferred tasks are completed */
 +
 +      (void) acpi_ut_release_mutex (ACPI_MTX_EVENTS);
 +      acpi_os_wait_events_complete(NULL);
 +      status = acpi_ut_acquire_mutex (ACPI_MTX_EVENTS);
 +      if (ACPI_FAILURE (status)) {
 +              return_ACPI_STATUS (status);
 +      }
 +
        /* Remove the handler */
  
        acpi_os_acquire_lock (acpi_gbl_gpe_lock, ACPI_NOT_ISR);
Simple merge