Skip to content

Commit c172cb7

Browse files
committed
Merge branch 'acpica-gpe' into release
2 parents e8eb622 + 28f4f8a commit c172cb7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+570
-934
lines changed

drivers/acpi/acpica/acevents.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,13 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node *node,
7878
u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list);
7979

8080
acpi_status
81-
acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info);
81+
acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info);
82+
83+
acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info);
84+
85+
acpi_status acpi_raw_enable_gpe(struct acpi_gpe_event_info *gpe_event_info);
86+
87+
acpi_status acpi_raw_disable_gpe(struct acpi_gpe_event_info *gpe_event_info);
8288

8389
struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
8490
u32 gpe_number);

drivers/acpi/acpica/acglobal.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,6 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE);
9999
*/
100100
u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE);
101101

102-
/*
103-
* Disable wakeup GPEs during runtime? Default is TRUE because WAKE and
104-
* RUNTIME GPEs should never be shared, and WAKE GPEs should typically only
105-
* be enabled just before going to sleep.
106-
*/
107-
u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);
108-
109102
/*
110103
* Optionally use default values for the ACPI register widths. Set this to
111104
* TRUE to use the defaults, if an FADT contains incorrect widths/lengths.

drivers/acpi/acpica/achware.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,12 @@ acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width);
9090
/*
9191
* hwgpe - GPE support
9292
*/
93-
u32 acpi_hw_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info,
93+
u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info,
9494
struct acpi_gpe_register_info *gpe_register_info);
9595

9696
acpi_status
9797
acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 action);
9898

99-
acpi_status
100-
acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info);
101-
10299
acpi_status
103100
acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
104101
struct acpi_gpe_block_info *gpe_block, void *context);

drivers/acpi/acpica/aclocal.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ struct acpi_namespace_node {
184184
u8 flags; /* Miscellaneous flags */
185185
acpi_owner_id owner_id; /* Node creator */
186186
union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
187+
struct acpi_namespace_node *parent; /* Parent node */
187188
struct acpi_namespace_node *child; /* First child */
188-
struct acpi_namespace_node *peer; /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */
189+
struct acpi_namespace_node *peer; /* First peer */
189190

190191
/*
191192
* The following fields are used by the ASL compiler and disassembler only
@@ -199,7 +200,7 @@ struct acpi_namespace_node {
199200

200201
/* Namespace Node flags */
201202

202-
#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */
203+
#define ANOBJ_RESERVED 0x01 /* Available for use */
203204
#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */
204205
#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
205206
#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
@@ -411,6 +412,7 @@ struct acpi_handler_info {
411412
acpi_event_handler address; /* Address of handler, if any */
412413
void *context; /* Context to be passed to handler */
413414
struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */
415+
u8 orig_flags; /* Original misc info about this GPE */
414416
};
415417

416418
union acpi_gpe_dispatch_info {
@@ -428,7 +430,6 @@ struct acpi_gpe_event_info {
428430
u8 flags; /* Misc info about this GPE */
429431
u8 gpe_number; /* This GPE */
430432
u8 runtime_count; /* References to a run GPE */
431-
u8 wakeup_count; /* References to a wake GPE */
432433
};
433434

434435
/* Information about a GPE register pair, one per each status/enable pair in an array */

drivers/acpi/acpica/acnamesp.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,4 @@ struct acpi_namespace_node *acpi_ns_validate_handle(acpi_handle handle);
369369

370370
void acpi_ns_terminate(void);
371371

372-
struct acpi_namespace_node *acpi_ns_get_parent_node(struct acpi_namespace_node
373-
*node);
374-
375-
struct acpi_namespace_node *acpi_ns_get_next_valid_node(struct
376-
acpi_namespace_node
377-
*node);
378-
379372
#endif /* __ACNAMESP_H__ */

drivers/acpi/acpica/acobject.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@
9191

9292
/* Values for Flag byte above */
9393

94-
#define AOPOBJ_AML_CONSTANT 0x01
95-
#define AOPOBJ_STATIC_POINTER 0x02
96-
#define AOPOBJ_DATA_VALID 0x04
97-
#define AOPOBJ_OBJECT_INITIALIZED 0x08
98-
#define AOPOBJ_SETUP_COMPLETE 0x10
99-
#define AOPOBJ_SINGLE_DATUM 0x20
100-
#define AOPOBJ_INVALID 0x40 /* Used if host OS won't allow an op_region address */
101-
#define AOPOBJ_MODULE_LEVEL 0x80
94+
#define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */
95+
#define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */
96+
#define AOPOBJ_DATA_VALID 0x04 /* Object is intialized and data is valid */
97+
#define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */
98+
#define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */
99+
#define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */
100+
#define AOPOBJ_MODULE_LEVEL 0x40 /* Method is actually module-level code */
101+
#define AOPOBJ_MODIFIED_NAMESPACE 0x80 /* Method modified the namespace */
102102

103103
/******************************************************************************
104104
*

drivers/acpi/acpica/acpredef.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,15 +503,16 @@ static const union acpi_predefined_info predefined_names[] =
503503
{{"_WAK", 1, ACPI_RTYPE_NONE | ACPI_RTYPE_INTEGER | ACPI_RTYPE_PACKAGE}},
504504
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2,0}, 0,0}}, /* Fixed-length (2 Int), but is optional */
505505

506-
{{{0,0,0,0}, 0,0}} /* Table terminator */
507-
};
506+
/* _WDG/_WED are MS extensions defined by "Windows Instrumentation" */
508507

509-
#if 0
510-
/* Not implemented */
508+
{{"_WDG", 0, ACPI_RTYPE_BUFFER}},
509+
{{"_WED", 1,
510+
ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER}},
511511

512-
{{"_WDG", 0, ACPI_RTYPE_BUFFER}}, /* MS Extension */
513-
{{"_WED", 1, ACPI_RTYPE_PACKAGE}}, /* MS Extension */
512+
{{{0, 0, 0, 0}, 0, 0}} /* Table terminator */
513+
};
514514

