Commit 08476907 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branch 'acpica'

* acpica:
  ACPICA: Enable auto-serialization as a default kernel behavior.
  ACPICA: Ignore sync_level for methods that have been auto-serialized.
  ACPICA: Add additional named objects for the auto-serialize method scan.
  ACPICA: Add auto-serialization support for ill-behaved control methods.
  ACPICA: Remove global option to serialize all control methods.
parents 0ecfe310 08e1d7c0
...@@ -229,6 +229,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -229,6 +229,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
use by PCI use by PCI
Format: <irq>,<irq>... Format: <irq>,<irq>...
acpi_no_auto_serialize [HW,ACPI]
Disable auto-serialization of AML methods
AML control methods that contain the opcodes to create
named objects will be marked as "Serialized" by the
auto-serialization feature.
This feature is enabled by default.
This option allows to turn off the feature.
acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT
acpica_no_return_repair [HW, ACPI] acpica_no_return_repair [HW, ACPI]
...@@ -306,8 +314,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -306,8 +314,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode
Format: { level | edge | high | low } Format: { level | edge | high | low }
acpi_serialize [HW,ACPI] force serialization of AML methods
acpi_skip_timer_override [HW,ACPI] acpi_skip_timer_override [HW,ACPI]
Recognize and ignore IRQ0/pin2 Interrupt Override. Recognize and ignore IRQ0/pin2 Interrupt Override.
For broken nForce2 BIOS resulting in XT-PIC timer. For broken nForce2 BIOS resulting in XT-PIC timer.
......
...@@ -139,20 +139,21 @@ acpi_ds_init_field_objects(union acpi_parse_object *op, ...@@ -139,20 +139,21 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
struct acpi_walk_state *walk_state); struct acpi_walk_state *walk_state);
/* /*
* dsload - Parser/Interpreter interface, pass 1 namespace load callbacks * dsload - Parser/Interpreter interface
*/ */
acpi_status acpi_status
acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number); acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number);
/* dsload - pass 1 namespace load callbacks */
acpi_status acpi_status
acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state, acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state,
union acpi_parse_object **out_op); union acpi_parse_object **out_op);
acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state); acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state);
/* /* dsload - pass 2 namespace load callbacks */
* dsload - Parser/Interpreter interface, pass 2 namespace load callbacks
*/
acpi_status acpi_status
acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
union acpi_parse_object **out_op); union acpi_parse_object **out_op);
...@@ -200,7 +201,9 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state); ...@@ -200,7 +201,9 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state);
/* /*
* dsmethod - Parser/Interpreter interface - control method parsing * dsmethod - Parser/Interpreter interface - control method parsing
*/ */
acpi_status acpi_ds_parse_method(struct acpi_namespace_node *node); acpi_status
acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
union acpi_operand_object *obj_desc);
acpi_status acpi_status
acpi_ds_call_control_method(struct acpi_thread_state *thread, acpi_ds_call_control_method(struct acpi_thread_state *thread,
......
...@@ -93,12 +93,13 @@ ...@@ -93,12 +93,13 @@
ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE); ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE);
/* /*
* Automatically serialize ALL control methods? Default is FALSE, meaning * Automatically serialize all methods that create named objects? Default
* to use the Serialized/not_serialized method flags on a per method basis. * is TRUE, meaning that all non_serialized methods are scanned once at
* Only change this if the ASL code is poorly written and cannot handle * table load time to determine those that create named objects. Methods
* reentrancy even though methods are marked "NotSerialized". * that create named objects are marked Serialized in order to prevent
* possible run-time problems if they are entered by more than one thread.
*/ */
ACPI_INIT_GLOBAL(u8, acpi_gbl_all_methods_serialized, FALSE); ACPI_INIT_GLOBAL(u8, acpi_gbl_auto_serialize_methods, TRUE);
/* /*
* Create the predefined _OSI method in the namespace? Default is TRUE * Create the predefined _OSI method in the namespace? Default is TRUE
......
...@@ -458,10 +458,6 @@ void acpi_ex_enter_interpreter(void); ...@@ -458,10 +458,6 @@ void acpi_ex_enter_interpreter(void);
void acpi_ex_exit_interpreter(void); void acpi_ex_exit_interpreter(void);
void acpi_ex_reacquire_interpreter(void);
void acpi_ex_relinquish_interpreter(void);
u8 acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc); u8 acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
void acpi_ex_acquire_global_lock(u32 rule); void acpi_ex_acquire_global_lock(u32 rule);
......
...@@ -193,7 +193,8 @@ struct acpi_object_method { ...@@ -193,7 +193,8 @@ struct acpi_object_method {
#define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */ #define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */
#define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */ #define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */
#define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */ #define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */
#define ACPI_METHOD_MODIFIED_NAMESPACE 0x10 /* Method modified the namespace */ #define ACPI_METHOD_IGNORE_SYNC_LEVEL 0x10 /* Method was auto-serialized at table load time */
#define ACPI_METHOD_MODIFIED_NAMESPACE 0x20 /* Method modified the namespace */
/****************************************************************************** /******************************************************************************
* *
......
...@@ -133,6 +133,9 @@ struct acpi_init_walk_info { ...@@ -133,6 +133,9 @@ struct acpi_init_walk_info {
u32 table_index; u32 table_index;
u32 object_count; u32 object_count;
u32 method_count; u32 method_count;
u32 serial_method_count;
u32 non_serial_method_count;
u32 serialized_method_count;
u32 device_count; u32 device_count;
u32 op_region_count; u32 op_region_count;
u32 field_count; u32 field_count;
......
...@@ -83,8 +83,8 @@ acpi_ds_init_one_object(acpi_handle obj_handle, ...@@ -83,8 +83,8 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
(struct acpi_init_walk_info *)context; (struct acpi_init_walk_info *)context;
struct acpi_namespace_node *node = struct acpi_namespace_node *node =
(struct acpi_namespace_node *)obj_handle; (struct acpi_namespace_node *)obj_handle;
acpi_object_type type;
acpi_status status; acpi_status status;
union acpi_operand_object *obj_desc;
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
...@@ -100,9 +100,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle, ...@@ -100,9 +100,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
/* And even then, we are only interested in a few object types */ /* And even then, we are only interested in a few object types */
type = acpi_ns_get_type(obj_handle); switch (acpi_ns_get_type(obj_handle)) {
switch (type) {
case ACPI_TYPE_REGION: case ACPI_TYPE_REGION:
status = acpi_ds_initialize_region(obj_handle); status = acpi_ds_initialize_region(obj_handle);
...@@ -117,8 +115,44 @@ acpi_ds_init_one_object(acpi_handle obj_handle, ...@@ -117,8 +115,44 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
break; break;
case ACPI_TYPE_METHOD: case ACPI_TYPE_METHOD:
/*
* Auto-serialization support. We will examine each method that is
* not_serialized to determine if it creates any Named objects. If
* it does, it will be marked serialized to prevent problems if
* the method is entered by two or more threads and an attempt is
* made to create the same named object twice -- which results in
* an AE_ALREADY_EXISTS exception and method abort.
*/
info->method_count++; info->method_count++;
obj_desc = acpi_ns_get_attached_object(node);
if (!obj_desc) {
break;
}
/* Ignore if already serialized */
if (obj_desc->method.info_flags & ACPI_METHOD_SERIALIZED) {
info->serial_method_count++;
break;
}
if (acpi_gbl_auto_serialize_methods) {
/* Parse/scan method and serialize it if necessary */
acpi_ds_auto_serialize_method(node, obj_desc);
if (obj_desc->method.
info_flags & ACPI_METHOD_SERIALIZED) {
/* Method was just converted to Serialized */
info->serial_method_count++;
info->serialized_method_count++;
break;
}
}
info->non_serial_method_count++;
break; break;
case ACPI_TYPE_DEVICE: case ACPI_TYPE_DEVICE:
...@@ -170,7 +204,6 @@ acpi_ds_initialize_objects(u32 table_index, ...@@ -170,7 +204,6 @@ acpi_ds_initialize_objects(u32 table_index,
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n")); "**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "Parsing all Control Methods:"));
/* Set all init info to zero */ /* Set all init info to zero */
...@@ -205,14 +238,16 @@ acpi_ds_initialize_objects(u32 table_index, ...@@ -205,14 +238,16 @@ acpi_ds_initialize_objects(u32 table_index,
} }
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"\nTable [%4.4s](id %4.4X) - %u Objects with %u Devices %u Methods %u Regions\n", "Table [%4.4s] (id %4.4X) - %4u Objects with %3u Devices, "
"%3u Regions, %3u Methods (%u/%u/%u Serial/Non/Cvt)\n",
table->signature, owner_id, info.object_count, table->signature, owner_id, info.object_count,
info.device_count, info.method_count, info.device_count, info.op_region_count,
info.op_region_count)); info.method_count, info.serial_method_count,
info.non_serial_method_count,
info.serialized_method_count));
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
"%u Methods, %u Regions\n", info.method_count, info.method_count, info.op_region_count));
info.op_region_count));
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
...@@ -49,14 +49,153 @@ ...@@ -49,14 +49,153 @@
#ifdef ACPI_DISASSEMBLER #ifdef ACPI_DISASSEMBLER
#include "acdisasm.h" #include "acdisasm.h"
#endif #endif
#include "acparser.h"
#include "amlcode.h"
#define _COMPONENT ACPI_DISPATCHER #define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME("dsmethod") ACPI_MODULE_NAME("dsmethod")
/* Local prototypes */ /* Local prototypes */
static acpi_status
acpi_ds_detect_named_opcodes(struct acpi_walk_state *walk_state,
union acpi_parse_object **out_op);
static acpi_status static acpi_status
acpi_ds_create_method_mutex(union acpi_operand_object *method_desc); acpi_ds_create_method_mutex(union acpi_operand_object *method_desc);
/*******************************************************************************
*
* FUNCTION: acpi_ds_auto_serialize_method
*
* PARAMETERS: node - Namespace Node of the method
* obj_desc - Method object attached to node
*
* RETURN: Status
*
* DESCRIPTION: Parse a control method AML to scan for control methods that
* need serialization due to the creation of named objects.
*
* NOTE: It is a bit of overkill to mark all such methods serialized, since
* there is only a problem if the method actually blocks during execution.
* A blocking operation is, for example, a Sleep() operation, or any access
* to an operation region. However, it is probably not possible to easily
* detect whether a method will block or not, so we simply mark all suspicious
* methods as serialized.
*
* NOTE2: This code is essentially a generic routine for parsing a single
* control method.
*
******************************************************************************/
acpi_status
acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
union acpi_operand_object *obj_desc)
{
acpi_status status;
union acpi_parse_object *op = NULL;
struct acpi_walk_state *walk_state;
ACPI_FUNCTION_TRACE_PTR(ds_auto_serialize_method, node);
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
"Method auto-serialization parse [%4.4s] %p\n",
acpi_ut_get_node_name(node), node));
/* Create/Init a root op for the method parse tree */
op = acpi_ps_alloc_op(AML_METHOD_OP);
if (!op) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
acpi_ps_set_name(op, node->name.integer);
op->common.node = node;
/* Create and initialize a new walk state */
walk_state =
acpi_ds_create_walk_state(node->owner_id, NULL, NULL, NULL);
if (!walk_state) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
status =
acpi_ds_init_aml_walk(walk_state, op, node,
obj_desc->method.aml_start,
obj_desc->method.aml_length, NULL, 0);
if (ACPI_FAILURE(status)) {
acpi_ds_delete_walk_state(walk_state);
return_ACPI_STATUS(status);
}
walk_state->descending_callback = acpi_ds_detect_named_opcodes;
/* Parse the method, scan for creation of named objects */
status = acpi_ps_parse_aml(walk_state);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
acpi_ps_delete_parse_tree(op);
return_ACPI_STATUS(status);
}
/*******************************************************************************
*
* FUNCTION: acpi_ds_detect_named_opcodes
*
* PARAMETERS: walk_state - Current state of the parse tree walk
* out_op - Unused, required for parser interface
*
* RETURN: Status
*
* DESCRIPTION: Descending callback used during the loading of ACPI tables.
* Currently used to detect methods that must be marked serialized
* in order to avoid problems with the creation of named objects.
*
******************************************************************************/
static acpi_status
acpi_ds_detect_named_opcodes(struct acpi_walk_state *walk_state,
union acpi_parse_object **out_op)
{
ACPI_FUNCTION_NAME(acpi_ds_detect_named_opcodes);
/* We are only interested in opcodes that create a new name */
if (!
(walk_state->op_info->
flags & (AML_NAMED | AML_CREATE | AML_FIELD))) {
return (AE_OK);
}
/*
* At this point, we know we have a Named object opcode.
* Mark the method as serialized. Later code will create a mutex for
* this method to enforce serialization.
*
* Note, ACPI_METHOD_IGNORE_SYNC_LEVEL flag means that we will ignore the
* Sync Level mechanism for this method, even though it is now serialized.
* Otherwise, there can be conflicts with existing ASL code that actually
* uses sync levels.
*/
walk_state->method_desc->method.sync_level = 0;
walk_state->method_desc->method.info_flags |=
(ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Method serialized [%4.4s] %p - [%s] (%4.4X)\n",
walk_state->method_node->name.ascii,
walk_state->method_node, walk_state->op_info->name,
walk_state->opcode));
/* Abort the parse, no need to examine this method any further */
return (AE_CTRL_TERMINATE);
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ds_method_error * FUNCTION: acpi_ds_method_error
...@@ -74,7 +213,7 @@ acpi_ds_create_method_mutex(union acpi_operand_object *method_desc); ...@@ -74,7 +213,7 @@ acpi_ds_create_method_mutex(union acpi_operand_object *method_desc);
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state) acpi_ds_method_error(acpi_status status, struct acpi_walk_state * walk_state)
{ {
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
...@@ -217,13 +356,19 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, ...@@ -217,13 +356,19 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
/* /*
* The current_sync_level (per-thread) must be less than or equal to * The current_sync_level (per-thread) must be less than or equal to
* the sync level of the method. This mechanism provides some * the sync level of the method. This mechanism provides some
* deadlock prevention * deadlock prevention.
*
* If the method was auto-serialized, we just ignore the sync level
* mechanism, because auto-serialization of methods can interfere
* with ASL code that actually uses sync levels.
* *
* Top-level method invocation has no walk state at this point * Top-level method invocation has no walk state at this point
*/ */
if (walk_state && if (walk_state &&
(walk_state->thread->current_sync_level > (!(obj_desc->method.
obj_desc->method.mutex->mutex.sync_level)) { info_flags & ACPI_METHOD_IGNORE_SYNC_LEVEL))
&& (walk_state->thread->current_sync_level >
obj_desc->method.mutex->mutex.sync_level)) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%u)", "Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%u)",
acpi_ut_get_node_name(method_node), acpi_ut_get_node_name(method_node),
...@@ -668,7 +813,8 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, ...@@ -668,7 +813,8 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
method_desc->method.info_flags &= method_desc->method.info_flags &=
~ACPI_METHOD_SERIALIZED_PENDING; ~ACPI_METHOD_SERIALIZED_PENDING;
method_desc->method.info_flags |= method_desc->method.info_flags |=
ACPI_METHOD_SERIALIZED; (ACPI_METHOD_SERIALIZED |
ACPI_METHOD_IGNORE_SYNC_LEVEL);
method_desc->method.sync_level = 0; method_desc->method.sync_level = 0;
} }
......
...@@ -73,8 +73,20 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number) ...@@ -73,8 +73,20 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number)
{ {
switch (pass_number) { switch (pass_number) {
case 0:
/* Parse only - caller will setup callbacks */
walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 |
ACPI_PARSE_DELETE_TREE | ACPI_PARSE_DISASSEMBLE;
walk_state->descending_callback = NULL;
walk_state->ascending_callback = NULL;
break;
case 1: case 1:
/* Load pass 1 */
walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 | walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 |
ACPI_PARSE_DELETE_TREE; ACPI_PARSE_DELETE_TREE;
walk_state->descending_callback = acpi_ds_load1_begin_op; walk_state->descending_callback = acpi_ds_load1_begin_op;
...@@ -83,6 +95,8 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number) ...@@ -83,6 +95,8 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number)
case 2: case 2:
/* Load pass 2 */
walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 | walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 |
ACPI_PARSE_DELETE_TREE; ACPI_PARSE_DELETE_TREE;
walk_state->descending_callback = acpi_ds_load2_begin_op; walk_state->descending_callback = acpi_ds_load2_begin_op;
...@@ -91,6 +105,8 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number) ...@@ -91,6 +105,8 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number)
case 3: case 3:
/* Execution pass */
#ifndef ACPI_NO_METHOD_EXECUTION #ifndef ACPI_NO_METHOD_EXECUTION
walk_state->parse_flags |= ACPI_PARSE_EXECUTE | walk_state->parse_flags |= ACPI_PARSE_EXECUTE |
ACPI_PARSE_DELETE_TREE; ACPI_PARSE_DELETE_TREE;
......
...@@ -77,7 +77,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) ...@@ -77,7 +77,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
/* We must wait, so unlock the interpreter */ /* We must wait, so unlock the interpreter */
acpi_ex_relinquish_interpreter(); acpi_ex_exit_interpreter();
status = acpi_os_wait_semaphore(semaphore, 1, timeout); status = acpi_os_wait_semaphore(semaphore, 1, timeout);
...@@ -87,7 +87,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) ...@@ -87,7 +87,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
/* Reacquire the interpreter */ /* Reacquire the interpreter */
acpi_ex_reacquire_interpreter(); acpi_ex_enter_interpreter();
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
...@@ -123,7 +123,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) ...@@ -123,7 +123,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
/* We must wait, so unlock the interpreter */ /* We must wait, so unlock the interpreter */
acpi_ex_relinquish_interpreter(); acpi_ex_exit_interpreter();
status = acpi_os_acquire_mutex(mutex, timeout); status = acpi_os_acquire_mutex(mutex, timeout);
...@@ -133,7 +133,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) ...@@ -133,7 +133,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
/* Reacquire the interpreter */ /* Reacquire the interpreter */
acpi_ex_reacquire_interpreter(); acpi_ex_enter_interpreter();
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
...@@ -198,7 +198,7 @@ acpi_status acpi_ex_system_do_sleep(u64 how_long) ...@@ -198,7 +198,7 @@ acpi_status acpi_ex_system_do_sleep(u64 how_long)
/* Since this thread will sleep, we must release the interpreter */ /* Since this thread will sleep, we must release the interpreter */
acpi_ex_relinquish_interpreter(); acpi_ex_exit_interpreter();
/* /*
* For compatibility with other ACPI implementations and to prevent * For compatibility with other ACPI implementations and to prevent
...@@ -212,7 +212,7 @@ acpi_status acpi_ex_system_do_sleep(u64 how_long) ...@@ -212,7 +212,7 @@ acpi_status acpi_ex_system_do_sleep(u64 how_long)
/* And now we must get the interpreter again */ /* And now we must get the interpreter again */
acpi_ex_reacquire_interpreter(); acpi_ex_enter_interpreter();
return (AE_OK); return (AE_OK);
} }
......
...@@ -98,37 +98,6 @@ void acpi_ex_enter_interpreter(void) ...@@ -98,37 +98,6 @@ void acpi_ex_enter_interpreter(void)
return_VOID; return_VOID;
} }
/*******************************************************************************
*
* FUNCTION: acpi_ex_reacquire_interpreter
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Reacquire the interpreter execution region from within the
* interpreter code. Failure to enter the interpreter region is a
* fatal system error. Used in conjunction with
* relinquish_interpreter
*
******************************************************************************/
void acpi_ex_reacquire_interpreter(void)
{
ACPI_FUNCTION_TRACE(ex_reacquire_interpreter);
/*
* If the global serialized flag is set, do not release the interpreter,
* since it was not actually released by acpi_ex_relinquish_interpreter.
* This forces the interpreter to be single threaded.
*/
if (!acpi_gbl_all_methods_serialized) {
acpi_ex_enter_interpreter();
}
return_VOID;
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ex_exit_interpreter * FUNCTION: acpi_ex_exit_interpreter
...@@ -139,7 +108,16 @@ void acpi_ex_reacquire_interpreter(void) ...@@ -139,7 +108,16 @@ void acpi_ex_reacquire_interpreter(void)
* *
* DESCRIPTION: Exit the interpreter execution region. This is the top level * DESCRIPTION: Exit the interpreter execution region. This is the top level
* routine used to exit the interpreter when all processing has * routine used to exit the interpreter when all processing has
* been completed. * been completed, or when the method blocks.
*
* Cases where the interpreter is unlocked internally:
* 1) Method will be blocked on a Sleep() AML opcode
* 2) Method will be blocked on an Acquire() AML opcode
* 3) Method will be blocked on a Wait() AML opcode
* 4) Method will be blocked to acquire the global lock
* 5) Method will be blocked waiting to execute a serialized control
* method that is currently executing
* 6) About to invoke a user-installed opregion handler
* *
******************************************************************************/ ******************************************************************************/
...@@ -158,44 +136,6 @@ void acpi_ex_exit_interpreter(void) ...@@ -158,44 +136,6 @@ void acpi_ex_exit_interpreter(void)
return_VOID; return_VOID;
} }
/*******************************************************************************
*
* FUNCTION: acpi_ex_relinquish_interpreter
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Exit the interpreter execution region, from within the
* interpreter - before attempting an operation that will possibly
* block the running thread.
*
* Cases where the interpreter is unlocked internally
* 1) Method to be blocked on a Sleep() AML opcode
* 2) Method to be blocked on an Acquire() AML opcode
* 3) Method to be blocked on a Wait() AML opcode
* 4) Method to be blocked to acquire the global lock
* 5) Method to be blocked waiting to execute a serialized control method
* that is currently executing
* 6) About to invoke a user-installed opregion handler
*
******************************************************************************/
void acpi_ex_relinquish_interpreter(void)
{
ACPI_FUNCTION_TRACE(ex_relinquish_interpreter);
/*
* If the global serialized flag is set, do not release the interpreter.
* This forces the interpreter to be single threaded.
*/
if (!acpi_gbl_all_methods_serialized) {
acpi_ex_exit_interpreter();
}
return_VOID;
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ex_truncate_for32bit_table * FUNCTION: acpi_ex_truncate_for32bit_table
......
...@@ -111,9 +111,8 @@ acpi_status acpi_ns_initialize_objects(void) ...@@ -111,9 +111,8 @@ acpi_status acpi_ns_initialize_objects(void)
info.object_count)); info.object_count));
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"%u Control Methods found\n", info.method_count)); "%u Control Methods found\n%u Op Regions found\n",
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, info.method_count, info.op_region_count));
"%u Op Regions found\n", info.op_region_count));
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
......
...@@ -128,12 +128,12 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node) ...@@ -128,12 +128,12 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node)
* parse trees. * parse trees.
*/ */
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"**** Begin Table Method Parsing and Object Initialization\n")); "**** Begin Table Object Initialization\n"));
status = acpi_ds_initialize_objects(table_index, node); status = acpi_ds_initialize_objects(table_index, node);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"**** Completed Table Method Parsing and Object Initialization\n")); "**** Completed Table Object Initialization\n"));
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -480,6 +480,10 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) ...@@ -480,6 +480,10 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
status = AE_OK; status = AE_OK;
} }
if (status == AE_CTRL_TERMINATE) {
return_ACPI_STATUS(status);
}
status = status =
acpi_ps_complete_op(walk_state, &op, acpi_ps_complete_op(walk_state, &op,
status); status);
......
...@@ -219,7 +219,10 @@ acpi_ps_build_named_op(struct acpi_walk_state *walk_state, ...@@ -219,7 +219,10 @@ acpi_ps_build_named_op(struct acpi_walk_state *walk_state,
status = walk_state->descending_callback(walk_state, op); status = walk_state->descending_callback(walk_state, op);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "During name lookup/catalog")); if (status != AE_CTRL_TERMINATE) {
ACPI_EXCEPTION((AE_INFO, status,
"During name lookup/catalog"));
}
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -230,7 +233,7 @@ acpi_ps_build_named_op(struct acpi_walk_state *walk_state, ...@@ -230,7 +233,7 @@ acpi_ps_build_named_op(struct acpi_walk_state *walk_state,
status = acpi_ps_next_parse_state(walk_state, *op, status); status = acpi_ps_next_parse_state(walk_state, *op, status);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
if (status == AE_CTRL_PENDING) { if (status == AE_CTRL_PENDING) {
return_ACPI_STATUS(AE_CTRL_PARSE_PENDING); status = AE_CTRL_PARSE_PENDING;
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -1537,17 +1537,21 @@ static int __init osi_setup(char *str) ...@@ -1537,17 +1537,21 @@ static int __init osi_setup(char *str)
__setup("acpi_osi=", osi_setup); __setup("acpi_osi=", osi_setup);
/* enable serialization to combat AE_ALREADY_EXISTS errors */ /*
static int __init acpi_serialize_setup(char *str) * Disable the auto-serialization of named objects creation methods.
*
* This feature is enabled by default. It marks the AML control methods
* that contain the opcodes to create named objects as "Serialized".
*/
static int __init acpi_no_auto_serialize_setup(char *str)
{ {
printk(KERN_INFO PREFIX "serialize enabled\n"); acpi_gbl_auto_serialize_methods = FALSE;
pr_info("ACPI: auto-serialization disabled\n");
acpi_gbl_all_methods_serialized = TRUE;
return 1; return 1;
} }
__setup("acpi_serialize", acpi_serialize_setup); __setup("acpi_no_auto_serialize", acpi_no_auto_serialize_setup);
/* Check of resource interference between native drivers and ACPI /* Check of resource interference between native drivers and ACPI
* OperationRegions (SystemIO and System Memory only). * OperationRegions (SystemIO and System Memory only).
......
...@@ -71,7 +71,7 @@ extern u32 acpi_dbg_layer; ...@@ -71,7 +71,7 @@ extern u32 acpi_dbg_layer;
/* ACPICA runtime options */ /* ACPICA runtime options */
extern u8 acpi_gbl_all_methods_serialized; extern u8 acpi_gbl_auto_serialize_methods;
extern u8 acpi_gbl_copy_dsdt_locally; extern u8 acpi_gbl_copy_dsdt_locally;
extern u8 acpi_gbl_create_osi_method; extern u8 acpi_gbl_create_osi_method;
extern u8 acpi_gbl_disable_auto_repair; extern u8 acpi_gbl_disable_auto_repair;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment