Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[pandora-kernel.git] / drivers / acpi / parser / psparse.c
index 7ee2f2e..5d63f48 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2006, R. Byron Moore
+ * Copyright (C) 2000 - 2007, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -469,6 +469,16 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
        }
 
        walk_state->thread = thread;
+
+       /*
+        * If executing a method, the starting sync_level is this method's
+        * sync_level
+        */
+       if (walk_state->method_desc) {
+               walk_state->thread->current_sync_level =
+                   walk_state->method_desc->method.sync_level;
+       }
+
        acpi_ds_push_walk_state(walk_state, thread);
 
        /*
@@ -505,6 +515,10 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                        status =
                            acpi_ds_call_control_method(thread, walk_state,
                                                        NULL);
+                       if (ACPI_FAILURE(status)) {
+                               status =
+                                   acpi_ds_method_error(status, walk_state);
+                       }
 
                        /*
                         * If the transfer to the new method method call worked, a new walk
@@ -525,7 +539,12 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                        /* Check for possible multi-thread reentrancy problem */
 
                        if ((status == AE_ALREADY_EXISTS) &&
-                           (!walk_state->method_desc->method.semaphore)) {
+                           (!walk_state->method_desc->method.mutex)) {
+                               ACPI_INFO((AE_INFO,
+                                          "Marking method %4.4s as Serialized",
+                                          walk_state->method_node->name.
+                                          ascii));
+
                                /*
                                 * Method tried to create an object twice. The probable cause is
                                 * that the method cannot handle reentrancy.
@@ -537,7 +556,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                                 */
                                walk_state->method_desc->method.method_flags |=
                                    AML_METHOD_SERIALIZED;
-                               walk_state->method_desc->method.concurrency = 1;
+                               walk_state->method_desc->method.sync_level = 0;
                        }
                }