515+
#if 0
515516
/* This is an internally implemented control method, no need to check */
516517
{{"_OSI", 1, ACPI_RTYPE_INTEGER}},
517518

drivers/acpi/acpica/acstruct.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,22 @@ struct acpi_walk_state {
127127
acpi_parse_upwards ascending_callback;
128128
};
129129

130-
/* Info used by acpi_ps_init_objects */
130+
/* Info used by acpi_ns_initialize_objects and acpi_ds_initialize_objects */
131131

132132
struct acpi_init_walk_info {
133-
u16 method_count;
134-
u16 device_count;
135-
u16 op_region_count;
136-
u16 field_count;
137-
u16 buffer_count;
138-
u16 package_count;
139-
u16 op_region_init;
140-
u16 field_init;
141-
u16 buffer_init;
142-
u16 package_init;
143-
u16 object_count;
144-
acpi_owner_id owner_id;
145133
u32 table_index;
134+
u32 object_count;
135+
u32 method_count;
136+
u32 device_count;
137+
u32 op_region_count;
138+
u32 field_count;
139+
u32 buffer_count;
140+
u32 package_count;
141+
u32 op_region_init;
142+
u32 field_init;
143+
u32 buffer_init;
144+
u32 package_init;
145+
acpi_owner_id owner_id;
146146
};
147147

148148
struct acpi_get_devices_info {
@@ -201,11 +201,11 @@ struct acpi_evaluate_info {
201201
/* Info used by acpi_ns_initialize_devices */
202202

203203
struct acpi_device_walk_info {
204-
u16 device_count;
205-
u16 num_STA;
206-
u16 num_INI;
207204
struct acpi_table_desc *table_desc;
208205
struct acpi_evaluate_info *evaluate_info;
206+
u32 device_count;
207+
u32 num_STA;
208+
u32 num_INI;
209209
};
210210

211211
/* TBD: [Restructure] Merge with struct above */

drivers/acpi/acpica/dsinit.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ acpi_ds_initialize_objects(u32 table_index,
171171
"**** Starting initialization of namespace objects ****\n"));
172172
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "Parsing all Control Methods:"));
173173

