aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/namespace/nswalk.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2007-02-02 11:48:21 -0500
committerLen Brown <len.brown@intel.com>2007-02-02 21:14:27 -0500
commitd1fdda83f7c567f376ddd4305833de09f7919ca9 (patch)
tree059dccd5c38ad96a8f31bf8b45409460a02bd41f /drivers/acpi/namespace/nswalk.c
parent9bc75cff4919f9d947982d805aed89582a20d04d (diff)
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,
126 * PARAMETERS: Type - acpi_object_type to search for 126 * PARAMETERS: Type - acpi_object_type to search for
127 * start_node - Handle in namespace where search begins 127 * start_node - Handle in namespace where search begins
128 * max_depth - Depth to which search is to reach 128 * max_depth - Depth to which search is to reach
129 * unlock_before_callback- Whether to unlock the NS before invoking 129 * Flags - Whether to unlock the NS before invoking
130 * the callback routine 130 * the callback routine
131 * user_function - Called when an object of "Type" is found 131 * user_function - Called when an object of "Type" is found
132 * Context - Passed to user function 132 * Context - Passed to user function
@@ -153,7 +153,7 @@ acpi_status
153acpi_ns_walk_namespace(acpi_object_type type, 153acpi_ns_walk_namespace(acpi_object_type type,
154 acpi_handle start_node, 154 acpi_handle start_node,
155 u32 max_depth, 155 u32 max_depth,
156 u8 unlock_before_callback, 156 u32 flags,
157 acpi_walk_callback user_function, 157 acpi_walk_callback user_function,
158 void *context, void **return_value) 158 void *context, void **return_value)
159{ 159{
@@ -201,12 +201,15 @@ acpi_ns_walk_namespace(acpi_object_type type,
201 child_type = child_node->type; 201 child_type = child_node->type;
202 } 202 }
203 203
204 if (child_type == type) { 204 if ((child_type == type) &&
205 (!(child_node->flags & ANOBJ_TEMPORARY) ||
206 (child_node->flags & ANOBJ_TEMPORARY)
207 && (flags & ACPI_NS_WALK_TEMP_NODES))) {
205 /* 208 /*
206 * Found a matching node, invoke the user 209 * Found a matching node, invoke the user
207 * callback function 210 * callback function
208 */ 211 */
209 if (unlock_before_callback) { 212 if (flags & ACPI_NS_WALK_UNLOCK) {
210 mutex_status = 213 mutex_status =
211 acpi_ut_release_mutex 214 acpi_ut_release_mutex
212 (ACPI_MTX_NAMESPACE); 215 (ACPI_MTX_NAMESPACE);
@@ -219,7 +222,7 @@ acpi_ns_walk_namespace(acpi_object_type type,
219 status = user_function(child_node, level, 222 status = user_function(child_node, level,
220 context, return_value); 223 context, return_value);
221 224
222 if (unlock_before_callback) { 225 if (flags & ACPI_NS_WALK_UNLOCK) {
223 mutex_status = 226 mutex_status =
224 acpi_ut_acquire_mutex 227 acpi_ut_acquire_mutex
225 (ACPI_MTX_NAMESPACE); 228 (ACPI_MTX_NAMESPACE);