diff options
Diffstat (limited to 'drivers/acpi/namespace/nssearch.c')
-rw-r--r-- | drivers/acpi/namespace/nssearch.c | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c index c929f45071c0..51adec5a23d6 100644 --- a/drivers/acpi/namespace/nssearch.c +++ b/drivers/acpi/namespace/nssearch.c | |||
@@ -128,9 +128,8 @@ acpi_ns_search_node(u32 target_name, | |||
128 | next_node->object); | 128 | next_node->object); |
129 | } | 129 | } |
130 | 130 | ||
131 | /* | 131 | /* Found matching entry */ |
132 | * Found matching entry. | 132 | |
133 | */ | ||
134 | ACPI_DEBUG_PRINT((ACPI_DB_NAMES, | 133 | ACPI_DEBUG_PRINT((ACPI_DB_NAMES, |
135 | "Name [%4.4s] (%s) %p found in scope [%4.4s] %p\n", | 134 | "Name [%4.4s] (%s) %p found in scope [%4.4s] %p\n", |
136 | ACPI_CAST_PTR(char, &target_name), | 135 | ACPI_CAST_PTR(char, &target_name), |
@@ -248,10 +247,8 @@ acpi_ns_search_parent_tree(u32 target_name, | |||
248 | return_ACPI_STATUS(status); | 247 | return_ACPI_STATUS(status); |
249 | } | 248 | } |
250 | 249 | ||
251 | /* | 250 | /* Not found here, go up another level (until we reach the root) */ |
252 | * Not found here, go up another level | 251 | |
253 | * (until we reach the root) | ||
254 | */ | ||
255 | parent_node = acpi_ns_get_parent_node(parent_node); | 252 | parent_node = acpi_ns_get_parent_node(parent_node); |
256 | } | 253 | } |
257 | 254 | ||
@@ -307,12 +304,29 @@ acpi_ns_search_and_enter(u32 target_name, | |||
307 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 304 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
308 | } | 305 | } |
309 | 306 | ||
310 | /* Name must consist of printable characters */ | 307 | /* |
311 | 308 | * Name must consist of valid ACPI characters. We will repair the name if | |
309 | * necessary because we don't want to abort because of this, but we want | ||
310 | * all namespace names to be printable. A warning message is appropriate. | ||
311 | * | ||
312 | * This issue came up because there are in fact machines that exhibit | ||
313 | * this problem, and we want to be able to enable ACPI support for them, | ||
314 | * even though there are a few bad names. | ||
315 | */ | ||
312 | if (!acpi_ut_valid_acpi_name(target_name)) { | 316 | if (!acpi_ut_valid_acpi_name(target_name)) { |
313 | ACPI_ERROR((AE_INFO, "Bad character in ACPI Name: %X", | 317 | target_name = acpi_ut_repair_name(target_name); |
314 | target_name)); | 318 | |
315 | return_ACPI_STATUS(AE_BAD_CHARACTER); | 319 | /* Report warning only if in strict mode or debug mode */ |
320 | |||
321 | if (!acpi_gbl_enable_interpreter_slack) { | ||
322 | ACPI_WARNING((AE_INFO, | ||
323 | "Found bad character(s) in name, repaired: [%4.4s]\n", | ||
324 | ACPI_CAST_PTR(char, &target_name))); | ||
325 | } else { | ||
326 | ACPI_DEBUG_PRINT((ACPI_DB_WARN, | ||
327 | "Found bad character(s) in name, repaired: [%4.4s]\n", | ||
328 | ACPI_CAST_PTR(char, &target_name))); | ||
329 | } | ||
316 | } | 330 | } |
317 | 331 | ||
318 | /* Try to find the name in the namespace level specified by the caller */ | 332 | /* Try to find the name in the namespace level specified by the caller */ |
@@ -328,10 +342,8 @@ acpi_ns_search_and_enter(u32 target_name, | |||
328 | status = AE_ALREADY_EXISTS; | 342 | status = AE_ALREADY_EXISTS; |
329 | } | 343 | } |
330 | 344 | ||
331 | /* | 345 | /* Either found it or there was an error: finished either way */ |
332 | * Either found it or there was an error | 346 | |
333 | * -- finished either way | ||
334 | */ | ||
335 | return_ACPI_STATUS(status); | 347 | return_ACPI_STATUS(status); |
336 | } | 348 | } |
337 | 349 | ||
@@ -357,9 +369,8 @@ acpi_ns_search_and_enter(u32 target_name, | |||
357 | } | 369 | } |
358 | } | 370 | } |
359 | 371 | ||
360 | /* | 372 | /* In execute mode, just search, never add names. Exit now */ |
361 | * In execute mode, just search, never add names. Exit now. | 373 | |
362 | */ | ||
363 | if (interpreter_mode == ACPI_IMODE_EXECUTE) { | 374 | if (interpreter_mode == ACPI_IMODE_EXECUTE) { |
364 | ACPI_DEBUG_PRINT((ACPI_DB_NAMES, | 375 | ACPI_DEBUG_PRINT((ACPI_DB_NAMES, |
365 | "%4.4s Not found in %p [Not adding]\n", | 376 | "%4.4s Not found in %p [Not adding]\n", |
@@ -379,6 +390,5 @@ acpi_ns_search_and_enter(u32 target_name, | |||
379 | 390 | ||
380 | acpi_ns_install_node(walk_state, node, new_node, type); | 391 | acpi_ns_install_node(walk_state, node, new_node, type); |
381 | *return_node = new_node; | 392 | *return_node = new_node; |
382 | |||
383 | return_ACPI_STATUS(AE_OK); | 393 | return_ACPI_STATUS(AE_OK); |
384 | } | 394 | } |