174-
info.method_count = 0;
175-
info.op_region_count = 0;
176-
info.object_count = 0;
177-
info.device_count = 0;
178-
info.table_index = table_index;
174+
/* Set all init info to zero */
175+
176+
ACPI_MEMSET(&info, 0, sizeof(struct acpi_init_walk_info));
177+
179178
info.owner_id = owner_id;
179+
info.table_index = table_index;
180180

181181
/* Walk entire namespace from the supplied root */
182182

@@ -204,13 +204,13 @@ acpi_ds_initialize_objects(u32 table_index,
204204
}
205205

206206
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
207-
"\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
207+
"\nTable [%4.4s](id %4.4X) - %u Objects with %u Devices %u Methods %u Regions\n",
208208
table->signature, owner_id, info.object_count,
209209
info.device_count, info.method_count,
210210
info.op_region_count));
211211

212212
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
213-
"%hd Methods, %hd Regions\n", info.method_count,
213+
"%u Methods, %u Regions\n", info.method_count,
214214
info.op_region_count));
215215

216216
return_ACPI_STATUS(AE_OK);

drivers/acpi/acpica/dsmethod.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,22 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
584584
* want make the objects permanent.
585585
*/
586586
if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) {
587-
acpi_ns_delete_namespace_by_owner(method_desc->method.
588-
owner_id);
587+
588+
/* Delete any direct children of (created by) this method */
589+
590+
acpi_ns_delete_namespace_subtree(walk_state->
591+
method_node);
592+
593+
/*
594+
* Delete any objects that were created by this method
595+
* elsewhere in the namespace (if any were created).
596+
*/
597+
if (method_desc->method.
598+
flags & AOPOBJ_MODIFIED_NAMESPACE) {
599+
acpi_ns_delete_namespace_by_owner(method_desc->
600+
method.
601+
owner_id);
602+
}
589603
}
590604
}
591605

@@ -605,7 +619,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
605619
* we immediately reuse it for the next thread executing this method
606620
*/
607621
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
608-
"*** Completed execution of one thread, %d threads remaining\n",
622+
"*** Completed execution of one thread, %u threads remaining\n",
609623
method_desc->method.thread_count));
610624
} else {
611625
/* This is the only executing thread for this method */

drivers/acpi/acpica/dsmthdat.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state)
102102
walk_state->arguments[i].name.integer |= (i << 24);
103103
walk_state->arguments[i].descriptor_type = ACPI_DESC_TYPE_NAMED;
104104
walk_state->arguments[i].type = ACPI_TYPE_ANY;
105-
walk_state->arguments[i].flags =
106-
ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_ARG;
105+
walk_state->arguments[i].flags = ANOBJ_METHOD_ARG;
107106
}
108107

109108
/* Init the method locals */
@@ -116,8 +115,7 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state)
116115
walk_state->local_variables[i].descriptor_type =
117116
ACPI_DESC_TYPE_NAMED;
118117
walk_state->local_variables[i].type = ACPI_TYPE_ANY;
119-
walk_state->local_variables[i].flags =
120-
ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_LOCAL;
118+
walk_state->local_variables[i].flags = ANOBJ_METHOD_LOCAL;
121119
}
122120

123121
return_VOID;
@@ -146,7 +144,7 @@ void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state)
146144

147145
for (index = 0; index < ACPI_METHOD_NUM_LOCALS; index++) {
148146
if (walk_state->local_variables[index].object) {
149-
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Deleting Local%d=%p\n",
147+
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Deleting Local%u=%p\n",
150148
index,
151149
walk_state->local_variables[index].
152150
object));
@@ -162,7 +160,7 @@ void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state)
162160

163161
for (index = 0; index < ACPI_METHOD_NUM_ARGS; index++) {
164162
if (walk_state->arguments[index].object) {
165-
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Deleting Arg%d=%p\n",
163+
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Deleting Arg%u=%p\n",
166164
index,
167165
walk_state->arguments[index].object));
168166

@@ -226,7 +224,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
226224
index++;
227225
}
228226

229-
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%d args passed to method\n", index));
227+
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%u args passed to method\n", index));
230228
return_ACPI_STATUS(AE_OK);
231229
}
232230

