aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/namespace/nswalk.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2007-02-02 19:48:21 +0300
committerLen Brown <len.brown@intel.com>2007-02-02 21:14:27 -0500
commitd1fdda83f7c567f376ddd4305833de09f7919ca9 (patch)
tree059dccd5c38ad96a8f31bf8b45409460a02bd41f /drivers/acpi/namespace/nswalk.c
parentACPICA: Eliminate control method 2-pass parse/execute. (diff)
downloadlinux-dev-d1fdda83f7c567f376ddd4305833de09f7919ca9.tar.xz
linux-dev-d1fdda83f7c567f376ddd4305833de09f7919ca9.zip
ACPICA: Fix race condition with AcpiWalkNamespace.
Fixed a problem with a possible race condition between threads executing AcpiWalkNamespace and the AML interpreter. This condition was removed by modifying AcpiWalkNamespace to (by default) ignore all temporary namespace entries created during any concurrent control method execution Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/namespace/nswalk.c')
-rw-r--r--drivers/acpi/namespace/nswalk.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c
index c8f6bef16ed0..a138fcb832a3 100644
--- a/drivers/acpi/namespace/nswalk.c
+++ b/drivers/acpi/namespace/nswalk.c
@@ -126,7 +126,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type,
* PARAMETERS: Type - acpi_object_type to search for
* start_node - Handle in namespace where search begins
* max_depth - Depth to which search is to reach
- * unlock_before_callback- Whether to unlock the NS before invoking
+ * Flags - Whether to unlock the NS before invoking
* the callback routine
* user_function - Called when an object of "Type" is found
* Context - Passed to user function
@@ -153,7 +153,7 @@ acpi_status
acpi_ns_walk_namespace(acpi_object_type type,
acpi_handle start_node,
u32 max_depth,
- u8 unlock_before_callback,
+ u32 flags,
acpi_walk_callback user_function,
void *context, void **return_value)
{
@@ -201,12 +201,15 @@ acpi_ns_walk_namespace(acpi_object_type type,
child_type = child_node->type;
}
- if (child_type == type) {
+ if ((child_type == type) &&
+ (!(child_node->flags & ANOBJ_TEMPORARY) ||
+ (child_node->flags & ANOBJ_TEMPORARY)
+ && (flags & ACPI_NS_WALK_TEMP_NODES))) {
/*
* Found a matching node, invoke the user
* callback function
*/
- if (unlock_before_callback) {
+ if (flags & ACPI_NS_WALK_UNLOCK) {
mutex_status =
acpi_ut_release_mutex
(ACPI_MTX_NAMESPACE);
@@ -219,7 +222,7 @@ acpi_ns_walk_namespace(acpi_object_type type,
status = user_function(child_node, level,
context, return_value);
- if (unlock_before_callback) {
+ if (flags & ACPI_NS_WALK_UNLOCK) {
mutex_status =
acpi_ut_acquire_mutex
(ACPI_MTX_NAMESPACE);