diff options
author | Lin Ming <ming.m.lin@intel.com> | 2011-01-11 20:19:43 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-18 23:48:03 -0500 |
commit | 262948428878fb340127faca1791acb17146122e (patch) | |
tree | 646ebdc7158fcdf889e59185dd58fd764725bc45 /drivers | |
parent | 672af843abfc9a41c7ec792722e04b6c68a3cfea (diff) |
ACPICA: Fix issues/fault with automatic "serialized" method support
History: This support changes a method to "serialized" on the fly if the
method generates an AE_ALREADY_EXISTS error, indicating the possibility
that it cannot handle reentrancy.
This fix repairs a couple of issues seen in the field, especially on
machines with many cores.
1) Delete method children only upon the exit of the last thread, so
as to not delete objects out from under running threads.
2) Set the "serialized" bit for the method only upon the exit of the
last thread, so as to not cause deadlock when running threads attempt
to exit.
3) Cleanup the use of the AML "MethodFlags" and internal method flags
so that there is no longer any confustion between the two.
Reported-by: Dana Myers <dana.myers@oracle.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/acpica/acobject.h | 14 | ||||
-rw-r--r-- | drivers/acpi/acpica/amlcode.h | 8 | ||||
-rw-r--r-- | drivers/acpi/acpica/dsmethod.c | 62 | ||||
-rw-r--r-- | drivers/acpi/acpica/evrgnini.c | 4 | ||||
-rw-r--r-- | drivers/acpi/acpica/excreate.c | 8 | ||||
-rw-r--r-- | drivers/acpi/acpica/exdump.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/nsaccess.c | 6 | ||||
-rw-r--r-- | drivers/acpi/acpica/nsalloc.c | 4 | ||||
-rw-r--r-- | drivers/acpi/acpica/nseval.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/nsxfname.c | 5 | ||||
-rw-r--r-- | drivers/acpi/acpica/psloop.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/psparse.c | 25 | ||||
-rw-r--r-- | drivers/acpi/acpica/psxface.c | 7 |
13 files changed, 85 insertions, 64 deletions
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h index bdbfaf22bd14..efaf9c6090f5 100644 --- a/drivers/acpi/acpica/acobject.h +++ b/drivers/acpi/acpica/acobject.h | |||
@@ -97,8 +97,6 @@ | |||
97 | #define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */ | 97 | #define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */ |
98 | #define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */ | 98 | #define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */ |
99 | #define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */ | 99 | #define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */ |
100 | #define AOPOBJ_MODULE_LEVEL 0x40 /* Method is actually module-level code */ | ||
101 | #define AOPOBJ_MODIFIED_NAMESPACE 0x80 /* Method modified the namespace */ | ||
102 | 100 | ||
103 | /****************************************************************************** | 101 | /****************************************************************************** |
104 | * | 102 | * |
@@ -175,7 +173,7 @@ struct acpi_object_region { | |||
175 | }; | 173 | }; |
176 | 174 | ||
177 | struct acpi_object_method { | 175 | struct acpi_object_method { |
178 | ACPI_OBJECT_COMMON_HEADER u8 method_flags; | 176 | ACPI_OBJECT_COMMON_HEADER u8 info_flags; |
179 | u8 param_count; | 177 | u8 param_count; |
180 | u8 sync_level; | 178 | u8 sync_level; |
181 | union acpi_operand_object *mutex; | 179 | union acpi_operand_object *mutex; |
@@ -183,13 +181,21 @@ struct acpi_object_method { | |||
183 | union { | 181 | union { |
184 | ACPI_INTERNAL_METHOD implementation; | 182 | ACPI_INTERNAL_METHOD implementation; |
185 | union acpi_operand_object *handler; | 183 | union acpi_operand_object *handler; |
186 | } extra; | 184 | } dispatch; |
187 | 185 | ||
188 | u32 aml_length; | 186 | u32 aml_length; |
189 | u8 thread_count; | 187 | u8 thread_count; |
190 | acpi_owner_id owner_id; | 188 | acpi_owner_id owner_id; |
191 | }; | 189 | }; |
192 | 190 | ||
191 | /* Flags for info_flags field above */ | ||
192 | |||
193 | #define ACPI_METHOD_MODULE_LEVEL 0x01 /* Method is actually module-level code */ | ||
194 | #define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */ | ||
195 | #define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */ | ||
196 | #define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */ | ||
197 | #define ACPI_METHOD_MODIFIED_NAMESPACE 0x10 /* Method modified the namespace */ | ||
198 | |||
193 | /****************************************************************************** | 199 | /****************************************************************************** |
194 | * | 200 | * |
195 | * Objects that can be notified. All share a common notify_info area. | 201 | * Objects that can be notified. All share a common notify_info area. |
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h index 1f484ba228fc..ac1f561ce392 100644 --- a/drivers/acpi/acpica/amlcode.h +++ b/drivers/acpi/acpica/amlcode.h | |||
@@ -480,16 +480,10 @@ typedef enum { | |||
480 | AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D | 480 | AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D |
481 | } AML_ACCESS_ATTRIBUTE; | 481 | } AML_ACCESS_ATTRIBUTE; |
482 | 482 | ||
483 | /* Bit fields in method_flags byte */ | 483 | /* Bit fields in the AML method_flags byte */ |
484 | 484 | ||
485 | #define AML_METHOD_ARG_COUNT 0x07 | 485 | #define AML_METHOD_ARG_COUNT 0x07 |
486 | #define AML_METHOD_SERIALIZED 0x08 | 486 | #define AML_METHOD_SERIALIZED 0x08 |
487 | #define AML_METHOD_SYNC_LEVEL 0xF0 | 487 | #define AML_METHOD_SYNC_LEVEL 0xF0 |
488 | 488 | ||
489 | /* METHOD_FLAGS_ARG_COUNT is not used internally, define additional flags */ | ||
490 | |||
491 | #define AML_METHOD_INTERNAL_ONLY 0x01 | ||
492 | #define AML_METHOD_RESERVED1 0x02 | ||
493 | #define AML_METHOD_RESERVED2 0x04 | ||
494 | |||
495 | #endif /* __AMLCODE_H__ */ | 489 | #endif /* __AMLCODE_H__ */ |
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c index d94dd8974b55..5a79f401a113 100644 --- a/drivers/acpi/acpica/dsmethod.c +++ b/drivers/acpi/acpica/dsmethod.c | |||
@@ -43,7 +43,6 @@ | |||
43 | 43 | ||
44 | #include <acpi/acpi.h> | 44 | #include <acpi/acpi.h> |
45 | #include "accommon.h" | 45 | #include "accommon.h" |
46 | #include "amlcode.h" | ||
47 | #include "acdispat.h" | 46 | #include "acdispat.h" |
48 | #include "acinterp.h" | 47 | #include "acinterp.h" |
49 | #include "acnamesp.h" | 48 | #include "acnamesp.h" |
@@ -201,7 +200,7 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, | |||
201 | /* | 200 | /* |
202 | * If this method is serialized, we need to acquire the method mutex. | 201 | * If this method is serialized, we need to acquire the method mutex. |
203 | */ | 202 | */ |
204 | if (obj_desc->method.method_flags & AML_METHOD_SERIALIZED) { | 203 | if (obj_desc->method.info_flags & ACPI_METHOD_SERIALIZED) { |
205 | /* | 204 | /* |
206 | * Create a mutex for the method if it is defined to be Serialized | 205 | * Create a mutex for the method if it is defined to be Serialized |
207 | * and a mutex has not already been created. We defer the mutex creation | 206 | * and a mutex has not already been created. We defer the mutex creation |
@@ -413,8 +412,9 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, | |||
413 | 412 | ||
414 | /* Invoke an internal method if necessary */ | 413 | /* Invoke an internal method if necessary */ |
415 | 414 | ||
416 | if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) { | 415 | if (obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) { |
417 | status = obj_desc->method.extra.implementation(next_walk_state); | 416 | status = |
417 | obj_desc->method.dispatch.implementation(next_walk_state); | ||
418 | if (status == AE_OK) { | 418 | if (status == AE_OK) { |
419 | status = AE_CTRL_TERMINATE; | 419 | status = AE_CTRL_TERMINATE; |
420 | } | 420 | } |
@@ -579,11 +579,14 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, | |||
579 | 579 | ||
580 | /* | 580 | /* |
581 | * Delete any namespace objects created anywhere within the | 581 | * Delete any namespace objects created anywhere within the |
582 | * namespace by the execution of this method. Unless this method | 582 | * namespace by the execution of this method. Unless: |
583 | * is a module-level executable code method, in which case we | 583 | * 1) This method is a module-level executable code method, in which |
584 | * want make the objects permanent. | 584 | * case we want make the objects permanent. |
585 | * 2) There are other threads executing the method, in which case we | ||
586 | * will wait until the last thread has completed. | ||
585 | */ | 587 | */ |
586 | if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) { | 588 | if (!(method_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) |
589 | && (method_desc->method.thread_count == 1)) { | ||
587 | 590 | ||
588 | /* Delete any direct children of (created by) this method */ | 591 | /* Delete any direct children of (created by) this method */ |
589 | 592 | ||
@@ -593,12 +596,17 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, | |||
593 | /* | 596 | /* |
594 | * Delete any objects that were created by this method | 597 | * Delete any objects that were created by this method |
595 | * elsewhere in the namespace (if any were created). | 598 | * elsewhere in the namespace (if any were created). |
599 | * Use of the ACPI_METHOD_MODIFIED_NAMESPACE optimizes the | ||
600 | * deletion such that we don't have to perform an entire | ||
601 | * namespace walk for every control method execution. | ||
596 | */ | 602 | */ |
597 | if (method_desc->method. | 603 | if (method_desc->method. |
598 | flags & AOPOBJ_MODIFIED_NAMESPACE) { | 604 | info_flags & ACPI_METHOD_MODIFIED_NAMESPACE) { |
599 | acpi_ns_delete_namespace_by_owner(method_desc-> | 605 | acpi_ns_delete_namespace_by_owner(method_desc-> |
600 | method. | 606 | method. |
601 | owner_id); | 607 | owner_id); |
608 | method_desc->method.info_flags &= | ||
609 | ~ACPI_METHOD_MODIFIED_NAMESPACE; | ||
602 | } | 610 | } |
603 | } | 611 | } |
604 | } | 612 | } |
@@ -629,19 +637,43 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, | |||
629 | * Serialized if it appears that the method is incorrectly written and | 637 | * Serialized if it appears that the method is incorrectly written and |
630 | * does not support multiple thread execution. The best example of this | 638 | * does not support multiple thread execution. The best example of this |
631 | * is if such a method creates namespace objects and blocks. A second | 639 | * is if such a method creates namespace objects and blocks. A second |
632 | * thread will fail with an AE_ALREADY_EXISTS exception | 640 | * thread will fail with an AE_ALREADY_EXISTS exception. |
633 | * | 641 | * |
634 | * This code is here because we must wait until the last thread exits | 642 | * This code is here because we must wait until the last thread exits |
635 | * before creating the synchronization semaphore. | 643 | * before marking the method as serialized. |
636 | */ | 644 | */ |
637 | if ((method_desc->method.method_flags & AML_METHOD_SERIALIZED) | 645 | if (method_desc->method. |
638 | && (!method_desc->method.mutex)) { | 646 | info_flags & ACPI_METHOD_SERIALIZED_PENDING) { |
639 | (void)acpi_ds_create_method_mutex(method_desc); | 647 | if (walk_state) { |
648 | ACPI_INFO((AE_INFO, | ||
649 | "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error", | ||
650 | walk_state->method_node->name. | ||
651 | ascii)); | ||
652 | } | ||
653 | |||
654 | /* | ||
655 | * Method tried to create an object twice and was marked as | ||
656 | * "pending serialized". The probable cause is that the method | ||
657 | * cannot handle reentrancy. | ||
658 | * | ||
659 | * The method was created as not_serialized, but it tried to create | ||
660 | * a named object and then blocked, causing the second thread | ||
661 | * entrance to begin and then fail. Workaround this problem by | ||
662 | * marking the method permanently as Serialized when the last | ||
663 | * thread exits here. | ||
664 | */ | ||
665 | method_desc->method.info_flags &= | ||
666 | ~ACPI_METHOD_SERIALIZED_PENDING; | ||
667 | method_desc->method.info_flags |= | ||
668 | ACPI_METHOD_SERIALIZED; | ||
669 | method_desc->method.sync_level = 0; | ||
640 | } | 670 | } |
641 | 671 | ||
642 | /* No more threads, we can free the owner_id */ | 672 | /* No more threads, we can free the owner_id */ |
643 | 673 | ||
644 | if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) { | 674 | if (! |
675 | (method_desc->method. | ||
676 | info_flags & ACPI_METHOD_MODULE_LEVEL)) { | ||
645 | acpi_ut_release_owner_id(&method_desc->method.owner_id); | 677 | acpi_ut_release_owner_id(&method_desc->method.owner_id); |
646 | } | 678 | } |
647 | } | 679 | } |
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c index 0b47a6dc9290..2ef32e952559 100644 --- a/drivers/acpi/acpica/evrgnini.c +++ b/drivers/acpi/acpica/evrgnini.c | |||
@@ -590,9 +590,9 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj, | |||
590 | * See acpi_ns_exec_module_code | 590 | * See acpi_ns_exec_module_code |
591 | */ | 591 | */ |
592 | if (obj_desc->method. | 592 | if (obj_desc->method. |
593 | flags & AOPOBJ_MODULE_LEVEL) { | 593 | info_flags & ACPI_METHOD_MODULE_LEVEL) { |
594 | handler_obj = | 594 | handler_obj = |
595 | obj_desc->method.extra.handler; | 595 | obj_desc->method.dispatch.handler; |
596 | } | 596 | } |
597 | break; | 597 | break; |
598 | 598 | ||
diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c index 3c61b48c73f5..ffac8c7e54c5 100644 --- a/drivers/acpi/acpica/excreate.c +++ b/drivers/acpi/acpica/excreate.c | |||
@@ -482,13 +482,11 @@ acpi_ex_create_method(u8 * aml_start, | |||
482 | obj_desc->method.aml_length = aml_length; | 482 | obj_desc->method.aml_length = aml_length; |
483 | 483 | ||
484 | /* | 484 | /* |
485 | * Disassemble the method flags. Split off the Arg Count | 485 | * Disassemble the method flags. Split off the arg_count, Serialized |
486 | * for efficiency | 486 | * flag, and sync_level for efficiency. |
487 | */ | 487 | */ |
488 | method_flags = (u8) operand[1]->integer.value; | 488 | method_flags = (u8) operand[1]->integer.value; |
489 | 489 | ||
490 | obj_desc->method.method_flags = | ||
491 | (u8) (method_flags & ~AML_METHOD_ARG_COUNT); | ||
492 | obj_desc->method.param_count = | 490 | obj_desc->method.param_count = |
493 | (u8) (method_flags & AML_METHOD_ARG_COUNT); | 491 | (u8) (method_flags & AML_METHOD_ARG_COUNT); |
494 | 492 | ||
@@ -497,6 +495,8 @@ acpi_ex_create_method(u8 * aml_start, | |||
497 | * created for this method when it is parsed. | 495 | * created for this method when it is parsed. |
498 | */ | 496 | */ |
499 | if (method_flags & AML_METHOD_SERIALIZED) { | 497 | if (method_flags & AML_METHOD_SERIALIZED) { |
498 | obj_desc->method.info_flags = ACPI_METHOD_SERIALIZED; | ||
499 | |||
500 | /* | 500 | /* |
501 | * ACPI 1.0: sync_level = 0 | 501 | * ACPI 1.0: sync_level = 0 |
502 | * ACPI 2.0: sync_level = sync_level in method declaration | 502 | * ACPI 2.0: sync_level = sync_level in method declaration |
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c index f067bbb0d961..ff4b1e61c318 100644 --- a/drivers/acpi/acpica/exdump.c +++ b/drivers/acpi/acpica/exdump.c | |||
@@ -122,7 +122,7 @@ static struct acpi_exdump_info acpi_ex_dump_event[2] = { | |||
122 | 122 | ||
123 | static struct acpi_exdump_info acpi_ex_dump_method[9] = { | 123 | static struct acpi_exdump_info acpi_ex_dump_method[9] = { |
124 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL}, | 124 | {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL}, |
125 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.method_flags), "Method Flags"}, | 125 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.info_flags), "Info Flags"}, |
126 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), | 126 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count), |
127 | "Parameter Count"}, | 127 | "Parameter Count"}, |
128 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"}, | 128 | {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"}, |
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c index 0cd925be5fc1..cede0e3200e4 100644 --- a/drivers/acpi/acpica/nsaccess.c +++ b/drivers/acpi/acpica/nsaccess.c | |||
@@ -163,9 +163,9 @@ acpi_status acpi_ns_root_initialize(void) | |||
163 | #else | 163 | #else |
164 | /* Mark this as a very SPECIAL method */ | 164 | /* Mark this as a very SPECIAL method */ |
165 | 165 | ||
166 | obj_desc->method.method_flags = | 166 | obj_desc->method.info_flags = |
167 | AML_METHOD_INTERNAL_ONLY; | 167 | ACPI_METHOD_INTERNAL_ONLY; |
168 | obj_desc->method.extra.implementation = | 168 | obj_desc->method.dispatch.implementation = |
169 | acpi_ut_osi_implementation; | 169 | acpi_ut_osi_implementation; |
170 | #endif | 170 | #endif |
171 | break; | 171 | break; |
diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c index 222a23e838d6..222a9843268d 100644 --- a/drivers/acpi/acpica/nsalloc.c +++ b/drivers/acpi/acpica/nsalloc.c | |||
@@ -234,8 +234,8 @@ void acpi_ns_install_node(struct acpi_walk_state *walk_state, struct acpi_namesp | |||
234 | * modified the namespace. This is used for cleanup when the | 234 | * modified the namespace. This is used for cleanup when the |
235 | * method exits. | 235 | * method exits. |
236 | */ | 236 | */ |
237 | walk_state->method_desc->method.flags |= | 237 | walk_state->method_desc->method.info_flags |= |
238 | AOPOBJ_MODIFIED_NAMESPACE; | 238 | ACPI_METHOD_MODIFIED_NAMESPACE; |
239 | } | 239 | } |
240 | } | 240 | } |
241 | 241 | ||
diff --git a/drivers/acpi/acpica/nseval.c b/drivers/acpi/acpica/nseval.c index f52829cc294b..a55c0d2295ca 100644 --- a/drivers/acpi/acpica/nseval.c +++ b/drivers/acpi/acpica/nseval.c | |||
@@ -389,7 +389,7 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj, | |||
389 | * acpi_gbl_root_node->Object is NULL at PASS1. | 389 | * acpi_gbl_root_node->Object is NULL at PASS1. |
390 | */ | 390 | */ |
391 | if ((type == ACPI_TYPE_DEVICE) && parent_node->object) { | 391 | if ((type == ACPI_TYPE_DEVICE) && parent_node->object) { |
392 | method_obj->method.extra.handler = | 392 | method_obj->method.dispatch.handler = |
393 | parent_node->object->device.handler; | 393 | parent_node->object->device.handler; |
394 | } | 394 | } |
395 | 395 | ||
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c index b01e45a415e3..0a26d73e050a 100644 --- a/drivers/acpi/acpica/nsxfname.c +++ b/drivers/acpi/acpica/nsxfname.c | |||
@@ -603,10 +603,9 @@ acpi_status acpi_install_method(u8 *buffer) | |||
603 | method_obj->method.param_count = (u8) | 603 | method_obj->method.param_count = (u8) |
604 | (method_flags & AML_METHOD_ARG_COUNT); | 604 | (method_flags & AML_METHOD_ARG_COUNT); |
605 | 605 | ||
606 | method_obj->method.method_flags = (u8) | ||
607 | (method_flags & ~AML_METHOD_ARG_COUNT); | ||
608 | |||
609 | if (method_flags & AML_METHOD_SERIALIZED) { | 606 | if (method_flags & AML_METHOD_SERIALIZED) { |
607 | method_obj->method.info_flags = ACPI_METHOD_SERIALIZED; | ||
608 | |||
610 | method_obj->method.sync_level = (u8) | 609 | method_obj->method.sync_level = (u8) |
611 | ((method_flags & AML_METHOD_SYNC_LEVEL) >> 4); | 610 | ((method_flags & AML_METHOD_SYNC_LEVEL) >> 4); |
612 | } | 611 | } |
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c index 2f2e7760938c..06edeaf3b5e5 100644 --- a/drivers/acpi/acpica/psloop.c +++ b/drivers/acpi/acpica/psloop.c | |||
@@ -655,7 +655,7 @@ acpi_ps_link_module_code(union acpi_parse_object *parent_op, | |||
655 | method_obj->method.aml_start = aml_start; | 655 | method_obj->method.aml_start = aml_start; |
656 | method_obj->method.aml_length = aml_length; | 656 | method_obj->method.aml_length = aml_length; |
657 | method_obj->method.owner_id = owner_id; | 657 | method_obj->method.owner_id = owner_id; |
658 | method_obj->method.flags |= AOPOBJ_MODULE_LEVEL; | 658 | method_obj->method.info_flags |= ACPI_METHOD_MODULE_LEVEL; |
659 | 659 | ||
660 | /* | 660 | /* |
661 | * Save the parent node in next_object. This is cheating, but we | 661 | * Save the parent node in next_object. This is cheating, but we |
diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c index 8d81542194d4..3b8de113b571 100644 --- a/drivers/acpi/acpica/psparse.c +++ b/drivers/acpi/acpica/psparse.c | |||
@@ -55,7 +55,6 @@ | |||
55 | #include "acparser.h" | 55 | #include "acparser.h" |
56 | #include "acdispat.h" | 56 | #include "acdispat.h" |
57 | #include "amlcode.h" | 57 | #include "amlcode.h" |
58 | #include "acnamesp.h" | ||
59 | #include "acinterp.h" | 58 | #include "acinterp.h" |
60 | 59 | ||
61 | #define _COMPONENT ACPI_PARSER | 60 | #define _COMPONENT ACPI_PARSER |
@@ -539,24 +538,16 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) | |||
539 | /* Check for possible multi-thread reentrancy problem */ | 538 | /* Check for possible multi-thread reentrancy problem */ |
540 | 539 | ||
541 | if ((status == AE_ALREADY_EXISTS) && | 540 | if ((status == AE_ALREADY_EXISTS) && |
542 | (!walk_state->method_desc->method.mutex)) { | 541 | (!(walk_state->method_desc->method. |
543 | ACPI_INFO((AE_INFO, | 542 | info_flags & ACPI_METHOD_SERIALIZED))) { |
544 | "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error", | ||
545 | walk_state->method_node->name. | ||
546 | ascii)); | ||
547 | |||
548 | /* | 543 | /* |
549 | * Method tried to create an object twice. The probable cause is | 544 | * Method is not serialized and tried to create an object |
550 | * that the method cannot handle reentrancy. | 545 | * twice. The probable cause is that the method cannot |
551 | * | 546 | * handle reentrancy. Mark as "pending serialized" now, and |
552 | * The method is marked not_serialized, but it tried to create | 547 | * then mark "serialized" when the last thread exits. |
553 | * a named object, causing the second thread entrance to fail. | ||
554 | * Workaround this problem by marking the method permanently | ||
555 | * as Serialized. | ||
556 | */ | 548 | */ |
557 | walk_state->method_desc->method.method_flags |= | 549 | walk_state->method_desc->method.info_flags |= |
558 | AML_METHOD_SERIALIZED; | 550 | ACPI_METHOD_SERIALIZED_PENDING; |
559 | walk_state->method_desc->method.sync_level = 0; | ||
560 | } | 551 | } |
561 | } | 552 | } |
562 | 553 | ||
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c index c42f067cff9d..bc49a80c386d 100644 --- a/drivers/acpi/acpica/psxface.c +++ b/drivers/acpi/acpica/psxface.c | |||
@@ -47,7 +47,6 @@ | |||
47 | #include "acdispat.h" | 47 | #include "acdispat.h" |
48 | #include "acinterp.h" | 48 | #include "acinterp.h" |
49 | #include "actables.h" | 49 | #include "actables.h" |
50 | #include "amlcode.h" | ||
51 | 50 | ||
52 | #define _COMPONENT ACPI_PARSER | 51 | #define _COMPONENT ACPI_PARSER |
53 | ACPI_MODULE_NAME("psxface") | 52 | ACPI_MODULE_NAME("psxface") |
@@ -285,15 +284,15 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info) | |||
285 | goto cleanup; | 284 | goto cleanup; |
286 | } | 285 | } |
287 | 286 | ||
288 | if (info->obj_desc->method.flags & AOPOBJ_MODULE_LEVEL) { | 287 | if (info->obj_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) { |
289 | walk_state->parse_flags |= ACPI_PARSE_MODULE_LEVEL; | 288 | walk_state->parse_flags |= ACPI_PARSE_MODULE_LEVEL; |
290 | } | 289 | } |
291 | 290 | ||
292 | /* Invoke an internal method if necessary */ | 291 | /* Invoke an internal method if necessary */ |
293 | 292 | ||
294 | if (info->obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) { | 293 | if (info->obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) { |
295 | status = | 294 | status = |
296 | info->obj_desc->method.extra.implementation(walk_state); | 295 | info->obj_desc->method.dispatch.implementation(walk_state); |
297 | info->return_object = walk_state->return_desc; | 296 | info->return_object = walk_state->return_desc; |
298 | 297 | ||
299 | /* Cleanup states */ | 298 | /* Cleanup states */ |