@@ -323,7 +321,7 @@ acpi_ds_method_data_set_value(u8 type,
323321
ACPI_FUNCTION_TRACE(ds_method_data_set_value);
324322

325323
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
326-
"NewObj %p Type %2.2X, Refs=%d [%s]\n", object,
324+
"NewObj %p Type %2.2X, Refs=%u [%s]\n", object,
327325
type, object->common.reference_count,
328326
acpi_ut_get_type_name(object->common.type)));
329327

@@ -543,7 +541,7 @@ acpi_ds_store_object_to_local(u8 type,
543541
union acpi_operand_object *new_obj_desc;
544542

545543
ACPI_FUNCTION_TRACE(ds_store_object_to_local);
546-
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Type=%2.2X Index=%d Obj=%p\n",
544+
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Type=%2.2X Index=%u Obj=%p\n",
547545
type, index, obj_desc));
548546

549547
/* Parameter validation */

drivers/acpi/acpica/dsobject.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
8181
{
8282
union acpi_operand_object *obj_desc;
8383
acpi_status status;
84+
acpi_object_type type;
8485

8586
ACPI_FUNCTION_TRACE(ds_build_internal_object);
8687

@@ -172,7 +173,20 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
172173
return_ACPI_STATUS(status);
173174
}
174175

175-
switch (op->common.node->type) {
176+
/*
177+
* Special handling for Alias objects. We need to setup the type
178+
* and the Op->Common.Node to point to the Alias target. Note,
179+
* Alias has at most one level of indirection internally.
180+
*/
181+
type = op->common.node->type;
182+
if (type == ACPI_TYPE_LOCAL_ALIAS) {
183+
type = obj_desc->common.type;
184+
op->common.node =
185+
ACPI_CAST_PTR(struct acpi_namespace_node,
186+
op->common.node->object);
187+
}
188+
189+
switch (type) {
176190
/*
177191
* For these types, we need the actual node, not the subobject.
178192
* However, the subobject did not get an extra reference count above.

drivers/acpi/acpica/dsopcode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc)
213213

214214
/* Execute the AML code for the term_arg arguments */
215215

216-
status = acpi_ds_execute_arguments(node, acpi_ns_get_parent_node(node),
216+
status = acpi_ds_execute_arguments(node, node->parent,
217217
extra_desc->extra.aml_length,
218218
extra_desc->extra.aml_start);
219219
return_ACPI_STATUS(status);
@@ -257,7 +257,7 @@ acpi_ds_get_bank_field_arguments(union acpi_operand_object *obj_desc)
257257

258258
/* Execute the AML code for the term_arg arguments */
259259

260-
status = acpi_ds_execute_arguments(node, acpi_ns_get_parent_node(node),
260+
status = acpi_ds_execute_arguments(node, node->parent,
261261
extra_desc->extra.aml_length,
262262
extra_desc->extra.aml_start);
263263
return_ACPI_STATUS(status);
@@ -394,7 +394,7 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc)
394394

395395
/* Execute the argument AML */
396396

397-
status = acpi_ds_execute_arguments(node, acpi_ns_get_parent_node(node),
397+
status = acpi_ds_execute_arguments(node, node->parent,
398398
extra_desc->extra.aml_length,
399399
extra_desc->extra.aml_start);
400400
if (ACPI_FAILURE(status)) {

drivers/acpi/acpica/dsutils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
746746
index--;
747747

748748
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
749-
"Arg #%d (%p) done, Arg1=%p\n", index, arg,
749+
"Arg #%u (%p) done, Arg1=%p\n", index, arg,
750750
first_arg));
751751
}
752752

@@ -760,7 +760,7 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
760760
*/
761761
acpi_ds_obj_stack_pop_and_delete(arg_count, walk_state);
762762

763-
ACPI_EXCEPTION((AE_INFO, status, "While creating Arg %d", index));
763+
ACPI_EXCEPTION((AE_INFO, status, "While creating Arg %u", index));
764764
return_ACPI_STATUS(status);
765765
}
766766

0 commit comments

Comments
 (0)