Skip to content

Commit

Permalink
Merge branch 'acpica'
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Rafael J. Wysocki committed Apr 1, 2014
2 parents 0ecfe31 + 08e1d7c commit 0847690
Show file tree
Hide file tree
Showing 17 changed files with 281 additions and 124 deletions.
10 changes: 8 additions & 2 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
use by PCI
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

acpica_no_return_repair [HW, ACPI]
Expand Down Expand Up @@ -306,8 +314,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode
Format: { level | edge | high | low }

acpi_serialize [HW,ACPI] force serialization of AML methods

acpi_skip_timer_override [HW,ACPI]
Recognize and ignore IRQ0/pin2 Interrupt Override.
For broken nForce2 BIOS resulting in XT-PIC timer.
Expand Down
13 changes: 8 additions & 5 deletions drivers/acpi/acpica/acdispat.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,21 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
struct acpi_walk_state *walk_state);

/*
* dsload - Parser/Interpreter interface, pass 1 namespace load callbacks
* dsload - Parser/Interpreter interface
*/
acpi_status
acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number);

/* dsload - pass 1 namespace load callbacks */

acpi_status
acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state,
union acpi_parse_object **out_op);

acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state);

/*
* dsload - Parser/Interpreter interface, pass 2 namespace load callbacks
*/
/* dsload - pass 2 namespace load callbacks */

acpi_status
acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
union acpi_parse_object **out_op);
Expand Down Expand Up @@ -200,7 +201,9 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state);
/*
* 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_ds_call_control_method(struct acpi_thread_state *thread,
Expand Down
11 changes: 6 additions & 5 deletions drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@
ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE);

/*
* Automatically serialize ALL control methods? Default is FALSE, meaning
* to use the Serialized/not_serialized method flags on a per method basis.
* Only change this if the ASL code is poorly written and cannot handle
* reentrancy even though methods are marked "NotSerialized".
* Automatically serialize all methods that create named objects? Default
* is TRUE, meaning that all non_serialized methods are scanned once at
* table load time to determine those that create named objects. Methods
* 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
Expand Down
4 changes: 0 additions & 4 deletions drivers/acpi/acpica/acinterp.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,6 @@ void acpi_ex_enter_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);

void acpi_ex_acquire_global_lock(u32 rule);
Expand Down
3 changes: 2 additions & 1 deletion drivers/acpi/acpica/acobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ struct acpi_object_method {
#define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */
#define ACPI_METHOD_SERIALIZED 0x04 /* Method is 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 */

/******************************************************************************
*
Expand Down
3 changes: 3 additions & 0 deletions drivers/acpi/acpica/acstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ struct acpi_init_walk_info {
u32 table_index;
u32 object_count;
u32 method_count;
u32 serial_method_count;
u32 non_serial_method_count;
u32 serialized_method_count;
u32 device_count;
u32 op_region_count;
u32 field_count;
Expand Down
59 changes: 47 additions & 12 deletions drivers/acpi/acpica/dsinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
(struct acpi_init_walk_info *)context;
struct acpi_namespace_node *node =
(struct acpi_namespace_node *)obj_handle;
acpi_object_type type;
acpi_status status;
union acpi_operand_object *obj_desc;

ACPI_FUNCTION_ENTRY();

Expand All @@ -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 */

type = acpi_ns_get_type(obj_handle);

switch (type) {
switch (acpi_ns_get_type(obj_handle)) {
case ACPI_TYPE_REGION:

status = acpi_ds_initialize_region(obj_handle);
Expand All @@ -117,8 +115,44 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
break;

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++;
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;

case ACPI_TYPE_DEVICE:
Expand Down Expand Up @@ -170,7 +204,6 @@ acpi_ds_initialize_objects(u32 table_index,

ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "Parsing all Control Methods:"));

/* Set all init info to zero */

Expand Down Expand Up @@ -205,14 +238,16 @@ acpi_ds_initialize_objects(u32 table_index,
}

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,
info.device_count, info.method_count,
info.op_region_count));
info.device_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,
"%u Methods, %u Regions\n", info.method_count,
info.op_region_count));
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
info.method_count, info.op_region_count));

return_ACPI_STATUS(AE_OK);
}
Loading

0 comments on commit 0847690

Please sign in to comment.