linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ACPICA branch
@ 2008-04-12  4:24 Len Brown
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi

Back, by popular demand, after too long a delay...
is a an "acpica" branch in the linux-acpi git tree.

git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git acpica

This is where the ACPICA core interpreter update to Linux
shall live until it is regression free and ready to
merge into the acpi test branch (and mm).

There are some known issues with the series,
and we'll discuss those issues on the list.

But for now, to set the baseline, here is a patch bomb
showing the current contents of the series.
Thanks to Lin-Ming and Bob Moore for developing most
of the patches, and thanks to Alexey Starikovskiy
for helping merge them up to the latest tree.

-Len



^ permalink raw reply	[flat|nested] 123+ messages in thread

* [PATCH 01/73] ACPICA: Several fixes for internal method result stack
  2008-04-12  4:24 ACPICA branch Len Brown
@ 2008-04-12  4:24 ` Len Brown
  2008-04-12  4:24   ` [PATCH 02/73] ACPICA: Removed unused code Len Brown
                     ` (71 more replies)
  2008-04-12  4:41 ` ACPICA branch - first try Core revision 20080321 Len Brown
  2008-04-29  9:04 ` ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions) Len Brown
  2 siblings, 72 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

fixes STACK_OVERFLOW exception on nested method calls. internal
bugzilla 262 and 275.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsopcode.c |    9 +-
 drivers/acpi/dispatcher/dsutils.c  |   52 +++-
 drivers/acpi/dispatcher/dswexec.c  |   43 +---
 drivers/acpi/dispatcher/dswstate.c |  513 ++++++++----------------------------
 drivers/acpi/parser/psloop.c       |   11 -
 drivers/acpi/parser/psparse.c      |   15 +-
 include/acpi/acconfig.h            |   13 +-
 include/acpi/acdispat.h            |   16 +-
 include/acpi/aclocal.h             |    5 +-
 include/acpi/acstruct.h            |    3 +
 10 files changed, 179 insertions(+), 501 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
index f501e08..0c4630d 100644
--- a/drivers/acpi/dispatcher/dsopcode.c
+++ b/drivers/acpi/dispatcher/dsopcode.c
@@ -808,6 +808,12 @@ acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state,
 
 	/* The first operand (for all of these data objects) is the length */
 
+	/*
+	 * Set proper index into operand stack for acpi_ds_obj_stack_push
+	 * invoked inside acpi_ds_create_operand.
+	 */
+	walk_state->operand_index = walk_state->num_operands;
+
 	status = acpi_ds_create_operand(walk_state, op->common.value.arg, 1);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
@@ -1070,8 +1076,7 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
 			 * is set to anything other than zero!
 			 */
 			walk_state->return_desc = walk_state->operands[0];
-		} else if ((walk_state->results) &&
-			   (walk_state->results->results.num_results > 0)) {
+		} else if (walk_state->result_count) {
 
 			/* Since we have a real Return(), delete any implicit return */
 
diff --git a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c
index 71503c0..d2a8cfd 100644
--- a/drivers/acpi/dispatcher/dsutils.c
+++ b/drivers/acpi/dispatcher/dsutils.c
@@ -630,9 +630,7 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
 			 * Use value that was already previously returned
 			 * by the evaluation of this argument
 			 */
-			status =
-			    acpi_ds_result_pop_from_bottom(&obj_desc,
-							   walk_state);
+			status = acpi_ds_result_pop(&obj_desc, walk_state);
 			if (ACPI_FAILURE(status)) {
 				/*
 				 * Only error is underflow, and this indicates
@@ -698,27 +696,54 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
 {
 	acpi_status status = AE_OK;
 	union acpi_parse_object *arg;
-	u32 arg_count = 0;
+	union acpi_parse_object *arguments[ACPI_OBJ_NUM_OPERANDS];
+	u8 arg_count = 0;
+	u8 count = 0;
+	u8 index = walk_state->num_operands;
+	u8 i;
 
 	ACPI_FUNCTION_TRACE_PTR(ds_create_operands, first_arg);
 
-	/* For all arguments in the list... */
+	/* Get all arguments in the list */
 
 	arg = first_arg;
 	while (arg) {
-		status = acpi_ds_create_operand(walk_state, arg, arg_count);
-		if (ACPI_FAILURE(status)) {
-			goto cleanup;
+		if (index >= ACPI_OBJ_NUM_OPERANDS) {
+			return_ACPI_STATUS(AE_BAD_DATA);
 		}
 
-		ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
-				  "Arg #%d (%p) done, Arg1=%p\n", arg_count,
-				  arg, first_arg));
+		arguments[index] = arg;
+		walk_state->operands[index] = NULL;
 
 		/* Move on to next argument, if any */
 
 		arg = arg->common.next;
 		arg_count++;
+		index++;
+	}
+
+	index--;
+
+	/* It is the appropriate order to get objects from the Result stack */
+
+	for (i = 0; i < arg_count; i++) {
+		arg = arguments[index];
+
+		/* Force the filling of the operand stack in inverse order */
+
+		walk_state->operand_index = index;
+
+		status = acpi_ds_create_operand(walk_state, arg, index);
+		if (ACPI_FAILURE(status)) {
+			goto cleanup;
+		}
+
+		count++;
+		index--;
+
+		ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
+				  "Arg #%d (%p) done, Arg1=%p\n", index, arg,
+				  first_arg));
 	}
 
 	return_ACPI_STATUS(status);
@@ -729,9 +754,8 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
 	 * pop everything off of the operand stack and delete those
 	 * objects
 	 */
-	(void)acpi_ds_obj_stack_pop_and_delete(arg_count, walk_state);
+	acpi_ds_obj_stack_pop_and_delete(arg_count, walk_state);
 
-	ACPI_EXCEPTION((AE_INFO, status, "While creating Arg %d",
-			(arg_count + 1)));
+	ACPI_EXCEPTION((AE_INFO, status, "While creating Arg %d", index));
 	return_ACPI_STATUS(status);
 }
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index 69693fa..12b1485 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -285,11 +285,6 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
 	switch (opcode_class) {
 	case AML_CLASS_CONTROL:
 
-		status = acpi_ds_result_stack_push(walk_state);
-		if (ACPI_FAILURE(status)) {
-			goto error_exit;
-		}
-
 		status = acpi_ds_exec_begin_control_op(walk_state, op);
 		break;
 
@@ -305,20 +300,11 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
 			status = acpi_ds_load2_begin_op(walk_state, NULL);
 		}
 
-		if (op->common.aml_opcode == AML_REGION_OP) {
-			status = acpi_ds_result_stack_push(walk_state);
-		}
 		break;
 
 	case AML_CLASS_EXECUTE:
 	case AML_CLASS_CREATE:
-		/*
-		 * Most operators with arguments (except create_xxx_field operators)
-		 * Start a new result/operand state
-		 */
-		if (walk_state->op_info->object_type != ACPI_TYPE_BUFFER_FIELD) {
-			status = acpi_ds_result_stack_push(walk_state);
-		}
+
 		break;
 
 	default:
@@ -374,6 +360,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 	/* Init the walk state */
 
 	walk_state->num_operands = 0;
+	walk_state->operand_index = 0;
 	walk_state->return_desc = NULL;
 	walk_state->result_obj = NULL;
 
@@ -400,13 +387,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 			goto cleanup;
 		}
 
-		/* Done with this result state (Now that operand stack is built) */
-
-		status = acpi_ds_result_stack_pop(walk_state);
-		if (ACPI_FAILURE(status)) {
-			goto cleanup;
-		}
-
 		/*
 		 * All opcodes require operand resolution, with the only exceptions
 		 * being the object_type and size_of operators.
@@ -487,16 +467,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 
 			status = acpi_ds_exec_end_control_op(walk_state, op);
 
-			/* Make sure to properly pop the result stack */
-
-			if (ACPI_SUCCESS(status)) {
-				status = acpi_ds_result_stack_pop(walk_state);
-			} else if (status == AE_CTRL_PENDING) {
-				status = acpi_ds_result_stack_pop(walk_state);
-				if (ACPI_SUCCESS(status)) {
-					status = AE_CTRL_PENDING;
-				}
-			}
 			break;
 
 		case AML_TYPE_METHOD_CALL:
@@ -632,13 +602,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 				break;
 			}
 
-			/* Done with result state (Now that operand stack is built) */
-
-			status = acpi_ds_result_stack_pop(walk_state);
-			if (ACPI_FAILURE(status)) {
-				goto cleanup;
-			}
-
 			/*
 			 * If a result object was returned from above, push it on the
 			 * current result stack
@@ -671,8 +634,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 				if (ACPI_FAILURE(status)) {
 					break;
 				}
-
-				status = acpi_ds_result_stack_pop(walk_state);
 			}
 			break;
 
diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c
index 5afcdd9..698d2e1 100644
--- a/drivers/acpi/dispatcher/dswstate.c
+++ b/drivers/acpi/dispatcher/dswstate.c
@@ -49,85 +49,9 @@
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dswstate")
 
-/* Local prototypes */
-#ifdef ACPI_OBSOLETE_FUNCTIONS
-acpi_status
-acpi_ds_result_insert(void *object,
-		      u32 index, struct acpi_walk_state *walk_state);
-
-acpi_status acpi_ds_obj_stack_delete_all(struct acpi_walk_state *walk_state);
-
-acpi_status
-acpi_ds_obj_stack_pop_object(union acpi_operand_object **object,
-			     struct acpi_walk_state *walk_state);
-
-void *acpi_ds_obj_stack_get_value(u32 index,
-				  struct acpi_walk_state *walk_state);
-#endif
-
-#ifdef ACPI_FUTURE_USAGE
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ds_result_remove
- *
- * PARAMETERS:  Object              - Where to return the popped object
- *              Index               - Where to extract the object
- *              walk_state          - Current Walk state
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Pop an object off the bottom of this walk's result stack.  In
- *              other words, this is a FIFO.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ds_result_remove(union acpi_operand_object **object,
-		      u32 index, struct acpi_walk_state *walk_state)
-{
-	union acpi_generic_state *state;
-
-	ACPI_FUNCTION_NAME(ds_result_remove);
-
-	state = walk_state->results;
-	if (!state) {
-		ACPI_ERROR((AE_INFO, "No result object pushed! State=%p",
-			    walk_state));
-		return (AE_NOT_EXIST);
-	}
-
-	if (index >= ACPI_OBJ_MAX_OPERAND) {
-		ACPI_ERROR((AE_INFO,
-			    "Index out of range: %X State=%p Num=%X",
-			    index, walk_state, state->results.num_results));
-	}
-
-	/* Check for a valid result object */
-
-	if (!state->results.obj_desc[index]) {
-		ACPI_ERROR((AE_INFO,
-			    "Null operand! State=%p #Ops=%X, Index=%X",
-			    walk_state, state->results.num_results, index));
-		return (AE_AML_NO_RETURN_VALUE);
-	}
-
-	/* Remove the object */
-
-	state->results.num_results--;
-
-	*object = state->results.obj_desc[index];
-	state->results.obj_desc[index] = NULL;
-
-	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-			  "Obj=%p [%s] Index=%X State=%p Num=%X\n",
-			  *object,
-			  (*object) ? acpi_ut_get_object_type_name(*object) :
-			  "NULL", index, walk_state,
-			  state->results.num_results));
-
-	return (AE_OK);
-}
-#endif				/*  ACPI_FUTURE_USAGE  */
+  /* Local prototypes */
+static acpi_status acpi_ds_result_stack_push(struct acpi_walk_state *ws);
+static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *ws);
 
 /*******************************************************************************
  *
@@ -138,122 +62,67 @@ acpi_ds_result_remove(union acpi_operand_object **object,
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Pop an object off the bottom of this walk's result stack.  In
- *              other words, this is a FIFO.
+ * DESCRIPTION: Pop an object off the top of this walk's result stack
  *
  ******************************************************************************/
 
 acpi_status
-acpi_ds_result_pop(union acpi_operand_object ** object,
-		   struct acpi_walk_state * walk_state)
+acpi_ds_result_pop(union acpi_operand_object **object,
+		   struct acpi_walk_state *walk_state)
 {
 	acpi_native_uint index;
 	union acpi_generic_state *state;
+	acpi_status status;
 
 	ACPI_FUNCTION_NAME(ds_result_pop);
 
 	state = walk_state->results;
-	if (!state) {
-		return (AE_OK);
-	}
-
-	if (!state->results.num_results) {
-		ACPI_ERROR((AE_INFO, "Result stack is empty! State=%p",
-			    walk_state));
-		return (AE_AML_NO_RETURN_VALUE);
-	}
 
-	/* Remove top element */
+	/* Incorrect state of result stack */
 
-	state->results.num_results--;
-
-	for (index = ACPI_OBJ_NUM_OPERANDS; index; index--) {
-
-		/* Check for a valid result object */
-
-		if (state->results.obj_desc[index - 1]) {
-			*object = state->results.obj_desc[index - 1];
-			state->results.obj_desc[index - 1] = NULL;
-
-			ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-					  "Obj=%p [%s] Index=%X State=%p Num=%X\n",
-					  *object,
-					  (*object) ?
-					  acpi_ut_get_object_type_name(*object)
-					  : "NULL", (u32) index - 1, walk_state,
-					  state->results.num_results));
-
-			return (AE_OK);
-		}
+	if (state && !walk_state->result_count) {
+		ACPI_ERROR((AE_INFO, "No results on result stack"));
+		return (AE_AML_INTERNAL);
 	}
 
-	ACPI_ERROR((AE_INFO, "No result objects! State=%p", walk_state));
-	return (AE_AML_NO_RETURN_VALUE);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ds_result_pop_from_bottom
- *
- * PARAMETERS:  Object              - Where to return the popped object
- *              walk_state          - Current Walk state
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Pop an object off the bottom of this walk's result stack.  In
- *              other words, this is a FIFO.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ds_result_pop_from_bottom(union acpi_operand_object ** object,
-			       struct acpi_walk_state * walk_state)
-{
-	acpi_native_uint index;
-	union acpi_generic_state *state;
+	if (!state && walk_state->result_count) {
+		ACPI_ERROR((AE_INFO, "No result state for result stack"));
+		return (AE_AML_INTERNAL);
+	}
 
-	ACPI_FUNCTION_NAME(ds_result_pop_from_bottom);
+	/* Empty result stack */
 
-	state = walk_state->results;
 	if (!state) {
-		ACPI_ERROR((AE_INFO,
-			    "No result object pushed! State=%p", walk_state));
-		return (AE_NOT_EXIST);
-	}
-
-	if (!state->results.num_results) {
-		ACPI_ERROR((AE_INFO, "No result objects! State=%p",
+		ACPI_ERROR((AE_INFO, "Result stack is empty! State=%p",
 			    walk_state));
 		return (AE_AML_NO_RETURN_VALUE);
 	}
 
-	/* Remove Bottom element */
-
-	*object = state->results.obj_desc[0];
-
-	/* Push entire stack down one element */
-
-	for (index = 0; index < state->results.num_results; index++) {
-		state->results.obj_desc[index] =
-		    state->results.obj_desc[index + 1];
-	}
+	/* Return object of the top element and clean that top element result stack */
 
-	state->results.num_results--;
-
-	/* Check for a valid result object */
+	walk_state->result_count--;
+	index = walk_state->result_count % ACPI_RESULTS_FRAME_OBJ_NUM;
 
+	*object = state->results.obj_desc[index];
 	if (!*object) {
 		ACPI_ERROR((AE_INFO,
-			    "Null operand! State=%p #Ops=%X Index=%X",
-			    walk_state, state->results.num_results,
-			    (u32) index));
+			    "No result objects on result stack, State=%p",
+			    walk_state));
 		return (AE_AML_NO_RETURN_VALUE);
 	}
 
-	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Obj=%p [%s] Results=%p State=%p\n",
-			  *object,
-			  (*object) ? acpi_ut_get_object_type_name(*object) :
-			  "NULL", state, walk_state));
+	state->results.obj_desc[index] = NULL;
+	if (index == 0) {
+		status = acpi_ds_result_stack_pop(walk_state);
+		if (ACPI_FAILURE(status)) {
+			return (status);
+		}
+	}
+
+	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+			  "Obj=%p [%s] Index=%X State=%p Num=%X\n", *object,
+			  acpi_ut_get_object_type_name(*object),
+			  (u32) index, walk_state, walk_state->result_count));
 
 	return (AE_OK);
 }
@@ -276,39 +145,56 @@ acpi_ds_result_push(union acpi_operand_object * object,
 		    struct acpi_walk_state * walk_state)
 {
 	union acpi_generic_state *state;
+	acpi_status status;
+	acpi_native_uint index;
 
 	ACPI_FUNCTION_NAME(ds_result_push);
 
+	if (walk_state->result_count > walk_state->result_size) {
+		ACPI_ERROR((AE_INFO, "Result stack is full"));
+		return (AE_AML_INTERNAL);
+	} else if (walk_state->result_count == walk_state->result_size) {
+
+		/* Extend the result stack */
+
+		status = acpi_ds_result_stack_push(walk_state);
+		if (ACPI_FAILURE(status)) {
+			ACPI_ERROR((AE_INFO,
+				    "Failed to extend the result stack"));
+			return (status);
+		}
+	}
+
+	if (!(walk_state->result_count < walk_state->result_size)) {
+		ACPI_ERROR((AE_INFO, "No free elements in result stack"));
+		return (AE_AML_INTERNAL);
+	}
+
 	state = walk_state->results;
 	if (!state) {
 		ACPI_ERROR((AE_INFO, "No result stack frame during push"));
 		return (AE_AML_INTERNAL);
 	}
 
-	if (state->results.num_results == ACPI_OBJ_NUM_OPERANDS) {
-		ACPI_ERROR((AE_INFO,
-			    "Result stack overflow: Obj=%p State=%p Num=%X",
-			    object, walk_state, state->results.num_results));
-		return (AE_STACK_OVERFLOW);
-	}
-
 	if (!object) {
 		ACPI_ERROR((AE_INFO,
 			    "Null Object! Obj=%p State=%p Num=%X",
-			    object, walk_state, state->results.num_results));
+			    object, walk_state, walk_state->result_count));
 		return (AE_BAD_PARAMETER);
 	}
 
-	state->results.obj_desc[state->results.num_results] = object;
-	state->results.num_results++;
+	/* Assign the address of object to the top free element of result stack */
+
+	index = walk_state->result_count % ACPI_RESULTS_FRAME_OBJ_NUM;
+	state->results.obj_desc[index] = object;
+	walk_state->result_count++;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Obj=%p [%s] State=%p Num=%X Cur=%X\n",
 			  object,
-			  object ?
 			  acpi_ut_get_object_type_name((union
 							acpi_operand_object *)
-						       object) : "NULL",
-			  walk_state, state->results.num_results,
+						       object), walk_state,
+			  walk_state->result_count,
 			  walk_state->current_result));
 
 	return (AE_OK);
@@ -322,16 +208,25 @@ acpi_ds_result_push(union acpi_operand_object * object,
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Push an object onto the walk_state result stack.
+ * DESCRIPTION: Push an object onto the walk_state result stack
  *
  ******************************************************************************/
 
-acpi_status acpi_ds_result_stack_push(struct acpi_walk_state * walk_state)
+static acpi_status acpi_ds_result_stack_push(struct acpi_walk_state *walk_state)
 {
 	union acpi_generic_state *state;
 
 	ACPI_FUNCTION_NAME(ds_result_stack_push);
 
+	/* Check for stack overflow */
+
+	if ((walk_state->result_size + ACPI_RESULTS_FRAME_OBJ_NUM) >
+	    ACPI_RESULTS_OBJ_NUM_MAX) {
+		ACPI_ERROR((AE_INFO, "Result stack overflow: State=%p Num=%X",
+			    walk_state, walk_state->result_size));
+		return (AE_STACK_OVERFLOW);
+	}
+
 	state = acpi_ut_create_generic_state();
 	if (!state) {
 		return (AE_NO_MEMORY);
@@ -340,6 +235,10 @@ acpi_status acpi_ds_result_stack_push(struct acpi_walk_state * walk_state)
 	state->common.descriptor_type = ACPI_DESC_TYPE_STATE_RESULT;
 	acpi_ut_push_generic_state(&walk_state->results, state);
 
+	/* Increase the length of the result stack by the length of frame */
+
+	walk_state->result_size += ACPI_RESULTS_FRAME_OBJ_NUM;
+
 	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Results=%p State=%p\n",
 			  state, walk_state));
 
@@ -354,11 +253,11 @@ acpi_status acpi_ds_result_stack_push(struct acpi_walk_state * walk_state)
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Pop an object off of the walk_state result stack.
+ * DESCRIPTION: Pop an object off of the walk_state result stack
  *
  ******************************************************************************/
 
-acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state * walk_state)
+static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state)
 {
 	union acpi_generic_state *state;
 
@@ -367,18 +266,27 @@ acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state * walk_state)
 	/* Check for stack underflow */
 
 	if (walk_state->results == NULL) {
-		ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Underflow - State=%p\n",
+		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+				  "Result stack underflow - State=%p\n",
 				  walk_state));
 		return (AE_AML_NO_OPERAND);
 	}
 
+	if (walk_state->result_size < ACPI_RESULTS_FRAME_OBJ_NUM) {
+		ACPI_ERROR((AE_INFO, "Insufficient result stack size"));
+		return (AE_AML_INTERNAL);
+	}
+
 	state = acpi_ut_pop_generic_state(&walk_state->results);
+	acpi_ut_delete_generic_state(state);
+
+	/* Decrease the length of result stack by the length of frame */
+
+	walk_state->result_size -= ACPI_RESULTS_FRAME_OBJ_NUM;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
 			  "Result=%p RemainingResults=%X State=%p\n",
-			  state, state->results.num_results, walk_state));
-
-	acpi_ut_delete_generic_state(state);
+			  state, walk_state->result_count, walk_state));
 
 	return (AE_OK);
 }
@@ -412,9 +320,13 @@ acpi_ds_obj_stack_push(void *object, struct acpi_walk_state * walk_state)
 
 	/* Put the object onto the stack */
 
-	walk_state->operands[walk_state->num_operands] = object;
+	walk_state->operands[walk_state->operand_index] = object;
 	walk_state->num_operands++;
 
+	/* For the usual order of filling the operand stack */
+
+	walk_state->operand_index++;
+
 	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Obj=%p [%s] State=%p #Ops=%X\n",
 			  object,
 			  acpi_ut_get_object_type_name((union
@@ -484,43 +396,36 @@ acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state * walk_state)
  *
  ******************************************************************************/
 
-acpi_status
+void
 acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
-				 struct acpi_walk_state * walk_state)
+				 struct acpi_walk_state *walk_state)
 {
 	u32 i;
 	union acpi_operand_object *obj_desc;
 
 	ACPI_FUNCTION_NAME(ds_obj_stack_pop_and_delete);
 
-	for (i = 0; i < pop_count; i++) {
-
-		/* Check for stack underflow */
+	if (pop_count == 0) {
+		return;
+	}
 
+	for (i = (pop_count - 1); i >= 0; i--) {
 		if (walk_state->num_operands == 0) {
-			ACPI_ERROR((AE_INFO,
-				    "Object stack underflow! Count=%X State=%p #Ops=%X",
-				    pop_count, walk_state,
-				    walk_state->num_operands));
-			return (AE_STACK_UNDERFLOW);
+			return;
 		}
 
 		/* Pop the stack and delete an object if present in this stack entry */
 
 		walk_state->num_operands--;
-		obj_desc = walk_state->operands[walk_state->num_operands];
+		obj_desc = walk_state->operands[i];
 		if (obj_desc) {
-			acpi_ut_remove_reference(walk_state->
-						 operands[walk_state->
-							  num_operands]);
-			walk_state->operands[walk_state->num_operands] = NULL;
+			acpi_ut_remove_reference(walk_state->operands[i]);
+			walk_state->operands[i] = NULL;
 		}
 	}
 
 	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n",
 			  pop_count, walk_state, walk_state->num_operands));
-
-	return (AE_OK);
 }
 
 /*******************************************************************************
@@ -560,7 +465,7 @@ struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state
  *
  * RETURN:      None
  *
- * DESCRIPTION: Place the Thread state at the head of the state list.
+ * DESCRIPTION: Place the Thread state at the head of the state list
  *
  ******************************************************************************/
 
@@ -636,7 +541,6 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, union
 						  *thread)
 {
 	struct acpi_walk_state *walk_state;
-	acpi_status status;
 
 	ACPI_FUNCTION_TRACE(ds_create_walk_state);
 
@@ -659,14 +563,6 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, union
 	acpi_ds_method_data_init(walk_state);
 #endif
 
-	/* Create an initial result stack entry */
-
-	status = acpi_ds_result_stack_push(walk_state);
-	if (ACPI_FAILURE(status)) {
-		ACPI_FREE(walk_state);
-		return_PTR(NULL);
-	}
-
 	/* Put the new state at the head of the walk list */
 
 	if (thread) {
@@ -860,190 +756,3 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state)
 	ACPI_FREE(walk_state);
 	return_VOID;
 }
-
-#ifdef ACPI_OBSOLETE_FUNCTIONS
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ds_result_insert
- *
- * PARAMETERS:  Object              - Object to push
- *              Index               - Where to insert the object
- *              walk_state          - Current Walk state
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Insert an object onto this walk's result stack
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ds_result_insert(void *object,
-		      u32 index, struct acpi_walk_state *walk_state)
-{
-	union acpi_generic_state *state;
-
-	ACPI_FUNCTION_NAME(ds_result_insert);
-
-	state = walk_state->results;
-	if (!state) {
-		ACPI_ERROR((AE_INFO, "No result object pushed! State=%p",
-			    walk_state));
-		return (AE_NOT_EXIST);
-	}
-
-	if (index >= ACPI_OBJ_NUM_OPERANDS) {
-		ACPI_ERROR((AE_INFO,
-			    "Index out of range: %X Obj=%p State=%p Num=%X",
-			    index, object, walk_state,
-			    state->results.num_results));
-		return (AE_BAD_PARAMETER);
-	}
-
-	if (!object) {
-		ACPI_ERROR((AE_INFO,
-			    "Null Object! Index=%X Obj=%p State=%p Num=%X",
-			    index, object, walk_state,
-			    state->results.num_results));
-		return (AE_BAD_PARAMETER);
-	}
-
-	state->results.obj_desc[index] = object;
-	state->results.num_results++;
-
-	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-			  "Obj=%p [%s] State=%p Num=%X Cur=%X\n",
-			  object,
-			  object ?
-			  acpi_ut_get_object_type_name((union
-							acpi_operand_object *)
-						       object) : "NULL",
-			  walk_state, state->results.num_results,
-			  walk_state->current_result));
-
-	return (AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ds_obj_stack_delete_all
- *
- * PARAMETERS:  walk_state          - Current Walk state
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Clear the object stack by deleting all objects that are on it.
- *              Should be used with great care, if at all!
- *
- ******************************************************************************/
-
-acpi_status acpi_ds_obj_stack_delete_all(struct acpi_walk_state * walk_state)
-{
-	u32 i;
-
-	ACPI_FUNCTION_TRACE_PTR(ds_obj_stack_delete_all, walk_state);
-
-	/* The stack size is configurable, but fixed */
-
-	for (i = 0; i < ACPI_OBJ_NUM_OPERANDS; i++) {
-		if (walk_state->operands[i]) {
-			acpi_ut_remove_reference(walk_state->operands[i]);
-			walk_state->operands[i] = NULL;
-		}
-	}
-
-	return_ACPI_STATUS(AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ds_obj_stack_pop_object
- *
- * PARAMETERS:  Object              - Where to return the popped object
- *              walk_state          - Current Walk state
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Pop this walk's object stack.  Objects on the stack are NOT
- *              deleted by this routine.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_ds_obj_stack_pop_object(union acpi_operand_object **object,
-			     struct acpi_walk_state *walk_state)
-{
-	ACPI_FUNCTION_NAME(ds_obj_stack_pop_object);
-
-	/* Check for stack underflow */
-
-	if (walk_state->num_operands == 0) {
-		ACPI_ERROR((AE_INFO,
-			    "Missing operand/stack empty! State=%p #Ops=%X",
-			    walk_state, walk_state->num_operands));
-		*object = NULL;
-		return (AE_AML_NO_OPERAND);
-	}
-
-	/* Pop the stack */
-
-	walk_state->num_operands--;
-
-	/* Check for a valid operand */
-
-	if (!walk_state->operands[walk_state->num_operands]) {
-		ACPI_ERROR((AE_INFO,
-			    "Null operand! State=%p #Ops=%X",
-			    walk_state, walk_state->num_operands));
-		*object = NULL;
-		return (AE_AML_NO_OPERAND);
-	}
-
-	/* Get operand and set stack entry to null */
-
-	*object = walk_state->operands[walk_state->num_operands];
-	walk_state->operands[walk_state->num_operands] = NULL;
-
-	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Obj=%p [%s] State=%p #Ops=%X\n",
-			  *object, acpi_ut_get_object_type_name(*object),
-			  walk_state, walk_state->num_operands));
-
-	return (AE_OK);
-}
-
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ds_obj_stack_get_value
- *
- * PARAMETERS:  Index               - Stack index whose value is desired.  Based
- *                                    on the top of the stack (index=0 == top)
- *              walk_state          - Current Walk state
- *
- * RETURN:      Pointer to the requested operand
- *
- * DESCRIPTION: Retrieve an object from this walk's operand stack.  Index must
- *              be within the range of the current stack pointer.
- *
- ******************************************************************************/
-
-void *acpi_ds_obj_stack_get_value(u32 index, struct acpi_walk_state *walk_state)
-{
-
-	ACPI_FUNCTION_TRACE_PTR(ds_obj_stack_get_value, walk_state);
-
-	/* Can't do it if the stack is empty */
-
-	if (walk_state->num_operands == 0) {
-		return_PTR(NULL);
-	}
-
-	/* or if the index is past the top of the stack */
-
-	if (index > (walk_state->num_operands - (u32) 1)) {
-		return_PTR(NULL);
-	}
-
-	return_PTR(walk_state->
-		   operands[(acpi_native_uint) (walk_state->num_operands - 1) -
-			    index]);
-}
-#endif
diff --git a/drivers/acpi/parser/psloop.c b/drivers/acpi/parser/psloop.c
index 773aee8..266dd0c 100644
--- a/drivers/acpi/parser/psloop.c
+++ b/drivers/acpi/parser/psloop.c
@@ -603,13 +603,6 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state,
 			acpi_ps_pop_scope(&(walk_state->parser_state), op,
 					  &walk_state->arg_types,
 					  &walk_state->arg_count);
-
-			if ((*op)->common.aml_opcode != AML_WHILE_OP) {
-				status2 = acpi_ds_result_stack_pop(walk_state);
-				if (ACPI_FAILURE(status2)) {
-					return_ACPI_STATUS(status2);
-				}
-			}
 		}
 
 		/* Close this iteration of the While loop */
@@ -640,10 +633,6 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state,
 				if (ACPI_FAILURE(status2)) {
 					return_ACPI_STATUS(status2);
 				}
-				status2 = acpi_ds_result_stack_pop(walk_state);
-				if (ACPI_FAILURE(status2)) {
-					return_ACPI_STATUS(status2);
-				}
 
 				acpi_ut_delete_generic_state
 				    (acpi_ut_pop_generic_state
diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
index 5d63f48..ce3139a 100644
--- a/drivers/acpi/parser/psparse.c
+++ b/drivers/acpi/parser/psparse.c
@@ -349,19 +349,13 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
 
 		parser_state->aml = walk_state->aml_last_while;
 		walk_state->control_state->common.value = FALSE;
-		status = acpi_ds_result_stack_pop(walk_state);
-		if (ACPI_SUCCESS(status)) {
-			status = AE_CTRL_BREAK;
-		}
+		status = AE_CTRL_BREAK;
 		break;
 
 	case AE_CTRL_CONTINUE:
 
 		parser_state->aml = walk_state->aml_last_while;
-		status = acpi_ds_result_stack_pop(walk_state);
-		if (ACPI_SUCCESS(status)) {
-			status = AE_CTRL_CONTINUE;
-		}
+		status = AE_CTRL_CONTINUE;
 		break;
 
 	case AE_CTRL_PENDING:
@@ -383,10 +377,7 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
 		 * Just close out this package
 		 */
 		parser_state->aml = acpi_ps_get_next_package_end(parser_state);
-		status = acpi_ds_result_stack_pop(walk_state);
-		if (ACPI_SUCCESS(status)) {
-			status = AE_CTRL_PENDING;
-		}
+		status = AE_CTRL_PENDING;
 		break;
 
 	case AE_CTRL_FALSE:
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 422f29c..d13bab4 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20070126
+#define ACPI_CA_VERSION                 0x20070307
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
@@ -150,6 +150,17 @@
 #define ACPI_OBJ_NUM_OPERANDS           8
 #define ACPI_OBJ_MAX_OPERAND            7
 
+/* Number of elements in the Result Stack frame, can be an arbitrary value */
+
+#define ACPI_RESULTS_FRAME_OBJ_NUM      8
+
+/*
+ * Maximal number of elements the Result Stack can contain,
+ * it may be an arbitray value not exceeding the types of
+ * result_size and result_count (now u8).
+ */
+#define ACPI_RESULTS_OBJ_NUM_MAX        255
+
 /* Names within the namespace are 4 bytes long */
 
 #define ACPI_NAME_SIZE                  4
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 7f690bb..70d649e 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -303,7 +303,7 @@ acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state,
 		      u32 aml_length,
 		      struct acpi_evaluate_info *info, u8 pass_number);
 
-acpi_status
+void
 acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
 				 struct acpi_walk_state *walk_state);
 
@@ -316,21 +316,11 @@ void
 acpi_ds_push_walk_state(struct acpi_walk_state *walk_state,
 			struct acpi_thread_state *thread);
 
-acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state);
-
-acpi_status acpi_ds_result_stack_push(struct acpi_walk_state *walk_state);
-
 acpi_status acpi_ds_result_stack_clear(struct acpi_walk_state *walk_state);
 
 struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state
 						       *thread);
 
-#ifdef ACPI_FUTURE_USAGE
-acpi_status
-acpi_ds_result_remove(union acpi_operand_object **object,
-		      u32 index, struct acpi_walk_state *walk_state);
-#endif
-
 acpi_status
 acpi_ds_result_pop(union acpi_operand_object **object,
 		   struct acpi_walk_state *walk_state);
@@ -339,8 +329,4 @@ acpi_status
 acpi_ds_result_push(union acpi_operand_object *object,
 		    struct acpi_walk_state *walk_state);
 
-acpi_status
-acpi_ds_result_pop_from_bottom(union acpi_operand_object **object,
-			       struct acpi_walk_state *walk_state);
-
 #endif				/* _ACDISPAT_H_ */
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 202cd42..0b7c9a9 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -522,9 +522,8 @@ struct acpi_thread_state {
  * AML arguments
  */
 struct acpi_result_values {
-	ACPI_STATE_COMMON u8 num_results;
-	u8 last_insert;
-	union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS];
+	ACPI_STATE_COMMON
+	    union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
 };
 
 typedef
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index 8848265..19b838d 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -80,12 +80,15 @@ struct acpi_walk_state {
 	u16 opcode;		/* Current AML opcode */
 	u8 next_op_info;	/* Info about next_op */
 	u8 num_operands;	/* Stack pointer for Operands[] array */
+	u8 operand_index;	/* Index into operand stack, to be used by acpi_ds_obj_stack_push */
 	acpi_owner_id owner_id;	/* Owner of objects created during the walk */
 	u8 last_predicate;	/* Result of last predicate */
 	u8 current_result;
 	u8 return_used;
 	u8 scope_depth;
 	u8 pass_number;		/* Parse pass during table load */
+	u8 result_size;		/* Total elements for the result stack */
+	u8 result_count;	/* Current number of occupied elements of result stack */
 	u32 aml_offset;
 	u32 arg_types;
 	u32 method_breakpoint;	/* For single stepping */
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 02/73] ACPICA: Removed unused code
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 03/73] ACPICA: Update for mutiple global lock acquisitions by same thread Len Brown
                     ` (70 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Handling of AML_NAME_OP as a Reference.Opcode is no longer
needed. Kernel bugzilla 2874

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exdump.c   |    9 ---------
 drivers/acpi/executer/exresolv.c |   18 ------------------
 drivers/acpi/executer/exresop.c  |   11 -----------
 drivers/acpi/executer/exstore.c  |    1 -
 4 files changed, 0 insertions(+), 39 deletions(-)

diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index 51c9c29..fcb1da0 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -500,15 +500,6 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 			acpi_os_printf("Reference: Debug\n");
 			break;
 
-		case AML_NAME_OP:
-
-			ACPI_DUMP_PATHNAME(obj_desc->reference.object,
-					   "Reference: Name: ", ACPI_LV_INFO,
-					   _COMPONENT);
-			ACPI_DUMP_ENTRY(obj_desc->reference.object,
-					ACPI_LV_INFO);
-			break;
-
 		case AML_INDEX_OP:
 
 			acpi_os_printf("Reference: Index %p\n",
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 6c64e55..74ab220 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -140,7 +140,6 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
 {
 	acpi_status status = AE_OK;
 	union acpi_operand_object *stack_desc;
-	void *temp_node;
 	union acpi_operand_object *obj_desc = NULL;
 	u16 opcode;
 
@@ -156,23 +155,6 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
 		opcode = stack_desc->reference.opcode;
 
 		switch (opcode) {
-		case AML_NAME_OP:
-
-			/*
-			 * Convert name reference to a namespace node
-			 * Then, acpi_ex_resolve_node_to_value can be used to get the value
-			 */
-			temp_node = stack_desc->reference.object;
-
-			/* Delete the Reference Object */
-
-			acpi_ut_remove_reference(stack_desc);
-
-			/* Return the namespace node */
-
-			(*stack_ptr) = temp_node;
-			break;
-
 		case AML_LOCAL_OP:
 		case AML_ARG_OP:
 
diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c
index 09d897b..259047a 100644
--- a/drivers/acpi/executer/exresop.c
+++ b/drivers/acpi/executer/exresop.c
@@ -137,7 +137,6 @@ acpi_ex_resolve_operands(u16 opcode,
 	union acpi_operand_object *obj_desc;
 	acpi_status status = AE_OK;
 	u8 object_type;
-	void *temp_node;
 	u32 arg_types;
 	const struct acpi_opcode_info *op_info;
 	u32 this_arg_type;
@@ -239,7 +238,6 @@ acpi_ex_resolve_operands(u16 opcode,
 
 					/*lint -fallthrough */
 
-				case AML_NAME_OP:
 				case AML_INDEX_OP:
 				case AML_REF_OF_OP:
 				case AML_ARG_OP:
@@ -332,15 +330,6 @@ acpi_ex_resolve_operands(u16 opcode,
 			if (ACPI_FAILURE(status)) {
 				return_ACPI_STATUS(status);
 			}
-
-			if (obj_desc->reference.opcode == AML_NAME_OP) {
-
-				/* Convert a named reference to the actual named object */
-
-				temp_node = obj_desc->reference.object;
-				acpi_ut_remove_reference(obj_desc);
-				(*stack_ptr) = temp_node;
-			}
 			goto next_operand;
 
 		case ARGI_DATAREFOBJ:	/* Store operator only */
diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index f4b69a6..97cb188 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -313,7 +313,6 @@ acpi_ex_store(union acpi_operand_object *source_desc,
 	 * 4) Store to the debug object
 	 */
 	switch (ref_desc->reference.opcode) {
-	case AML_NAME_OP:
 	case AML_REF_OF_OP:
 
 		/* Storing an object into a Name "container" */
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 03/73] ACPICA: Update for mutiple global lock acquisitions by same thread
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
  2008-04-12  4:24   ` [PATCH 02/73] ACPICA: Removed unused code Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 04/73] ACPICA: changed order of interpretation of operand objects Len Brown
                     ` (69 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Allows AcpiAcquireGlobalLock external interface to be called
multiple times by the
 same thread. Allows use of AML fields that require the global
 lock while the running AML is already holding the global lock.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsmethod.c |   12 +-
 drivers/acpi/events/evmisc.c       |   11 +-
 drivers/acpi/events/evxface.c      |   26 ++++-
 drivers/acpi/executer/exfield.c    |   24 ++---
 drivers/acpi/executer/exmutex.c    |  194 +++++++++++++++++++++++-------------
 drivers/acpi/executer/exutils.c    |   58 +++++------
 drivers/acpi/namespace/nsaccess.c  |    3 +-
 drivers/acpi/utilities/utdelete.c  |    2 +-
 include/acpi/acglobal.h            |   20 ++--
 include/acpi/acinterp.h            |   11 ++-
 include/acpi/acobject.h            |    3 +-
 11 files changed, 219 insertions(+), 145 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index 1cbe619..c50c0cd 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -232,9 +232,9 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
 		 * recursive call.
 		 */
 		if (!walk_state ||
-		    !obj_desc->method.mutex->mutex.owner_thread ||
-		    (walk_state->thread !=
-		     obj_desc->method.mutex->mutex.owner_thread)) {
+		    !obj_desc->method.mutex->mutex.thread_id ||
+		    (walk_state->thread->thread_id !=
+		     obj_desc->method.mutex->mutex.thread_id)) {
 			/*
 			 * Acquire the method mutex. This releases the interpreter if we
 			 * block (and reacquires it before it returns)
@@ -254,8 +254,8 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
 				    original_sync_level =
 				    walk_state->thread->current_sync_level;
 
-				obj_desc->method.mutex->mutex.owner_thread =
-				    walk_state->thread;
+				obj_desc->method.mutex->mutex.thread_id =
+				    walk_state->thread->thread_id;
 				walk_state->thread->current_sync_level =
 				    obj_desc->method.sync_level;
 			} else {
@@ -569,7 +569,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 
 			acpi_os_release_mutex(method_desc->method.mutex->mutex.
 					      os_mutex);
-			method_desc->method.mutex->mutex.owner_thread = NULL;
+			method_desc->method.mutex->mutex.thread_id = 0;
 		}
 	}
 
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 21cb749..2d34663 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -439,7 +439,8 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
 	 * Only one thread can acquire the GL at a time, the global_lock_mutex
 	 * enforces this. This interface releases the interpreter if we must wait.
 	 */
-	status = acpi_ex_system_wait_mutex(acpi_gbl_global_lock_mutex, 0);
+	status = acpi_ex_system_wait_mutex(
+			acpi_gbl_global_lock_mutex->mutex.os_mutex, 0);
 	if (status == AE_TIME) {
 		if (acpi_ev_global_lock_thread_id == acpi_os_get_thread_id()) {
 			acpi_ev_global_lock_acquired++;
@@ -448,9 +449,9 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
 	}
 
 	if (ACPI_FAILURE(status)) {
-		status =
-		    acpi_ex_system_wait_mutex(acpi_gbl_global_lock_mutex,
-					      timeout);
+		status = acpi_ex_system_wait_mutex(
+				acpi_gbl_global_lock_mutex->mutex.os_mutex,
+				timeout);
 	}
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
@@ -555,7 +556,7 @@ acpi_status acpi_ev_release_global_lock(void)
 	/* Release the local GL mutex */
 	acpi_ev_global_lock_thread_id = NULL;
 	acpi_ev_global_lock_acquired = 0;
-	acpi_os_release_mutex(acpi_gbl_global_lock_mutex);
+	acpi_os_release_mutex(acpi_gbl_global_lock_mutex->mutex.os_mutex);
 	return_ACPI_STATUS(status);
 }
 
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index 6d866a0..dbf34a5 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -758,6 +758,12 @@ ACPI_EXPORT_SYMBOL(acpi_remove_gpe_handler)
  *
  * DESCRIPTION: Acquire the ACPI Global Lock
  *
+ * Note: Allows callers with the same thread ID to acquire the global lock
+ * multiple times. In other words, externally, the behavior of the global lock
+ * is identical to an AML mutex. On the first acquire, a new handle is
+ * returned. On any subsequent calls to acquire by the same thread, the same
+ * handle is returned.
+ *
  ******************************************************************************/
 acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
 {
@@ -770,14 +776,26 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
 	/* Must lock interpreter to prevent race conditions */
 
 	acpi_ex_enter_interpreter();
-	status = acpi_ev_acquire_global_lock(timeout);
-	acpi_ex_exit_interpreter();
+
+	status = acpi_ex_acquire_mutex_object(timeout,
+					      acpi_gbl_global_lock_mutex,
+					      acpi_os_get_thread_id());
 
 	if (ACPI_SUCCESS(status)) {
-		acpi_gbl_global_lock_handle++;
+		/*
+		 * If this was the first acquisition of the Global Lock by this thread,
+		 * create a new handle. Otherwise, return the existing handle.
+		 */
+		if (acpi_gbl_global_lock_mutex->mutex.acquisition_depth == 1) {
+			acpi_gbl_global_lock_handle++;
+		}
+
+		/* Return the global lock handle */
+
 		*handle = acpi_gbl_global_lock_handle;
 	}
 
+	acpi_ex_exit_interpreter();
 	return (status);
 }
 
@@ -802,7 +820,7 @@ acpi_status acpi_release_global_lock(u32 handle)
 		return (AE_NOT_ACQUIRED);
 	}
 
-	status = acpi_ev_release_global_lock();
+	status = acpi_ex_release_mutex_object(acpi_gbl_global_lock_mutex);
 	return (status);
 }
 
diff --git a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c
index 2d88a3d..e66b367 100644
--- a/drivers/acpi/executer/exfield.c
+++ b/drivers/acpi/executer/exfield.c
@@ -71,7 +71,6 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
 	union acpi_operand_object *buffer_desc;
 	acpi_size length;
 	void *buffer;
-	u8 locked;
 
 	ACPI_FUNCTION_TRACE_PTR(ex_read_data_from_field, obj_desc);
 
@@ -111,9 +110,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
 
 		/* Lock entire transaction if requested */
 
-		locked =
-		    acpi_ex_acquire_global_lock(obj_desc->common_field.
-						field_flags);
+		acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags);
 
 		/*
 		 * Perform the read.
@@ -125,7 +122,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
 							     buffer.pointer),
 					       ACPI_READ | (obj_desc->field.
 							    attribute << 16));
-		acpi_ex_release_global_lock(locked);
+		acpi_ex_release_global_lock();
 		goto exit;
 	}
 
@@ -175,13 +172,12 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
 
 	/* Lock entire transaction if requested */
 
-	locked =
-	    acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags);
+	acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags);
 
 	/* Read from the field */
 
 	status = acpi_ex_extract_from_field(obj_desc, buffer, (u32) length);
-	acpi_ex_release_global_lock(locked);
+	acpi_ex_release_global_lock();
 
       exit:
 	if (ACPI_FAILURE(status)) {
@@ -217,7 +213,6 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 	u32 required_length;
 	void *buffer;
 	void *new_buffer;
-	u8 locked;
 	union acpi_operand_object *buffer_desc;
 
 	ACPI_FUNCTION_TRACE_PTR(ex_write_data_to_field, obj_desc);
@@ -278,9 +273,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 
 		/* Lock entire transaction if requested */
 
-		locked =
-		    acpi_ex_acquire_global_lock(obj_desc->common_field.
-						field_flags);
+		acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags);
 
 		/*
 		 * Perform the write (returns status and perhaps data in the
@@ -291,7 +284,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 					       (acpi_integer *) buffer,
 					       ACPI_WRITE | (obj_desc->field.
 							     attribute << 16));
-		acpi_ex_release_global_lock(locked);
+		acpi_ex_release_global_lock();
 
 		*result_desc = buffer_desc;
 		return_ACPI_STATUS(status);
@@ -366,13 +359,12 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 
 	/* Lock entire transaction if requested */
 
-	locked =
-	    acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags);
+	acpi_ex_acquire_global_lock(obj_desc->common_field.field_flags);
 
 	/* Write to the field */
 
 	status = acpi_ex_insert_into_field(obj_desc, buffer, length);
-	acpi_ex_release_global_lock(locked);
+	acpi_ex_release_global_lock();
 
 	/* Free temporary buffer if we used one */
 
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index 6748e3e..0bebe75 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -126,6 +126,66 @@ acpi_ex_link_mutex(union acpi_operand_object *obj_desc,
 
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_ex_acquire_mutex_object
+ *
+ * PARAMETERS:  time_desc           - Timeout in milliseconds
+ *              obj_desc            - Mutex object
+ *              Thread              - Current thread state
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Acquire an AML mutex, low-level interface
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ex_acquire_mutex_object(u16 timeout,
+			     union acpi_operand_object *obj_desc,
+			     acpi_thread_id thread_id)
+{
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE_PTR(ex_acquire_mutex_object, obj_desc);
+
+	/* Support for multiple acquires by the owning thread */
+
+	if (obj_desc->mutex.thread_id == thread_id) {
+		/*
+		 * The mutex is already owned by this thread, just increment the
+		 * acquisition depth
+		 */
+		obj_desc->mutex.acquisition_depth++;
+		return_ACPI_STATUS(AE_OK);
+	}
+
+	/* Acquire the mutex, wait if necessary. Special case for Global Lock */
+
+	if (obj_desc == acpi_gbl_global_lock_mutex) {
+		status = acpi_ev_acquire_global_lock(timeout);
+	} else {
+		status = acpi_ex_system_wait_mutex(obj_desc->mutex.os_mutex,
+						   timeout);
+	}
+
+	if (ACPI_FAILURE(status)) {
+
+		/* Includes failure from a timeout on time_desc */
+
+		return_ACPI_STATUS(status);
+	}
+
+	/* Have the mutex: update mutex and save the sync_level */
+
+	obj_desc->mutex.thread_id = thread_id;
+	obj_desc->mutex.acquisition_depth = 1;
+	obj_desc->mutex.original_sync_level = 0;
+	obj_desc->mutex.owner_thread = NULL;	/* Used only for AML Acquire() */
+
+	return_ACPI_STATUS(AE_OK);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_ex_acquire_mutex
  *
  * PARAMETERS:  time_desc           - Timeout integer
@@ -161,7 +221,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 	}
 
 	/*
-	 * Current Sync must be less than or equal to the sync level of the
+	 * Current Sync level must be less than or equal to the sync level of the
 	 * mutex. This mechanism provides some deadlock prevention
 	 */
 	if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
@@ -172,51 +232,70 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 		return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
 	}
 
-	/* Support for multiple acquires by the owning thread */
+	status = acpi_ex_acquire_mutex_object((u16) time_desc->integer.value,
+					      obj_desc,
+					      walk_state->thread->thread_id);
+	if (ACPI_SUCCESS(status) && obj_desc->mutex.acquisition_depth == 1) {
+		obj_desc->mutex.owner_thread = walk_state->thread;
+		obj_desc->mutex.original_sync_level =
+		    walk_state->thread->current_sync_level;
+		walk_state->thread->current_sync_level =
+		    obj_desc->mutex.sync_level;
 
-	if (obj_desc->mutex.owner_thread) {
-		if (obj_desc->mutex.owner_thread->thread_id ==
-		    walk_state->thread->thread_id) {
-			/*
-			 * The mutex is already owned by this thread, just increment the
-			 * acquisition depth
-			 */
-			obj_desc->mutex.acquisition_depth++;
-			return_ACPI_STATUS(AE_OK);
-		}
+		/* Link the mutex to the current thread for force-unlock at method exit */
+
+		acpi_ex_link_mutex(obj_desc, walk_state->thread);
 	}
 
-	/* Acquire the mutex, wait if necessary. Special case for Global Lock */
+	return_ACPI_STATUS(status);
+}
 
-	if (obj_desc->mutex.os_mutex == acpi_gbl_global_lock_mutex) {
-		status =
-		    acpi_ev_acquire_global_lock((u16) time_desc->integer.value);
-	} else {
-		status = acpi_ex_system_wait_mutex(obj_desc->mutex.os_mutex,
-						   (u16) time_desc->integer.
-						   value);
-	}
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ex_release_mutex_object
+ *
+ * PARAMETERS:  obj_desc            - The object descriptor for this op
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Release a previously acquired Mutex, low level interface.
+ *
+ ******************************************************************************/
 
-	if (ACPI_FAILURE(status)) {
+acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc)
+{
+	acpi_status status = AE_OK;
 
-		/* Includes failure from a timeout on time_desc */
+	ACPI_FUNCTION_TRACE(ex_release_mutex_object);
 
-		return_ACPI_STATUS(status);
+	/* Match multiple Acquires with multiple Releases */
+
+	obj_desc->mutex.acquisition_depth--;
+	if (obj_desc->mutex.acquisition_depth != 0) {
+
+		/* Just decrement the depth and return */
+
+		return_ACPI_STATUS(AE_OK);
 	}
 
-	/* Have the mutex: update mutex and walk info and save the sync_level */
+	if (obj_desc->mutex.owner_thread) {
 
-	obj_desc->mutex.owner_thread = walk_state->thread;
-	obj_desc->mutex.acquisition_depth = 1;
-	obj_desc->mutex.original_sync_level =
-	    walk_state->thread->current_sync_level;
+		/* Unlink the mutex from the owner's list */
+
+		acpi_ex_unlink_mutex(obj_desc);
+		obj_desc->mutex.owner_thread = NULL;
+	}
 
-	walk_state->thread->current_sync_level = obj_desc->mutex.sync_level;
+	/* Release the mutex, special case for Global Lock */
 
-	/* Link the mutex to the current thread for force-unlock at method exit */
+	if (obj_desc == acpi_gbl_global_lock_mutex) {
+		status = acpi_ev_release_global_lock();
+	} else {
+		acpi_os_release_mutex(obj_desc->mutex.os_mutex);
+	}
 
-	acpi_ex_link_mutex(obj_desc, walk_state->thread);
-	return_ACPI_STATUS(AE_OK);
+	obj_desc->mutex.thread_id = 0;
+	return_ACPI_STATUS(status);
 }
 
 /*******************************************************************************
@@ -253,22 +332,13 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 		return_ACPI_STATUS(AE_AML_MUTEX_NOT_ACQUIRED);
 	}
 
-	/* Sanity check: we must have a valid thread ID */
-
-	if (!walk_state->thread) {
-		ACPI_ERROR((AE_INFO,
-			    "Cannot release Mutex [%4.4s], null thread info",
-			    acpi_ut_get_node_name(obj_desc->mutex.node)));
-		return_ACPI_STATUS(AE_AML_INTERNAL);
-	}
-
 	/*
 	 * The Mutex is owned, but this thread must be the owner.
 	 * Special case for Global Lock, any thread can release
 	 */
 	if ((obj_desc->mutex.owner_thread->thread_id !=
 	     walk_state->thread->thread_id)
-	    && (obj_desc->mutex.os_mutex != acpi_gbl_global_lock_mutex)) {
+	    && (obj_desc != acpi_gbl_global_lock_mutex)) {
 		ACPI_ERROR((AE_INFO,
 			    "Thread %lX cannot release Mutex [%4.4s] acquired by thread %lX",
 			    (unsigned long)walk_state->thread->thread_id,
@@ -278,6 +348,15 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 		return_ACPI_STATUS(AE_AML_NOT_OWNER);
 	}
 
+	/* Sanity check: we must have a valid thread ID */
+
+	if (!walk_state->thread) {
+		ACPI_ERROR((AE_INFO,
+			    "Cannot release Mutex [%4.4s], null thread info",
+			    acpi_ut_get_node_name(obj_desc->mutex.node)));
+		return_ACPI_STATUS(AE_AML_INTERNAL);
+	}
+
 	/*
 	 * The sync level of the mutex must be less than or equal to the current
 	 * sync level
@@ -289,34 +368,12 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 		return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
 	}
 
-	/* Match multiple Acquires with multiple Releases */
-
-	obj_desc->mutex.acquisition_depth--;
-	if (obj_desc->mutex.acquisition_depth != 0) {
-
-		/* Just decrement the depth and return */
-
-		return_ACPI_STATUS(AE_OK);
-	}
-
-	/* Unlink the mutex from the owner's list */
+	status = acpi_ex_release_mutex_object(obj_desc);
 
-	acpi_ex_unlink_mutex(obj_desc);
-
-	/* Release the mutex, special case for Global Lock */
+	/* Restore sync_level */
 
-	if (obj_desc->mutex.os_mutex == acpi_gbl_global_lock_mutex) {
-		status = acpi_ev_release_global_lock();
-	} else {
-		acpi_os_release_mutex(obj_desc->mutex.os_mutex);
-	}
-
-	/* Update the mutex and restore sync_level */
-
-	obj_desc->mutex.owner_thread = NULL;
 	walk_state->thread->current_sync_level =
 	    obj_desc->mutex.original_sync_level;
-
 	return_ACPI_STATUS(status);
 }
 
@@ -357,7 +414,7 @@ void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread)
 
 		/* Release the mutex, special case for Global Lock */
 
-		if (obj_desc->mutex.os_mutex == acpi_gbl_global_lock_mutex) {
+		if (obj_desc == acpi_gbl_global_lock_mutex) {
 
 			/* Ignore errors */
 
@@ -369,6 +426,7 @@ void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread)
 		/* Mark mutex unowned */
 
 		obj_desc->mutex.owner_thread = NULL;
+		obj_desc->mutex.thread_id = 0;
 
 		/* Update Thread sync_level (Last mutex is the important one) */
 
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index 6b0aecc..c0837af 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -240,72 +240,66 @@ void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc)
  * PARAMETERS:  field_flags           - Flags with Lock rule:
  *                                      always_lock or never_lock
  *
- * RETURN:      TRUE/FALSE indicating whether the lock was actually acquired
+ * RETURN:      None
  *
- * DESCRIPTION: Obtain the global lock and keep track of this fact via two
- *              methods.  A global variable keeps the state of the lock, and
- *              the state is returned to the caller.
+ * DESCRIPTION: Obtain the ACPI hardware Global Lock, only if the field
+ *              flags specifiy that it is to be obtained before field access.
  *
  ******************************************************************************/
 
-u8 acpi_ex_acquire_global_lock(u32 field_flags)
+void acpi_ex_acquire_global_lock(u32 field_flags)
 {
-	u8 locked = FALSE;
 	acpi_status status;
 
 	ACPI_FUNCTION_TRACE(ex_acquire_global_lock);
 
-	/* Only attempt lock if the always_lock bit is set */
+	/* Only use the lock if the always_lock bit is set */
+
+	if (!(field_flags & AML_FIELD_LOCK_RULE_MASK)) {
+		return_VOID;
+	}
 
-	if (field_flags & AML_FIELD_LOCK_RULE_MASK) {
+	/* Attempt to get the global lock, wait forever */
 
-		/* We should attempt to get the lock, wait forever */
+	status = acpi_ex_acquire_mutex_object(ACPI_WAIT_FOREVER,
+					      acpi_gbl_global_lock_mutex,
+					      acpi_os_get_thread_id());
 
-		status = acpi_ev_acquire_global_lock(ACPI_WAIT_FOREVER);
-		if (ACPI_SUCCESS(status)) {
-			locked = TRUE;
-		} else {
-			ACPI_EXCEPTION((AE_INFO, status,
-					"Could not acquire Global Lock"));
-		}
+	if (ACPI_FAILURE(status)) {
+		ACPI_EXCEPTION((AE_INFO, status,
+				"Could not acquire Global Lock"));
 	}
 
-	return_UINT8(locked);
+	return_VOID;
 }
 
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ex_release_global_lock
  *
- * PARAMETERS:  locked_by_me    - Return value from corresponding call to
- *                                acquire_global_lock.
+ * PARAMETERS:  None
  *
  * RETURN:      None
  *
- * DESCRIPTION: Release the global lock if it is locked.
+ * DESCRIPTION: Release the ACPI hardware Global Lock
  *
  ******************************************************************************/
 
-void acpi_ex_release_global_lock(u8 locked_by_me)
+void acpi_ex_release_global_lock(void)
 {
 	acpi_status status;
 
 	ACPI_FUNCTION_TRACE(ex_release_global_lock);
 
-	/* Only attempt unlock if the caller locked it */
-
-	if (locked_by_me) {
+	/* Release the global lock */
 
-		/* OK, now release the lock */
-
-		status = acpi_ev_release_global_lock();
-		if (ACPI_FAILURE(status)) {
+	status = acpi_ex_release_mutex_object(acpi_gbl_global_lock_mutex);
+	if (ACPI_FAILURE(status)) {
 
-			/* Report the error, but there isn't much else we can do */
+		/* Report the error, but there isn't much else we can do */
 
-			ACPI_EXCEPTION((AE_INFO, status,
-					"Could not release ACPI Global Lock"));
-		}
+		ACPI_EXCEPTION((AE_INFO, status,
+				"Could not release Global Lock"));
 	}
 
 	return_VOID;
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c
index 57faf59..32a0167 100644
--- a/drivers/acpi/namespace/nsaccess.c
+++ b/drivers/acpi/namespace/nsaccess.c
@@ -208,8 +208,7 @@ acpi_status acpi_ns_root_initialize(void)
 				/* Special case for ACPI Global Lock */
 
 				if (ACPI_STRCMP(init_val->name, "_GL_") == 0) {
-					acpi_gbl_global_lock_mutex =
-					    obj_desc->mutex.os_mutex;
+					acpi_gbl_global_lock_mutex = obj_desc;
 
 					/* Create additional counting semaphore for global lock */
 
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index f777ceb..dcb34f8 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -158,7 +158,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
 				  "***** Mutex %p, OS Mutex %p\n",
 				  object, object->mutex.os_mutex));
 
-		if (object->mutex.os_mutex == acpi_gbl_global_lock_mutex) {
+		if (object == acpi_gbl_global_lock_mutex) {
 
 			/* Global Lock has extra semaphore */
 
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 47a1fd8..e91008e 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -170,10 +170,14 @@ ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
 ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX];
 
 /*
- * Global lock semaphore works in conjunction with the actual HW global lock
+ * Global lock mutex is an actual AML mutex object
+ * Global lock semaphore works in conjunction with the HW global lock
  */
-ACPI_EXTERN acpi_mutex acpi_gbl_global_lock_mutex;
+ACPI_EXTERN union acpi_operand_object *acpi_gbl_global_lock_mutex;
 ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore;
+ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
+ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
+ACPI_EXTERN u8 acpi_gbl_global_lock_present;
 
 /*
  * Spinlocks are used for interfaces that can be possibly called at
@@ -215,22 +219,22 @@ ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler;
 ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
 ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
 
+/* Owner ID support */
+
+ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS];
+ACPI_EXTERN u8 acpi_gbl_last_owner_id_index;
+ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset;
+
 /* Misc */
 
 ACPI_EXTERN u32 acpi_gbl_original_mode;
 ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
 ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
 ACPI_EXTERN u32 acpi_gbl_ps_find_count;
-ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS];
 ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
-ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
-ACPI_EXTERN u8 acpi_gbl_last_owner_id_index;
-ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset;
 ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
-ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
 ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
 ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
-ACPI_EXTERN u8 acpi_gbl_global_lock_present;
 ACPI_EXTERN u8 acpi_gbl_events_initialized;
 ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
 
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index ce7c9d6..2386388 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -248,9 +248,16 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 		      struct acpi_walk_state *walk_state);
 
 acpi_status
+acpi_ex_acquire_mutex_object(u16 timeout,
+			     union acpi_operand_object *obj_desc,
+			     acpi_thread_id thread_id);
+
+acpi_status
 acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 		      struct acpi_walk_state *walk_state);
 
+acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc);
+
 void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread);
 
 void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc);
@@ -455,9 +462,9 @@ void acpi_ex_relinquish_interpreter(void);
 
 void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
 
-u8 acpi_ex_acquire_global_lock(u32 rule);
+void acpi_ex_acquire_global_lock(u32 rule);
 
-void acpi_ex_release_global_lock(u8 locked);
+void acpi_ex_release_global_lock(void);
 
 void acpi_ex_eisa_id_to_string(u32 numeric_id, char *out_string);
 
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 7e1211a..2461bb9 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -155,8 +155,9 @@ struct acpi_object_event {
 struct acpi_object_mutex {
 	ACPI_OBJECT_COMMON_HEADER u8 sync_level;	/* 0-15, specified in Mutex() call */
 	u16 acquisition_depth;	/* Allow multiple Acquires, same thread */
-	struct acpi_thread_state *owner_thread;	/* Current owner of the mutex */
 	acpi_mutex os_mutex;	/* Actual OS synchronization object */
+	acpi_thread_id thread_id;	/* Current owner of the mutex */
+	struct acpi_thread_state *owner_thread;	/* Current owner of the mutex */
 	union acpi_operand_object *prev;	/* Link for list of acquired mutexes */
 	union acpi_operand_object *next;	/* Link for list of acquired mutexes */
 	struct acpi_namespace_node *node;	/* Containing namespace node */
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 04/73] ACPICA: changed order of interpretation of operand objects
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
  2008-04-12  4:24   ` [PATCH 02/73] ACPICA: Removed unused code Len Brown
  2008-04-12  4:24   ` [PATCH 03/73] ACPICA: Update for mutiple global lock acquisitions by same thread Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 05/73] ACPICA: Avoid use of invalid pointers in returned object field Len Brown
                     ` (68 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

The interpreter now evaluates operands in the order that they
appear (both in the
 AML and ASL), instead of in reverse order. This previously
 caused subtle incompatibilities with the MS interpreter as well
 as being non-intuitive.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsutils.c |  113 ++++++++++++++++++++++++++++++++++++-
 drivers/acpi/dispatcher/dswexec.c |   11 +++-
 drivers/acpi/executer/exutils.c   |    3 +-
 drivers/acpi/parser/psloop.c      |   23 +++++++-
 drivers/acpi/parser/psopcode.c    |   26 +++++++++
 drivers/acpi/parser/pstree.c      |    2 +
 include/acpi/acdispat.h           |    2 +
 include/acpi/aclocal.h            |    3 +
 include/acpi/acparser.h           |    2 +
 9 files changed, 177 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c
index d2a8cfd..36518b4 100644
--- a/drivers/acpi/dispatcher/dsutils.c
+++ b/drivers/acpi/dispatcher/dsutils.c
@@ -472,7 +472,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
 	/* A valid name must be looked up in the namespace */
 
 	if ((arg->common.aml_opcode == AML_INT_NAMEPATH_OP) &&
-	    (arg->common.value.string)) {
+	    (arg->common.value.string) &&
+	    !(arg->common.flags & ACPI_PARSEOP_IN_STACK)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "Getting a name: Arg=%p\n",
 				  arg));
 
@@ -595,7 +596,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
 	} else {
 		/* Check for null name case */
 
-		if (arg->common.aml_opcode == AML_INT_NAMEPATH_OP) {
+		if ((arg->common.aml_opcode == AML_INT_NAMEPATH_OP) &&
+		    !(arg->common.flags & ACPI_PARSEOP_IN_STACK)) {
 			/*
 			 * If the name is null, this means that this is an
 			 * optional result parameter that was not specified
@@ -617,7 +619,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
 			return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
 		}
 
-		if (op_info->flags & AML_HAS_RETVAL) {
+		if ((op_info->flags & AML_HAS_RETVAL)
+		    || (arg->common.flags & ACPI_PARSEOP_IN_STACK)) {
 			ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
 					  "Argument previously created, already stacked\n"));
 
@@ -759,3 +762,107 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
 	ACPI_EXCEPTION((AE_INFO, status, "While creating Arg %d", index));
 	return_ACPI_STATUS(status);
 }
+
+/*****************************************************************************
+ *
+ * FUNCTION:    acpi_ds_evaluate_name_path
+ *
+ * PARAMETERS:  walk_state      - Current state of the parse tree walk,
+ *                                the opcode of current operation should be
+ *                                AML_INT_NAMEPATH_OP
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Translate the -name_path- parse tree object to the equivalent
+ *              interpreter object, convert it to value, if needed, duplicate
+ *              it, if needed, and push it onto the current result stack.
+ *
+ ****************************************************************************/
+
+acpi_status acpi_ds_evaluate_name_path(struct acpi_walk_state *walk_state)
+{
+	acpi_status status = AE_OK;
+	union acpi_parse_object *op = walk_state->op;
+	union acpi_operand_object **operand = &walk_state->operands[0];
+	union acpi_operand_object *new_obj_desc;
+	u8 type;
+
+	ACPI_FUNCTION_TRACE_PTR(ds_evaluate_name_path, walk_state);
+
+	if (!op->common.parent) {
+
+		/* This happens after certain exception processing */
+
+		goto exit;
+	}
+
+	if ((op->common.parent->common.aml_opcode == AML_PACKAGE_OP) ||
+	    (op->common.parent->common.aml_opcode == AML_VAR_PACKAGE_OP) ||
+	    (op->common.parent->common.aml_opcode == AML_REF_OF_OP)) {
+
+		/* TBD: Should we specify this feature as a bit of op_info->Flags of these opcodes? */
+
+		goto exit;
+	}
+
+	status = acpi_ds_create_operand(walk_state, op, 0);
+	if (ACPI_FAILURE(status)) {
+		goto exit;
+	}
+
+	if (op->common.flags & ACPI_PARSEOP_TARGET) {
+		new_obj_desc = *operand;
+		goto push_result;
+	}
+
+	type = ACPI_GET_OBJECT_TYPE(*operand);
+
+	status = acpi_ex_resolve_to_value(operand, walk_state);
+	if (ACPI_FAILURE(status)) {
+		goto exit;
+	}
+
+	if (type == ACPI_TYPE_INTEGER) {
+
+		/* It was incremented by acpi_ex_resolve_to_value */
+
+		acpi_ut_remove_reference(*operand);
+
+		status =
+		    acpi_ut_copy_iobject_to_iobject(*operand, &new_obj_desc,
+						    walk_state);
+		if (ACPI_FAILURE(status)) {
+			goto exit;
+		}
+	} else {
+		/*
+		 * The object either was anew created or is
+		 * a Namespace node - don't decrement it.
+		 */
+		new_obj_desc = *operand;
+	}
+
+	/* Cleanup for name-path operand */
+
+	status = acpi_ds_obj_stack_pop(1, walk_state);
+	if (ACPI_FAILURE(status)) {
+		walk_state->result_obj = new_obj_desc;
+		goto exit;
+	}
+
+      push_result:
+
+	walk_state->result_obj = new_obj_desc;
+
+	status = acpi_ds_result_push(walk_state->result_obj, walk_state);
+	if (ACPI_SUCCESS(status)) {
+
+		/* Force to take it from stack */
+
+		op->common.flags |= ACPI_PARSEOP_IN_STACK;
+	}
+
+      exit:
+
+	return_ACPI_STATUS(status);
+}
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index 12b1485..514b9d2 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -375,10 +375,17 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 	/* Decode the Opcode Class */
 
 	switch (op_class) {
-	case AML_CLASS_ARGUMENT:	/* constants, literals, etc. - do nothing */
+	case AML_CLASS_ARGUMENT:	/* Constants, literals, etc. */
+
+		if (walk_state->opcode == AML_INT_NAMEPATH_OP) {
+			status = acpi_ds_evaluate_name_path(walk_state);
+			if (ACPI_FAILURE(status)) {
+				goto cleanup;
+			}
+		}
 		break;
 
-	case AML_CLASS_EXECUTE:	/* most operators with arguments */
+	case AML_CLASS_EXECUTE:	/* Most operators with arguments */
 
 		/* Build resolved operand stack */
 
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index c0837af..c40b191 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -217,9 +217,10 @@ void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc)
 
 	/*
 	 * Object must be a valid number and we must be executing
-	 * a control method
+	 * a control method. NS node could be there for AML_INT_NAMEPATH_OP.
 	 */
 	if ((!obj_desc) ||
+	    (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) ||
 	    (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_INTEGER)) {
 		return;
 	}
diff --git a/drivers/acpi/parser/psloop.c b/drivers/acpi/parser/psloop.c
index 266dd0c..4348b05 100644
--- a/drivers/acpi/parser/psloop.c
+++ b/drivers/acpi/parser/psloop.c
@@ -182,6 +182,7 @@ acpi_ps_build_named_op(struct acpi_walk_state *walk_state,
 	ACPI_FUNCTION_TRACE_PTR(ps_build_named_op, walk_state);
 
 	unnamed_op->common.value.arg = NULL;
+	unnamed_op->common.arg_list_length = 0;
 	unnamed_op->common.aml_opcode = walk_state->opcode;
 
 	/*
@@ -280,6 +281,9 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state,
 	acpi_status status = AE_OK;
 	union acpi_parse_object *op;
 	union acpi_parse_object *named_op = NULL;
+	union acpi_parse_object *parent_scope;
+	u8 argument_count;
+	const struct acpi_opcode_info *op_info;
 
 	ACPI_FUNCTION_TRACE_PTR(ps_create_op, walk_state);
 
@@ -320,8 +324,23 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state,
 		op->named.length = 0;
 	}
 
-	acpi_ps_append_arg(acpi_ps_get_parent_scope
-			   (&(walk_state->parser_state)), op);
+	parent_scope = acpi_ps_get_parent_scope(&(walk_state->parser_state));
+	acpi_ps_append_arg(parent_scope, op);
+
+	if (parent_scope) {
+		op_info =
+		    acpi_ps_get_opcode_info(parent_scope->common.aml_opcode);
+		if (op_info->flags & AML_HAS_TARGET) {
+			argument_count =
+			    acpi_ps_get_argument_count(op_info->type);
+			if (parent_scope->common.arg_list_length >
+			    argument_count) {
+				op->common.flags |= ACPI_PARSEOP_TARGET;
+			}
+		} else if (parent_scope->common.aml_opcode == AML_INCREMENT_OP) {
+			op->common.flags |= ACPI_PARSEOP_TARGET;
+		}
+	}
 
 	if (walk_state->descending_callback != NULL) {
 		/*
diff --git a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c
index 9296e86..3bf8105 100644
--- a/drivers/acpi/parser/psopcode.c
+++ b/drivers/acpi/parser/psopcode.c
@@ -49,6 +49,8 @@
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("psopcode")
 
+const u8 acpi_gbl_argument_count[] = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 6 };
+
 /*******************************************************************************
  *
  * NAME:        acpi_gbl_aml_op_info
@@ -59,6 +61,7 @@ ACPI_MODULE_NAME("psopcode")
  *              the operand type.
  *
  ******************************************************************************/
+
 /*
  * Summary of opcode types/flags
  *
@@ -176,6 +179,7 @@ ACPI_MODULE_NAME("psopcode")
 	AML_CREATE_QWORD_FIELD_OP
 
  ******************************************************************************/
+
 /*
  * Master Opcode information table.  A summary of everything we know about each
  * opcode, all in one place.
@@ -779,3 +783,25 @@ char *acpi_ps_get_opcode_name(u16 opcode)
 
 #endif
 }
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ps_get_argument_count
+ *
+ * PARAMETERS:  op_type             - Type associated with the AML opcode
+ *
+ * RETURN:      Argument count
+ *
+ * DESCRIPTION: Obtain the number of expected arguments for an AML opcode
+ *
+ ******************************************************************************/
+
+u8 acpi_ps_get_argument_count(u32 op_type)
+{
+
+	if (op_type <= AML_TYPE_EXEC_6A_0T_1R) {
+		return (acpi_gbl_argument_count[op_type]);
+	}
+
+	return (0);
+}
diff --git a/drivers/acpi/parser/pstree.c b/drivers/acpi/parser/pstree.c
index 966e7ea..0e1a322 100644
--- a/drivers/acpi/parser/pstree.c
+++ b/drivers/acpi/parser/pstree.c
@@ -171,6 +171,8 @@ acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg)
 	while (arg) {
 		arg->common.parent = op;
 		arg = arg->common.next;
+
+		op->common.arg_list_length++;
 	}
 }
 
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 70d649e..3bffb4d 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -269,6 +269,8 @@ acpi_status acpi_ds_resolve_operands(struct acpi_walk_state *walk_state);
 
 void acpi_ds_clear_operands(struct acpi_walk_state *walk_state);
 
+acpi_status acpi_ds_evaluate_name_path(struct acpi_walk_state *walk_state);
+
 /*
  * dswscope - Scope Stack manipulation
  */
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 0b7c9a9..946da60 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -603,6 +603,7 @@ union acpi_parse_value {
 	union acpi_parse_object         *next;          /* Next op */\
 	struct acpi_namespace_node      *node;          /* For use by interpreter */\
 	union acpi_parse_value          value;          /* Value or args associated with the opcode */\
+	u8                              arg_list_length; /* Number of elements in the arg list */\
 	ACPI_DISASM_ONLY_MEMBERS (\
 	u8                              disasm_flags;   /* Used during AML disassembly */\
 	u8                              disasm_opcode;  /* Subtype used for disassembly */\
@@ -695,6 +696,8 @@ struct acpi_parse_state {
 #define ACPI_PARSEOP_NAMED              0x02
 #define ACPI_PARSEOP_DEFERRED           0x04
 #define ACPI_PARSEOP_BYTELIST           0x08
+#define ACPI_PARSEOP_IN_STACK           0x10
+#define ACPI_PARSEOP_TARGET             0x20
 #define ACPI_PARSEOP_IN_CACHE           0x80
 
 /* Parse object disasm_flags */
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index 85c358e..a3ae76b 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -109,6 +109,8 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode);
 
 char *acpi_ps_get_opcode_name(u16 opcode);
 
+u8 acpi_ps_get_argument_count(u32 op_type);
+
 /*
  * psparse - top level parsing routines
  */
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 05/73] ACPICA: Avoid use of invalid pointers in returned object field
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (2 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 04/73] ACPICA: changed order of interpretation of operand objects Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 06/73] ACPICA: Fixed a couple compiler warnings for extra extern statements Len Brown
                     ` (67 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

During operand evaluation, ensure that the ReturnObj field is
cleared on error and only valid pointers are stored there.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exoparg1.c |    1 +
 drivers/acpi/executer/exoparg2.c |   19 +++++++++++++------
 drivers/acpi/executer/exoparg3.c |    1 +
 drivers/acpi/executer/exoparg6.c |    8 ++++++--
 4 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index 252f10a..ab5c037 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -121,6 +121,7 @@ acpi_status acpi_ex_opcode_0A_0T_1R(struct acpi_walk_state *walk_state)
 
 	if ((ACPI_FAILURE(status)) || walk_state->result_obj) {
 		acpi_ut_remove_reference(return_desc);
+		walk_state->result_obj = NULL;
 	} else {
 		/* Save the return value */
 
diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c
index 17e652e..81c02b1 100644
--- a/drivers/acpi/executer/exoparg2.c
+++ b/drivers/acpi/executer/exoparg2.c
@@ -241,10 +241,6 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state)
 		goto cleanup;
 	}
 
-	/* Return the remainder */
-
-	walk_state->result_obj = return_desc1;
-
       cleanup:
 	/*
 	 * Since the remainder is not returned indirectly, remove a reference to
@@ -259,6 +255,12 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state)
 		acpi_ut_remove_reference(return_desc1);
 	}
 
+	/* Save return object (the remainder) on success */
+
+	else {
+		walk_state->result_obj = return_desc1;
+	}
+
 	return_ACPI_STATUS(status);
 }
 
@@ -490,6 +492,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 
 	if (ACPI_FAILURE(status)) {
 		acpi_ut_remove_reference(return_desc);
+		walk_state->result_obj = NULL;
 	}
 
 	return_ACPI_STATUS(status);
@@ -583,8 +586,6 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
 		return_desc->integer.value = ACPI_INTEGER_MAX;
 	}
 
-	walk_state->result_obj = return_desc;
-
       cleanup:
 
 	/* Delete return object on error */
@@ -593,5 +594,11 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
 		acpi_ut_remove_reference(return_desc);
 	}
 
+	/* Save return object on success */
+
+	else {
+		walk_state->result_obj = return_desc;
+	}
+
 	return_ACPI_STATUS(status);
 }
diff --git a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c
index 7fe67cf..a573f5d 100644
--- a/drivers/acpi/executer/exoparg3.c
+++ b/drivers/acpi/executer/exoparg3.c
@@ -260,6 +260,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
 
 	if (ACPI_FAILURE(status) || walk_state->result_obj) {
 		acpi_ut_remove_reference(return_desc);
+		walk_state->result_obj = NULL;
 	}
 
 	/* Set the return object and exit */
diff --git a/drivers/acpi/executer/exoparg6.c b/drivers/acpi/executer/exoparg6.c
index bd80a9c..163b2b3 100644
--- a/drivers/acpi/executer/exoparg6.c
+++ b/drivers/acpi/executer/exoparg6.c
@@ -322,8 +322,6 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
 		goto cleanup;
 	}
 
-	walk_state->result_obj = return_desc;
-
       cleanup:
 
 	/* Delete return object on error */
@@ -332,5 +330,11 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
 		acpi_ut_remove_reference(return_desc);
 	}
 
+	/* Save return object on success */
+
+	else {
+		walk_state->result_obj = return_desc;
+	}
+
 	return_ACPI_STATUS(status);
 }
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 06/73] ACPICA: Fixed a couple compiler warnings for extra extern statements
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (3 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 05/73] ACPICA: Avoid use of invalid pointers in returned object field Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 07/73] ACPICA: Update comments for acquire/release mutex interfaces Len Brown
                     ` (66 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acglobal.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index e91008e..44e718e 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -238,6 +238,10 @@ ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
 ACPI_EXTERN u8 acpi_gbl_events_initialized;
 ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
 
+#ifndef DEFINE_ACPI_GLOBALS
+
+/* Other miscellaneous */
+
 extern u8 acpi_gbl_shutdown;
 extern u32 acpi_gbl_startup_flags;
 extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
@@ -245,6 +249,8 @@ extern const char *acpi_gbl_highest_dstate_names[4];
 extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
 extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
 
+#endif
+
 /* Exception codes */
 
 extern char const *acpi_gbl_exception_names_env[];
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 07/73] ACPICA: Update comments for acquire/release mutex interfaces
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (4 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 06/73] ACPICA: Fixed a couple compiler warnings for extra extern statements Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 08/73] ACPICA: Removed extraneous code Len Brown
                     ` (65 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

pdate comments for acquire/release mutex interfaces

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exmutex.c |   36 ++++++++++++++++++++++++++++++------
 1 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index 0bebe75..32f24a8 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -134,7 +134,16 @@ acpi_ex_link_mutex(union acpi_operand_object *obj_desc,
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Acquire an AML mutex, low-level interface
+ * DESCRIPTION: Acquire an AML mutex, low-level interface. Provides a common
+ *              path that supports multiple acquires by the same thread.
+ *
+ * MUTEX:       Interpreter must be locked
+ *
+ * NOTE: This interface is called from three places:
+ * 1) From acpi_ex_acquire_mutex, via an AML Acquire() operator
+ * 2) From acpi_ex_acquire_global_lock when an AML Field access requires the
+ *    global lock
+ * 3) From the external interface, acpi_acquire_global_lock
  *
  ******************************************************************************/
 
@@ -174,7 +183,7 @@ acpi_ex_acquire_mutex_object(u16 timeout,
 		return_ACPI_STATUS(status);
 	}
 
-	/* Have the mutex: update mutex and save the sync_level */
+	/* Acquired the mutex: update mutex object */
 
 	obj_desc->mutex.thread_id = thread_id;
 	obj_desc->mutex.acquisition_depth = 1;
@@ -211,7 +220,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
 
-	/* Sanity check: we must have a valid thread ID */
+	/* Must have a valid thread ID */
 
 	if (!walk_state->thread) {
 		ACPI_ERROR((AE_INFO,
@@ -221,7 +230,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 	}
 
 	/*
-	 * Current Sync level must be less than or equal to the sync level of the
+	 * Current sync level must be less than or equal to the sync level of the
 	 * mutex. This mechanism provides some deadlock prevention
 	 */
 	if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
@@ -236,6 +245,9 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 					      obj_desc,
 					      walk_state->thread->thread_id);
 	if (ACPI_SUCCESS(status) && obj_desc->mutex.acquisition_depth == 1) {
+
+		/* Save Thread object, original/current sync levels */
+
 		obj_desc->mutex.owner_thread = walk_state->thread;
 		obj_desc->mutex.original_sync_level =
 		    walk_state->thread->current_sync_level;
@@ -259,6 +271,16 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
  * RETURN:      Status
  *
  * DESCRIPTION: Release a previously acquired Mutex, low level interface.
+ *              Provides a common path that supports multiple releases (after
+ *              previous multiple acquires) by the same thread.
+ *
+ * MUTEX:       Interpreter must be locked
+ *
+ * NOTE: This interface is called from three places:
+ * 1) From acpi_ex_release_mutex, via an AML Acquire() operator
+ * 2) From acpi_ex_release_global_lock when an AML Field access requires the
+ *    global lock
+ * 3) From the external interface, acpi_release_global_lock
  *
  ******************************************************************************/
 
@@ -294,6 +316,8 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc)
 		acpi_os_release_mutex(obj_desc->mutex.os_mutex);
 	}
 
+	/* Clear mutex info */
+
 	obj_desc->mutex.thread_id = 0;
 	return_ACPI_STATUS(status);
 }
@@ -348,7 +372,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 		return_ACPI_STATUS(AE_AML_NOT_OWNER);
 	}
 
-	/* Sanity check: we must have a valid thread ID */
+	/* Must have a valid thread ID */
 
 	if (!walk_state->thread) {
 		ACPI_ERROR((AE_INFO,
@@ -370,7 +394,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 
 	status = acpi_ex_release_mutex_object(obj_desc);
 
-	/* Restore sync_level */
+	/* Restore the original sync_level */
 
 	walk_state->thread->current_sync_level =
 	    obj_desc->mutex.original_sync_level;
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 08/73] ACPICA: Removed extraneous code
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (5 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 07/73] ACPICA: Update comments for acquire/release mutex interfaces Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 09/73] ACPICA: Removed obsolete ACPI_NO_INTEGER64_SUPPORT define Len Brown
                     ` (64 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsmethod.c |    7 -------
 drivers/acpi/namespace/nswalk.c    |    4 +---
 2 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index c50c0cd..3db651c 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -535,7 +535,6 @@ void
 acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 				 struct acpi_walk_state *walk_state)
 {
-	struct acpi_namespace_node *method_node;
 	acpi_status status;
 
 	ACPI_FUNCTION_TRACE_PTR(ds_terminate_control_method, walk_state);
@@ -575,12 +574,6 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 
 	if (walk_state) {
 		/*
-		 * Delete any objects created by this method during execution.
-		 * The method Node is stored in the walk state
-		 */
-		method_node = walk_state->method_node;
-
-		/*
 		 * Delete any namespace objects created anywhere within
 		 * the namespace by the execution of this method
 		 */
diff --git a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c
index 280b835..c7b5409 100644
--- a/drivers/acpi/namespace/nswalk.c
+++ b/drivers/acpi/namespace/nswalk.c
@@ -77,9 +77,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct
 
 		/* It's really the parent's _scope_ that we want */
 
-		if (parent_node->child) {
-			next_node = parent_node->child;
-		}
+		next_node = parent_node->child;
 	}
 
 	else {
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 09/73] ACPICA: Removed obsolete ACPI_NO_INTEGER64_SUPPORT define
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (6 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 08/73] ACPICA: Removed extraneous code Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 10/73] ACPICA: Misc fixes for recent global lock code update Len Brown
                     ` (63 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acmacros.h |   12 +-----------
 include/acpi/actypes.h  |   23 +++--------------------
 2 files changed, 4 insertions(+), 31 deletions(-)

diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 99d171c..401228d 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -61,21 +61,11 @@
 
 #define ACPI_ARRAY_LENGTH(x)            (sizeof(x) / sizeof((x)[0]))
 
-#ifdef ACPI_NO_INTEGER64_SUPPORT
 /*
- * acpi_integer is 32-bits, no 64-bit support on this platform
- */
-#define ACPI_LODWORD(l)                 ((u32)(l))
-#define ACPI_HIDWORD(l)                 ((u32)(0))
-
-#else
-
-/*
- * Full 64-bit address/integer on both 32-bit and 64-bit platforms
+ * Full 64-bit integer must be available on both 32-bit and 64-bit platforms
  */
 #define ACPI_LODWORD(l)                 ((u32)(u64)(l))
 #define ACPI_HIDWORD(l)                 ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi))
-#endif
 
 /*
  * printf() format helpers
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index e73a389..6182b57 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -323,27 +323,11 @@ struct uint32_struct {
 #define acpi_semaphore                  void *
 
 /*
- * Acpi integer width. In ACPI version 1, integers are
- * 32 bits.  In ACPI version 2, integers are 64 bits.
- * Note that this pertains to the ACPI integer type only, not
- * other integers used in the implementation of the ACPI CA
+ * Acpi integer width. In ACPI version 1, integers are 32 bits.  In ACPI
+ * version 2, integers are 64 bits. Note that this pertains to the ACPI integer
+ * type only, not other integers used in the implementation of the ACPI CA
  * subsystem.
  */
-#ifdef ACPI_NO_INTEGER64_SUPPORT
-
-/* 32-bit integers only, no 64-bit support */
-
-typedef u32 acpi_integer;
-#define ACPI_INTEGER_MAX                ACPI_UINT32_MAX
-#define ACPI_INTEGER_BIT_SIZE           32
-#define ACPI_MAX_DECIMAL_DIGITS         10	/* 2^32 = 4,294,967,296 */
-
-#define ACPI_USE_NATIVE_DIVIDE	/* Use compiler native 32-bit divide */
-
-#else
-
-/* 64-bit integers */
-
 typedef unsigned long long acpi_integer;
 #define ACPI_INTEGER_MAX                ACPI_UINT64_MAX
 #define ACPI_INTEGER_BIT_SIZE           64
@@ -352,7 +336,6 @@ typedef unsigned long long acpi_integer;
 #if ACPI_MACHINE_WIDTH == 64
 #define ACPI_USE_NATIVE_DIVIDE	/* Use compiler native 64-bit divide */
 #endif
-#endif
 
 #define ACPI_MAX64_DECIMAL_DIGITS       20
 #define ACPI_MAX32_DECIMAL_DIGITS       10
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 10/73] ACPICA: Misc fixes for recent global lock code update
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (7 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 09/73] ACPICA: Removed obsolete ACPI_NO_INTEGER64_SUPPORT define Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 11/73] ACPICA: Increase maximum buffer size dumped to screen in buffer object dump Len Brown
                     ` (62 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixes as a result of running full validation test suite.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/events/evxface.c   |    2 +-
 drivers/acpi/executer/exfield.c |    8 ++++----
 drivers/acpi/executer/exmutex.c |   23 ++++++++++++++++++-----
 drivers/acpi/executer/exutils.c |   11 +++++++++--
 include/acpi/acinterp.h         |    2 +-
 5 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index dbf34a5..e210aa2 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -816,7 +816,7 @@ acpi_status acpi_release_global_lock(u32 handle)
 {
 	acpi_status status;
 
-	if (handle != acpi_gbl_global_lock_handle) {
+	if (!handle || (handle != acpi_gbl_global_lock_handle)) {
 		return (AE_NOT_ACQUIRED);
 	}
 
diff --git a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c
index e66b367..da772cb 100644
--- a/drivers/acpi/executer/exfield.c
+++ b/drivers/acpi/executer/exfield.c
@@ -122,7 +122,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
 							     buffer.pointer),
 					       ACPI_READ | (obj_desc->field.
 							    attribute << 16));
-		acpi_ex_release_global_lock();
+		acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
 		goto exit;
 	}
 
@@ -177,7 +177,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
 	/* Read from the field */
 
 	status = acpi_ex_extract_from_field(obj_desc, buffer, (u32) length);
-	acpi_ex_release_global_lock();
+	acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
 
       exit:
 	if (ACPI_FAILURE(status)) {
@@ -284,7 +284,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 					       (acpi_integer *) buffer,
 					       ACPI_WRITE | (obj_desc->field.
 							     attribute << 16));
-		acpi_ex_release_global_lock();
+		acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
 
 		*result_desc = buffer_desc;
 		return_ACPI_STATUS(status);
@@ -364,7 +364,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 	/* Write to the field */
 
 	status = acpi_ex_insert_into_field(obj_desc, buffer, length);
-	acpi_ex_release_global_lock();
+	acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
 
 	/* Free temporary buffer if we used one */
 
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index 32f24a8..b8d035c 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -156,6 +156,10 @@ acpi_ex_acquire_mutex_object(u16 timeout,
 
 	ACPI_FUNCTION_TRACE_PTR(ex_acquire_mutex_object, obj_desc);
 
+	if (!obj_desc) {
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
+	}
+
 	/* Support for multiple acquires by the owning thread */
 
 	if (obj_desc->mutex.thread_id == thread_id) {
@@ -290,6 +294,10 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc)
 
 	ACPI_FUNCTION_TRACE(ex_release_mutex_object);
 
+	if (obj_desc->mutex.acquisition_depth == 0) {
+		return (AE_NOT_ACQUIRED);
+	}
+
 	/* Match multiple Acquires with multiple Releases */
 
 	obj_desc->mutex.acquisition_depth--;
@@ -387,17 +395,22 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 	 */
 	if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) {
 		ACPI_ERROR((AE_INFO,
-			    "Cannot release Mutex [%4.4s], incorrect SyncLevel",
-			    acpi_ut_get_node_name(obj_desc->mutex.node)));
+			    "Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %d current %d",
+			    acpi_ut_get_node_name(obj_desc->mutex.node),
+			    obj_desc->mutex.sync_level,
+			    walk_state->thread->current_sync_level));
 		return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
 	}
 
 	status = acpi_ex_release_mutex_object(obj_desc);
 
-	/* Restore the original sync_level */
+	if (obj_desc->mutex.acquisition_depth == 0) {
+
+		/* Restore the original sync_level */
 
-	walk_state->thread->current_sync_level =
-	    obj_desc->mutex.original_sync_level;
+		walk_state->thread->current_sync_level =
+		    obj_desc->mutex.original_sync_level;
+	}
 	return_ACPI_STATUS(status);
 }
 
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index c40b191..fd543ee 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -278,7 +278,8 @@ void acpi_ex_acquire_global_lock(u32 field_flags)
  *
  * FUNCTION:    acpi_ex_release_global_lock
  *
- * PARAMETERS:  None
+ * PARAMETERS:  field_flags           - Flags with Lock rule:
+ *                                      always_lock or never_lock
  *
  * RETURN:      None
  *
@@ -286,12 +287,18 @@ void acpi_ex_acquire_global_lock(u32 field_flags)
  *
  ******************************************************************************/
 
-void acpi_ex_release_global_lock(void)
+void acpi_ex_release_global_lock(u32 field_flags)
 {
 	acpi_status status;
 
 	ACPI_FUNCTION_TRACE(ex_release_global_lock);
 
+	/* Only use the lock if the always_lock bit is set */
+
+	if (!(field_flags & AML_FIELD_LOCK_RULE_MASK)) {
+		return_VOID;
+	}
+
 	/* Release the global lock */
 
 	status = acpi_ex_release_mutex_object(acpi_gbl_global_lock_mutex);
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index 2386388..92eb014 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -464,7 +464,7 @@ void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
 
 void acpi_ex_acquire_global_lock(u32 rule);
 
-void acpi_ex_release_global_lock(void);
+void acpi_ex_release_global_lock(u32 rule);
 
 void acpi_ex_eisa_id_to_string(u32 numeric_id, char *out_string);
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 11/73] ACPICA: Increase maximum buffer size dumped to screen in buffer object dump
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (8 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 10/73] ACPICA: Misc fixes for recent global lock code update Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 12/73] ACPICA: Fix for package reference counts Len Brown
                     ` (61 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exstore.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index 97cb188..f88b181 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -147,7 +147,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 				      (u32) source_desc->buffer.length));
 		ACPI_DUMP_BUFFER(source_desc->buffer.pointer,
 				 (source_desc->buffer.length <
-				  32) ? source_desc->buffer.length : 32);
+				  256) ? source_desc->buffer.length : 256);
 		break;
 
 	case ACPI_TYPE_STRING:
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 12/73] ACPICA: Fix for package reference counts
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (9 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 11/73] ACPICA: Increase maximum buffer size dumped to screen in buffer object dump Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 13/73] ACPICA: Update version to 20070320 Len Brown
                     ` (60 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Prevents infinite loop of 'Large Reference Count' messages in
aslts-bdemo-b286 test.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsobject.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
index 954ac8c..fe28b9a 100644
--- a/drivers/acpi/dispatcher/dsobject.c
+++ b/drivers/acpi/dispatcher/dsobject.c
@@ -370,6 +370,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 	union acpi_operand_object *obj_desc = NULL;
 	acpi_status status = AE_OK;
 	acpi_native_uint i;
+	u16 index;
+	u16 reference_count;
 
 	ACPI_FUNCTION_TRACE(ds_build_internal_package_obj);
 
@@ -447,6 +449,26 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 							       package.
 							       elements[i]);
 		}
+
+		if (*obj_desc_ptr) {
+
+			/* Existing package, get existing reference count */
+
+			reference_count =
+			    (*obj_desc_ptr)->common.reference_count;
+			if (reference_count > 1) {
+
+				/* Make new element ref count match original ref count */
+
+				for (index = 0; index < (reference_count - 1);
+				     index++) {
+					acpi_ut_add_reference((obj_desc->
+							       package.
+							       elements[i]));
+				}
+			}
+		}
+
 		arg = arg->common.next;
 	}
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 13/73] ACPICA: Update version to 20070320
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (10 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 12/73] ACPICA: Fix for package reference counts Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 14/73] ACPICA: Fix for update of the Global Lock Handle Len Brown
                     ` (59 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

pdate version to 20070320

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index d13bab4..c1829a3 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20070307
+#define ACPI_CA_VERSION                 0x20070320
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 14/73] ACPICA: Fix for update of the Global Lock Handle
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (11 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 13/73] ACPICA: Update version to 20070320 Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 15/73] ACPICA: Update version to 20070508 Len Brown
                     ` (58 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem where the global lock handle was not properly
updated if a thread that acquired the global lock via
executing AML code then attempted to acquire the lock via the
AcpiAcquireGlobalLock interface.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/events/evmisc.c  |   13 +++++++++++++
 drivers/acpi/events/evxface.c |    9 +--------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 2d34663..d075062 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -461,6 +461,19 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
 	acpi_ev_global_lock_acquired++;
 
 	/*
+	 * Update the global lock handle and check for wraparound. The handle is
+	 * only used for the external global lock interfaces, but it is updated
+	 * here to properly handle the case where a single thread may acquire the
+	 * lock via both the AML and the acpi_acquire_global_lock interfaces. The
+	 * handle is therefore updated on the first acquire from a given thread
+	 * regardless of where the acquisition request originated.
+	 */
+	acpi_gbl_global_lock_handle++;
+	if (acpi_gbl_global_lock_handle == 0) {
+		acpi_gbl_global_lock_handle = 1;
+	}
+
+	/*
 	 * Make sure that a global lock actually exists. If not, just treat
 	 * the lock as a standard mutex.
 	 */
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index e210aa2..412cae6 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -782,15 +782,8 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
 					      acpi_os_get_thread_id());
 
 	if (ACPI_SUCCESS(status)) {
-		/*
-		 * If this was the first acquisition of the Global Lock by this thread,
-		 * create a new handle. Otherwise, return the existing handle.
-		 */
-		if (acpi_gbl_global_lock_mutex->mutex.acquisition_depth == 1) {
-			acpi_gbl_global_lock_handle++;
-		}
 
-		/* Return the global lock handle */
+		/* Return the global lock handle (updated in acpi_ev_acquire_global_lock) */
 
 		*handle = acpi_gbl_global_lock_handle;
 	}
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 15/73] ACPICA: Update version to 20070508
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (12 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 14/73] ACPICA: Fix for update of the Global Lock Handle Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:24   ` [PATCH 16/73] ACPICA: Updated error message for dynamic method serialization Len Brown
                     ` (57 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Update version to 20070508.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index c1829a3..a45230d 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20070320
+#define ACPI_CA_VERSION                 0x20070508
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 16/73] ACPICA: Updated error message for dynamic method serialization
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (13 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 15/73] ACPICA: Update version to 20070508 Len Brown
@ 2008-04-12  4:24   ` Len Brown
  2008-04-12  4:25   ` [PATCH 17/73] ACPICA: Support for iASL - multiple files and wildcards Len Brown
                     ` (56 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Added more information to make the message clearer.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/parser/psparse.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
index ce3139a..1442e55 100644
--- a/drivers/acpi/parser/psparse.c
+++ b/drivers/acpi/parser/psparse.c
@@ -532,7 +532,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
 			if ((status == AE_ALREADY_EXISTS) &&
 			    (!walk_state->method_desc->method.mutex)) {
 				ACPI_INFO((AE_INFO,
-					   "Marking method %4.4s as Serialized",
+					   "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
 					   walk_state->method_node->name.
 					   ascii));
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 17/73] ACPICA: Support for iASL - multiple files and wildcards
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (14 preceding siblings ...)
  2008-04-12  4:24   ` [PATCH 16/73] ACPICA: Updated error message for dynamic method serialization Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 18/73] ACPICA: Add minimal disassembly support for the SLIC table Len Brown
                     ` (55 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Implemented support to allow multiple files to be
compiled/disassembled in a single invocation. This includes
command line wildcard support for both the Windows and Unix
versions of the compiler. This feature simplifies the disassembly
and compilation of multiple ACPI tables in a single directory.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/utilities/utinit.c  |    3 +++
 drivers/acpi/utilities/utxface.c |    4 ++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/utilities/utinit.c b/drivers/acpi/utilities/utinit.c
index ad3c0d0..de44477 100644
--- a/drivers/acpi/utilities/utinit.c
+++ b/drivers/acpi/utilities/utinit.c
@@ -125,9 +125,12 @@ void acpi_ut_subsystem_shutdown(void)
 	acpi_gbl_startup_flags = 0;
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
 
+#ifndef ACPI_ASL_COMPILER
+
 	/* Close the acpi_event Handling */
 
 	acpi_ev_terminate();
+#endif
 
 	/* Close the Namespace */
 
diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c
index 2d49691..15bd6ff 100644
--- a/drivers/acpi/utilities/utxface.c
+++ b/drivers/acpi/utilities/utxface.c
@@ -49,6 +49,7 @@
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utxface")
 
+#ifndef ACPI_ASL_COMPILER
 /*******************************************************************************
  *
  * FUNCTION:    acpi_initialize_subsystem
@@ -292,6 +293,7 @@ acpi_status acpi_initialize_objects(u32 flags)
 
 ACPI_EXPORT_SYMBOL(acpi_initialize_objects)
 
+#endif
 /*******************************************************************************
  *
  * FUNCTION:    acpi_terminate
@@ -335,6 +337,7 @@ acpi_status acpi_terminate(void)
 }
 
 ACPI_EXPORT_SYMBOL(acpi_terminate)
+#ifndef ACPI_ASL_COMPILER
 #ifdef ACPI_FUTURE_USAGE
 /*******************************************************************************
  *
@@ -490,3 +493,4 @@ acpi_status acpi_purge_cached_objects(void)
 }
 
 ACPI_EXPORT_SYMBOL(acpi_purge_cached_objects)
+#endif
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 18/73] ACPICA: Add minimal disassembly support for the SLIC table
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (15 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 17/73] ACPICA: Support for iASL - multiple files and wildcards Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 19/73] ACPICA: New interfaces for table event handlers Len Brown
                     ` (54 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

SLIC - Software Licensing Description Table.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acdisasm.h |    1 +
 include/acpi/actbl1.h   |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 389d772..75c354f 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -180,6 +180,7 @@ extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[];
 extern struct acpi_dmtable_info acpi_dm_table_info_rsdp1[];
 extern struct acpi_dmtable_info acpi_dm_table_info_rsdp2[];
 extern struct acpi_dmtable_info acpi_dm_table_info_sbst[];
+extern struct acpi_dmtable_info acpi_dm_table_info_slic[];
 extern struct acpi_dmtable_info acpi_dm_table_info_slit[];
 extern struct acpi_dmtable_info acpi_dm_table_info_spcr[];
 extern struct acpi_dmtable_info acpi_dm_table_info_spmi[];
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index a1b1b2e..dd8e11e 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -67,6 +67,7 @@
 #define ACPI_SIG_MADT           "APIC"	/* Multiple APIC Description Table */
 #define ACPI_SIG_MCFG           "MCFG"	/* PCI Memory Mapped Configuration table */
 #define ACPI_SIG_SBST           "SBST"	/* Smart Battery Specification Table */
+#define ACPI_SIG_SLIC           "SLIC"	/* Software Licensing Description Table */
 #define ACPI_SIG_SLIT           "SLIT"	/* System Locality Distance Information Table */
 #define ACPI_SIG_SPCR           "SPCR"	/* Serial Port Console Redirection table */
 #define ACPI_SIG_SPMI           "SPMI"	/* Server Platform Management Interface table */
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 19/73] ACPICA: New interfaces for table event handlers
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (16 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 18/73] ACPICA: Add minimal disassembly support for the SLIC table Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 20/73] ACPICA: Fix for namespace lookup problem Len Brown
                     ` (53 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Designed and implemented new external interfaces to install and
remove handlers for ACPI table-related events. Current events that
are defined are LOAD and UNLOAD. These interfaces allow the host to
track ACPI tables as they are dynamically loaded and unloaded. See
AcpiInstallTableHandler and AcpiRemoveTableHandler. (Lin Ming
and Bob Moore)

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exconfig.c  |   29 ++++++++++++-
 drivers/acpi/tables/tbxface.c     |   89 +++++++++++++++++++++++++++++++++++++
 drivers/acpi/utilities/utglobal.c |    3 +-
 include/acpi/acdisasm.h           |    4 +-
 include/acpi/acglobal.h           |    2 +
 include/acpi/acpixf.h             |    5 ++
 include/acpi/actypes.h            |   11 +++++
 7 files changed, 139 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 25802f3..009aef5 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -234,6 +234,13 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
 			   table->oem_table_id));
 	}
 
+	/* Invoke table handler if present */
+
+	if (acpi_gbl_table_handler) {
+		(void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table,
+					     acpi_gbl_table_handler_context);
+	}
+
 	*return_desc = ddb_handle;
 	return_ACPI_STATUS(status);
 }
@@ -352,6 +359,14 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 		return_ACPI_STATUS(status);
 	}
 
+	/* Invoke table handler if present */
+
+	if (acpi_gbl_table_handler) {
+		(void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD,
+					     table_desc.pointer,
+					     acpi_gbl_table_handler_context);
+	}
+
       cleanup:
 	if (ACPI_FAILURE(status)) {
 		acpi_tb_delete_table(&table_desc);
@@ -376,6 +391,7 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)
 	acpi_status status = AE_OK;
 	union acpi_operand_object *table_desc = ddb_handle;
 	acpi_native_uint table_index;
+	struct acpi_table_header *table;
 
 	ACPI_FUNCTION_TRACE(ex_unload_table);
 
@@ -395,6 +411,17 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)
 
 	table_index = (acpi_native_uint) table_desc->reference.object;
 
+	/* Invoke table handler if present */
+
+	if (acpi_gbl_table_handler) {
+		status = acpi_get_table_by_index(table_index, &table);
+		if (ACPI_SUCCESS(status)) {
+			(void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_UNLOAD,
+						     table,
+						     acpi_gbl_table_handler_context);
+		}
+	}
+
 	/*
 	 * Delete the entire namespace under this table Node
 	 * (Offset contains the table_id)
@@ -407,5 +434,5 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)
 	/* Delete the table descriptor (ddb_handle) */
 
 	acpi_ut_remove_reference(table_desc);
-	return_ACPI_STATUS(status);
+	return_ACPI_STATUS(AE_OK);
 }
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c
index a9e3331..5f22715 100644
--- a/drivers/acpi/tables/tbxface.c
+++ b/drivers/acpi/tables/tbxface.c
@@ -635,6 +635,95 @@ acpi_status acpi_load_tables(void)
 ACPI_EXPORT_SYMBOL(acpi_load_tables)
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_install_table_handler
+ *
+ * PARAMETERS:  Handler         - Table event handler
+ *              Context         - Value passed to the handler on each event
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Install table event handler
+ *
+ ******************************************************************************/
+acpi_status
+acpi_install_table_handler(acpi_tbl_handler handler, void *context)
+{
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE(acpi_install_table_handler);
+
+	if (!handler) {
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
+	}
+
+	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	/* Don't allow more than one handler */
+
+	if (acpi_gbl_table_handler) {
+		status = AE_ALREADY_EXISTS;
+		goto cleanup;
+	}
+
+	/* Install the handler */
+
+	acpi_gbl_table_handler = handler;
+	acpi_gbl_table_handler_context = context;
+
+      cleanup:
+	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+	return_ACPI_STATUS(status);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_install_table_handler)
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_remove_table_handler
+ *
+ * PARAMETERS:  Handler         - Table event handler that was installed
+ *                                previously.
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Remove table event handler
+ *
+ ******************************************************************************/
+acpi_status acpi_remove_table_handler(acpi_tbl_handler handler)
+{
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE(acpi_remove_table_handler);
+
+	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	/* Make sure that the installed handler is the same */
+
+	if (!handler || handler != acpi_gbl_table_handler) {
+		status = AE_BAD_PARAMETER;
+		goto cleanup;
+	}
+
+	/* Remove the handler */
+
+	acpi_gbl_table_handler = NULL;
+
+      cleanup:
+	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+	return_ACPI_STATUS(status);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_remove_table_handler)
+
+
 static int __init acpi_no_auto_ssdt_setup(char *s) {
 
         printk(KERN_NOTICE "ACPI: SSDT auto-load disabled\n");
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 630c9a2..4442543 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -675,12 +675,13 @@ void acpi_ut_init_globals(void)
 	acpi_gbl_gpe_fadt_blocks[0] = NULL;
 	acpi_gbl_gpe_fadt_blocks[1] = NULL;
 
-	/* Global notify handlers */
+	/* Global handlers */
 
 	acpi_gbl_system_notify.handler = NULL;
 	acpi_gbl_device_notify.handler = NULL;
 	acpi_gbl_exception_handler = NULL;
 	acpi_gbl_init_handler = NULL;
+	acpi_gbl_table_handler = NULL;
 
 	/* Global Lock support */
 
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 75c354f..67d152e 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -104,12 +104,12 @@ typedef const struct acpi_dmtable_info {
 #define ACPI_DMT_SIG                    27
 
 typedef
-void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table);
+void (*acpi_dmtable_handler) (struct acpi_table_header * table);
 
 struct acpi_dmtable_data {
 	char *signature;
 	struct acpi_dmtable_info *table_info;
-	ACPI_TABLE_HANDLER table_handler;
+	acpi_dmtable_handler table_handler;
 	char *name;
 };
 
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 44e718e..8624686 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -217,6 +217,8 @@ ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify;
 ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify;
 ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler;
 ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
+ACPI_EXTERN acpi_tbl_handler acpi_gbl_table_handler;
+ACPI_EXTERN void *acpi_gbl_table_handler_context;
 ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
 
 /* Owner ID support */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index d970f7f..c92acda 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -119,6 +119,11 @@ acpi_status
 acpi_get_table_by_index(acpi_native_uint table_index,
 			struct acpi_table_header **out_table);
 
+acpi_status
+acpi_install_table_handler(acpi_tbl_handler handler, void *context);
+
+acpi_status acpi_remove_table_handler(acpi_tbl_handler handler);
+
 /*
  * Namespace and name interfaces
  */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 6182b57..766178c 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -730,6 +730,12 @@ struct acpi_system_info {
 	u32 debug_layer;
 };
 
+/* Table Event Types */
+
+#define ACPI_TABLE_EVENT_LOAD           0x0
+#define ACPI_TABLE_EVENT_UNLOAD         0x1
+#define ACPI_NUM_TABLE_EVENTS           2
+
 /*
  * Types specific to the OS service interfaces
  */
@@ -759,6 +765,11 @@ acpi_status(*acpi_exception_handler) (acpi_status aml_status,
 				      u16 opcode,
 				      u32 aml_offset, void *context);
 
+/* Table Event handler (Load, load_table etc) and types */
+
+typedef
+acpi_status(*acpi_tbl_handler) (u32 event, void *table, void *context);
+
 /* Address Spaces (For Operation Regions) */
 
 typedef
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 20/73] ACPICA: Fix for namespace lookup problem
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (17 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 19/73] ACPICA: New interfaces for table event handlers Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 21/73] ACPICA: update version number to 20070919 Len Brown
                     ` (52 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem where objects of certain types (Device,
ThermalZone, Processor, PowerResource) can be not found if they
are declared and referenced from within the same control method
(Lin Ming) BZ 341.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/parser/psargs.c |   24 ++++++++----------------
 1 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/acpi/parser/psargs.c b/drivers/acpi/parser/psargs.c
index c2b9835..442880f 100644
--- a/drivers/acpi/parser/psargs.c
+++ b/drivers/acpi/parser/psargs.c
@@ -230,12 +230,11 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
 			  struct acpi_parse_state *parser_state,
 			  union acpi_parse_object *arg, u8 possible_method_call)
 {
+	acpi_status status;
 	char *path;
 	union acpi_parse_object *name_op;
-	acpi_status status;
 	union acpi_operand_object *method_desc;
 	struct acpi_namespace_node *node;
-	union acpi_generic_state scope_info;
 
 	ACPI_FUNCTION_TRACE(ps_get_next_namepath);
 
@@ -249,25 +248,18 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
 		return_ACPI_STATUS(AE_OK);
 	}
 
-	/* Setup search scope info */
-
-	scope_info.scope.node = NULL;
-	node = parser_state->start_node;
-	if (node) {
-		scope_info.scope.node = node;
-	}
-
 	/*
-	 * Lookup the name in the internal namespace. We don't want to add
-	 * anything new to the namespace here, however, so we use MODE_EXECUTE.
+	 * Lookup the name in the internal namespace, starting with the current
+	 * scope. We don't want to add anything new to the namespace here,
+	 * however, so we use MODE_EXECUTE.
 	 * Allow searching of the parent tree, but don't open a new scope -
 	 * we just want to lookup the object (must be mode EXECUTE to perform
 	 * the upsearch)
 	 */
-	status =
-	    acpi_ns_lookup(&scope_info, path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
-			   ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
-			   NULL, &node);
+	status = acpi_ns_lookup(walk_state->scope_info, path,
+				ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+				ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
+				NULL, &node);
 
 	/*
 	 * If this name is a control method invocation, we must
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 21/73] ACPICA: update version number to 20070919
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (18 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 20/73] ACPICA: Fix for namespace lookup problem Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 22/73] ACPICA: Fix for Alias operator to see target child objects Len Brown
                     ` (51 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index a45230d..6581500 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20070508
+#define ACPI_CA_VERSION                 0x20070919
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 22/73] ACPICA: Fix for Alias operator to see target child objects
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (19 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 21/73] ACPICA: update version number to 20070919 Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 23/73] ACPICA: Fix for fault if Load() fails Len Brown
                     ` (50 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem with the Alias operator when the target of the
alias is a named ASL operator that opens a new scope -- Scope,
Device, PowerResource, Processor, and ThermalZone. In these cases,
any children of the original operator could not be accessed via
the alias, potentially causing unexpected AE_NOT_FOUND exceptions.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/excreate.c  |   20 ++++++--
 drivers/acpi/namespace/nsaccess.c |   96 +++++++++++++++++++++++--------------
 2 files changed, 75 insertions(+), 41 deletions(-)

diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c
index 6e9a23e..b391439 100644
--- a/drivers/acpi/executer/excreate.c
+++ b/drivers/acpi/executer/excreate.c
@@ -96,6 +96,9 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
 	 * to the original Node.
 	 */
 	switch (target_node->type) {
+
+		/* For these types, the sub-object can change dynamically via a Store */
+
 	case ACPI_TYPE_INTEGER:
 	case ACPI_TYPE_STRING:
 	case ACPI_TYPE_BUFFER:
@@ -103,9 +106,18 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
 	case ACPI_TYPE_BUFFER_FIELD:
 
 		/*
+		 * These types open a new scope, so we need the NS node in order to access
+		 * any children.
+		 */
+	case ACPI_TYPE_DEVICE:
+	case ACPI_TYPE_POWER:
+	case ACPI_TYPE_PROCESSOR:
+	case ACPI_TYPE_THERMAL:
+	case ACPI_TYPE_LOCAL_SCOPE:
+
+		/*
 		 * The new alias has the type ALIAS and points to the original
-		 * NS node, not the object itself.  This is because for these
-		 * types, the object can change dynamically via a Store.
+		 * NS node, not the object itself.
 		 */
 		alias_node->type = ACPI_TYPE_LOCAL_ALIAS;
 		alias_node->object =
@@ -115,9 +127,7 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
 	case ACPI_TYPE_METHOD:
 
 		/*
-		 * The new alias has the type ALIAS and points to the original
-		 * NS node, not the object itself.  This is because for these
-		 * types, the object can change dynamically via a Store.
+		 * Control method aliases need to be differentiated
 		 */
 		alias_node->type = ACPI_TYPE_LOCAL_METHOD_ALIAS;
 		alias_node->object =
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c
index 32a0167..54852fb 100644
--- a/drivers/acpi/namespace/nsaccess.c
+++ b/drivers/acpi/namespace/nsaccess.c
@@ -581,44 +581,68 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
 			return_ACPI_STATUS(status);
 		}
 
-		/*
-		 * Sanity typecheck of the target object:
-		 *
-		 * If 1) This is the last segment (num_segments == 0)
-		 *    2) And we are looking for a specific type
-		 *       (Not checking for TYPE_ANY)
-		 *    3) Which is not an alias
-		 *    4) Which is not a local type (TYPE_SCOPE)
-		 *    5) And the type of target object is known (not TYPE_ANY)
-		 *    6) And target object does not match what we are looking for
-		 *
-		 * Then we have a type mismatch.  Just warn and ignore it.
-		 */
-		if ((num_segments == 0) &&
-		    (type_to_check_for != ACPI_TYPE_ANY) &&
-		    (type_to_check_for != ACPI_TYPE_LOCAL_ALIAS) &&
-		    (type_to_check_for != ACPI_TYPE_LOCAL_METHOD_ALIAS) &&
-		    (type_to_check_for != ACPI_TYPE_LOCAL_SCOPE) &&
-		    (this_node->type != ACPI_TYPE_ANY) &&
-		    (this_node->type != type_to_check_for)) {
-
-			/* Complain about a type mismatch */
-
-			ACPI_WARNING((AE_INFO,
-				      "NsLookup: Type mismatch on %4.4s (%s), searching for (%s)",
-				      ACPI_CAST_PTR(char, &simple_name),
-				      acpi_ut_get_type_name(this_node->type),
-				      acpi_ut_get_type_name
-				      (type_to_check_for)));
+		/* More segments to follow? */
+
+		if (num_segments > 0) {
+			/*
+			 * If we have an alias to an object that opens a scope (such as a
+			 * device or processor), we need to dereference the alias here so that
+			 * we can access any children of the original node (via the remaining
+			 * segments).
+			 */
+			if (this_node->type == ACPI_TYPE_LOCAL_ALIAS) {
+				if (acpi_ns_opens_scope
+				    (((struct acpi_namespace_node *)this_node->
+				      object)->type)) {
+					this_node =
+					    (struct acpi_namespace_node *)
+					    this_node->object;
+				}
+			}
 		}
 
-		/*
-		 * If this is the last name segment and we are not looking for a
-		 * specific type, but the type of found object is known, use that type
-		 * to see if it opens a scope.
-		 */
-		if ((num_segments == 0) && (type == ACPI_TYPE_ANY)) {
-			type = this_node->type;
+		/* Special handling for the last segment (num_segments == 0) */
+
+		else {
+			/*
+			 * Sanity typecheck of the target object:
+			 *
+			 * If 1) This is the last segment (num_segments == 0)
+			 *    2) And we are looking for a specific type
+			 *       (Not checking for TYPE_ANY)
+			 *    3) Which is not an alias
+			 *    4) Which is not a local type (TYPE_SCOPE)
+			 *    5) And the type of target object is known (not TYPE_ANY)
+			 *    6) And target object does not match what we are looking for
+			 *
+			 * Then we have a type mismatch. Just warn and ignore it.
+			 */
+			if ((type_to_check_for != ACPI_TYPE_ANY) &&
+			    (type_to_check_for != ACPI_TYPE_LOCAL_ALIAS) &&
+			    (type_to_check_for != ACPI_TYPE_LOCAL_METHOD_ALIAS)
+			    && (type_to_check_for != ACPI_TYPE_LOCAL_SCOPE)
+			    && (this_node->type != ACPI_TYPE_ANY)
+			    && (this_node->type != type_to_check_for)) {
+
+				/* Complain about a type mismatch */
+
+				ACPI_WARNING((AE_INFO,
+					      "NsLookup: Type mismatch on %4.4s (%s), searching for (%s)",
+					      ACPI_CAST_PTR(char, &simple_name),
+					      acpi_ut_get_type_name(this_node->
+								    type),
+					      acpi_ut_get_type_name
+					      (type_to_check_for)));
+			}
+
+			/*
+			 * If this is the last name segment and we are not looking for a
+			 * specific type, but the type of found object is known, use that type
+			 * to (later) see if it opens a scope.
+			 */
+			if (type == ACPI_TYPE_ANY) {
+				type = this_node->type;
+			}
 		}
 
 		/* Point to next name segment and make this node current */
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 23/73] ACPICA: Fix for fault if Load() fails
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (20 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 22/73] ACPICA: Fix for Alias operator to see target child objects Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 24/73] ACPICA: Fix a fault when storing DdbHandle to Debug object Len Brown
                     ` (49 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem with the Load operator when loading a table from
a buffer object. The input buffer was prematurely zeroed and/or
deleted. (BZ 577)

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exconfig.c |   35 ++++++++++++++++++++++++-----------
 drivers/acpi/tables/tbinstal.c   |   21 ++++++++++++++-------
 drivers/acpi/utilities/utdebug.c |    5 +++++
 3 files changed, 43 insertions(+), 18 deletions(-)

diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 009aef5..8cc410c 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -285,16 +285,16 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 	switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
 	case ACPI_TYPE_REGION:
 
+		ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Load from Region %p %s\n",
+				  obj_desc,
+				  acpi_ut_get_object_type_name(obj_desc)));
+
 		/* Region must be system_memory (from ACPI spec) */
 
 		if (obj_desc->region.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) {
 			return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
 		}
 
-		ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Load from Region %p %s\n",
-				  obj_desc,
-				  acpi_ut_get_object_type_name(obj_desc)));
-
 		/*
 		 * If the Region Address and Length have not been previously evaluated,
 		 * evaluate them now and save the results.
@@ -306,6 +306,11 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 			}
 		}
 
+		/*
+		 * We will simply map the memory region for the table. However, the
+		 * memory region is technically not guaranteed to remain stable and
+		 * we may eventually have to copy the table to a local buffer.
+		 */
 		table_desc.address = obj_desc->region.address;
 		table_desc.length = obj_desc->region.length;
 		table_desc.flags = ACPI_TABLE_ORIGIN_MAPPED;
@@ -313,18 +318,23 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 
 	case ACPI_TYPE_BUFFER:	/* Buffer or resolved region_field */
 
-		/* Simply extract the buffer from the buffer object */
-
 		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
 				  "Load from Buffer or Field %p %s\n", obj_desc,
 				  acpi_ut_get_object_type_name(obj_desc)));
 
-		table_desc.pointer = ACPI_CAST_PTR(struct acpi_table_header,
-						   obj_desc->buffer.pointer);
-		table_desc.length = table_desc.pointer->length;
-		table_desc.flags = ACPI_TABLE_ORIGIN_ALLOCATED;
+		/*
+		 * We need to copy the buffer since the original buffer could be
+		 * changed or deleted in the future
+		 */
+		table_desc.pointer = ACPI_ALLOCATE(obj_desc->buffer.length);
+		if (!table_desc.pointer) {
+			return_ACPI_STATUS(AE_NO_MEMORY);
+		}
 
-		obj_desc->buffer.pointer = NULL;
+		ACPI_MEMCPY(table_desc.pointer, obj_desc->buffer.pointer,
+			    obj_desc->buffer.length);
+		table_desc.length = obj_desc->buffer.length;
+		table_desc.flags = ACPI_TABLE_ORIGIN_ALLOCATED;
 		break;
 
 	default:
@@ -369,6 +379,9 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 
       cleanup:
 	if (ACPI_FAILURE(status)) {
+
+		/* Delete allocated buffer or mapping */
+
 		acpi_tb_delete_table(&table_desc);
 	}
 	return_ACPI_STATUS(status);
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 3bc0c67..6a6ee1f 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -125,13 +125,20 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc,
 
 	/* The table must be either an SSDT or a PSDT or an OEMx */
 
-	if ((!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT))
-	    &&
-	    (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))
-	    && (strncmp(table_desc->pointer->signature, "OEM", 3))) {
-		ACPI_ERROR((AE_INFO,
-			    "Table has invalid signature [%4.4s], must be SSDT, PSDT or OEMx",
-			    table_desc->pointer->signature));
+	if (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT)&&
+	    !ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)&&
+	    strncmp(table_desc->pointer->signature, "OEM", 3)) {
+		/* Check for a printable name */
+		if (acpi_ut_valid_acpi_name(
+			*(u32 *) table_desc->pointer->signature)) {
+			ACPI_ERROR((AE_INFO, "Table has invalid signature "
+					"[%4.4s], must be SSDT or PSDT",
+				    table_desc->pointer->signature));
+		} else {
+			ACPI_ERROR((AE_INFO, "Table has invalid signature "
+					"(0x%8.8X), must be SSDT or PSDT",
+				    *(u32 *) table_desc->pointer->signature));
+		}
 		return_ACPI_STATUS(AE_BAD_SIGNATURE);
 	}
 
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index 7361204..a914867 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -524,6 +524,11 @@ void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
 	u32 temp32;
 	u8 buf_char;
 
+	if (!buffer) {
+		acpi_os_printf("Null Buffer Pointer in DumpBuffer!\n");
+		return;
+	}
+
 	if ((count < 4) || (count & 0x01)) {
 		display = DB_BYTE_DISPLAY;
 	}
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 24/73] ACPICA: Fix a fault when storing DdbHandle to Debug object
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (21 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 23/73] ACPICA: Fix for fault if Load() fails Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 25/73] ACPICA: Fix for memory leak related to DdbHandle objects Len Brown
                     ` (48 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem with the Debug object where a store of a DdbHandle
reference object to the Debug object could cause a fault.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exstore.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index f88b181..912889e 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -123,6 +123,8 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 		return_VOID;
 	}
 
+	/* source_desc is of type ACPI_DESC_TYPE_OPERAND */
+
 	switch (ACPI_GET_OBJECT_TYPE(source_desc)) {
 	case ACPI_TYPE_INTEGER:
 
@@ -180,11 +182,19 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 					      (source_desc->reference.opcode),
 					      source_desc->reference.offset));
 		} else {
-			ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[%s]\n",
+			ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[%s]",
 					      acpi_ps_get_opcode_name
 					      (source_desc->reference.opcode)));
 		}
 
+		if (source_desc->reference.opcode == AML_LOAD_OP) {	/* Load and load_table */
+			ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
+					      " Table OwnerId %X\n",
+					      source_desc->reference.object));
+			break;
+		}
+
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "\n"));
 		if (source_desc->reference.object) {
 			if (ACPI_GET_DESCRIPTOR_TYPE
 			    (source_desc->reference.object) ==
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 25/73] ACPICA: Fix for memory leak related to DdbHandle objects
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (22 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 24/73] ACPICA: Fix a fault when storing DdbHandle to Debug object Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 26/73] ACPICA: Add a table checksum verify for Load operator Len Brown
                     ` (47 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a memory leak where DdbHandle objects were not deleted
automatically at control method exit.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exconfig.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 8cc410c..a0f34b4 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -366,6 +366,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 
 		/* table_ptr was deallocated above */
 
+		acpi_ut_remove_reference(ddb_handle);
 		return_ACPI_STATUS(status);
 	}
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 26/73] ACPICA: Add a table checksum verify for Load operator
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (23 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 25/73] ACPICA: Fix for memory leak related to DdbHandle objects Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 27/73] ACPICA: Add error checks to prevent faults Len Brown
                     ` (46 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Added a table checksum verification for the Load operator, in
the case where the load is from a buffer. (BZ 578).

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exconfig.c |   24 +++++++++++++++++++++---
 drivers/acpi/tables/tbutils.c    |    2 +-
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index a0f34b4..dbf1e6f 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -275,6 +275,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 	struct acpi_table_desc table_desc;
 	acpi_native_uint table_index;
 	acpi_status status;
+	u32 length;
 
 	ACPI_FUNCTION_TRACE(ex_load_op);
 
@@ -322,18 +323,35 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 				  "Load from Buffer or Field %p %s\n", obj_desc,
 				  acpi_ut_get_object_type_name(obj_desc)));
 
+		length = obj_desc->buffer.length;
+
+		/* Must have at least an ACPI table header */
+
+		if (length < sizeof(struct acpi_table_header)) {
+			return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
+		}
+
+		/* Validate checksum here. It won't get validated in tb_add_table */
+
+		status = acpi_tb_verify_checksum((struct acpi_table_header *)
+						 obj_desc->buffer.pointer,
+						 length);
+		if (ACPI_FAILURE(status)) {
+			return_ACPI_STATUS(status);
+		}
+
 		/*
 		 * We need to copy the buffer since the original buffer could be
 		 * changed or deleted in the future
 		 */
-		table_desc.pointer = ACPI_ALLOCATE(obj_desc->buffer.length);
+		table_desc.pointer = ACPI_ALLOCATE(length);
 		if (!table_desc.pointer) {
 			return_ACPI_STATUS(AE_NO_MEMORY);
 		}
 
 		ACPI_MEMCPY(table_desc.pointer, obj_desc->buffer.pointer,
-			    obj_desc->buffer.length);
-		table_desc.length = obj_desc->buffer.length;
+			    length);
+		table_desc.length = length;
 		table_desc.flags = ACPI_TABLE_ORIGIN_ALLOCATED;
 		break;
 
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index 010f196..d04442f 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -212,7 +212,7 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length)
 
 	if (checksum) {
 		ACPI_WARNING((AE_INFO,
-			      "Incorrect checksum in table [%4.4s] -  %2.2X, should be %2.2X",
+			      "Incorrect checksum in table [%4.4s] - %2.2X, should be %2.2X",
 			      table->signature, table->checksum,
 			      (u8) (table->checksum - checksum)));
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 27/73] ACPICA: Add error checks to prevent faults
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (24 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 26/73] ACPICA: Add a table checksum verify for Load operator Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 28/73] ACPICA: Fix for Load/LoadTable to specify load location Len Brown
                     ` (45 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Added additional error checking to prevent run-time faults.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exstore.c  |   12 ++++++++++--
 drivers/acpi/namespace/nsnames.c |    6 ++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index 912889e..d860f9c 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -209,8 +209,16 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 							object, level + 4, 0);
 			}
 		} else if (source_desc->reference.node) {
-			acpi_ex_do_debug_object((source_desc->reference.node)->
-						object, level + 4, 0);
+			if (ACPI_GET_DESCRIPTOR_TYPE
+			    (source_desc->reference.node) !=
+			    ACPI_DESC_TYPE_NAMED) {
+				ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
+						      " %p - Not a valid namespace node\n"));
+			} else {
+				acpi_ex_do_debug_object((source_desc->reference.
+							 node)->object,
+							level + 4, 0);
+			}
 		}
 		break;
 
diff --git a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c
index cbd94af..e14a141 100644
--- a/drivers/acpi/namespace/nsnames.c
+++ b/drivers/acpi/namespace/nsnames.c
@@ -180,6 +180,12 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node)
 	next_node = node;
 
 	while (next_node && (next_node != acpi_gbl_root_node)) {
+		if (ACPI_GET_DESCRIPTOR_TYPE(next_node) != ACPI_DESC_TYPE_NAMED) {
+			ACPI_ERROR((AE_INFO,
+				    "Invalid NS Node (%X) while traversing path",
+				    next_node));
+			return 0;
+		}
 		size += ACPI_PATH_SEGMENT_LENGTH;
 		next_node = acpi_ns_get_parent_node(next_node);
 	}
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 28/73] ACPICA: Fix for Load/LoadTable to specify load location
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (25 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 27/73] ACPICA: Add error checks to prevent faults Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 29/73] ACPICA: Fixed a memory leak when Device or Thermal objects referenced in packages Len Brown
                     ` (44 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem with the Load and LoadTable operators where
the table location within the namespace was ignored. Instead,
the table was always loaded into the root or current scope.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exconfig.c |    3 ++-
 drivers/acpi/namespace/nsload.c  |    2 +-
 drivers/acpi/namespace/nsparse.c |   18 +++++++++++++++---
 include/acpi/acnamesp.h          |    3 ++-
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index dbf1e6f..b9543a7 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -368,7 +368,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 	}
 
 	status =
-	    acpi_ex_add_table(table_index, acpi_gbl_root_node, &ddb_handle);
+	    acpi_ex_add_table(table_index, walk_state->scope_info->scope.node,
+			      &ddb_handle);
 	if (ACPI_FAILURE(status)) {
 
 		/* On error, table_ptr was deallocated above */
diff --git a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c
index d4f9654..545010d 100644
--- a/drivers/acpi/namespace/nsload.c
+++ b/drivers/acpi/namespace/nsload.c
@@ -107,7 +107,7 @@ acpi_ns_load_table(acpi_native_uint table_index,
 		goto unlock;
 	}
 
-	status = acpi_ns_parse_table(table_index, node->child);
+	status = acpi_ns_parse_table(table_index, node);
 	if (ACPI_SUCCESS(status)) {
 		acpi_tb_set_table_loaded_flag(table_index, TRUE);
 	} else {
diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c
index e696aa8..86bd6e5 100644
--- a/drivers/acpi/namespace/nsparse.c
+++ b/drivers/acpi/namespace/nsparse.c
@@ -64,7 +64,8 @@ ACPI_MODULE_NAME("nsparse")
  ******************************************************************************/
 acpi_status
 acpi_ns_one_complete_parse(acpi_native_uint pass_number,
-			   acpi_native_uint table_index)
+			   acpi_native_uint table_index,
+			   struct acpi_namespace_node * start_node)
 {
 	union acpi_parse_object *parse_root;
 	acpi_status status;
@@ -121,6 +122,13 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number,
 		return_ACPI_STATUS(status);
 	}
 
+	/* start_node is the default location to load the table */
+
+	if (start_node && start_node != acpi_gbl_root_node) {
+		acpi_ds_scope_stack_push(start_node, ACPI_TYPE_METHOD,
+					 walk_state);
+	}
+
 	/* Parse the AML */
 
 	ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "*PARSE* pass %d parse\n",
@@ -163,7 +171,9 @@ acpi_ns_parse_table(acpi_native_uint table_index,
 	 * performs another complete parse of the AML.
 	 */
 	ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n"));
-	status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, table_index);
+	status =
+	    acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, table_index,
+				       start_node);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
@@ -178,7 +188,9 @@ acpi_ns_parse_table(acpi_native_uint table_index,
 	 * parse objects are all cached.
 	 */
 	ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n"));
-	status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, table_index);
+	status =
+	    acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, table_index,
+				       start_node);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index 5ef38a6..1cad10b 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -113,7 +113,8 @@ acpi_ns_parse_table(acpi_native_uint table_index,
 
 acpi_status
 acpi_ns_one_complete_parse(acpi_native_uint pass_number,
-			   acpi_native_uint table_index);
+			   acpi_native_uint table_index,
+			   struct acpi_namespace_node *start_node);
 
 /*
  * nsaccess - Top-level namespace access
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 29/73] ACPICA: Fixed a memory leak when Device or Thermal objects referenced in packages
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (26 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 28/73] ACPICA: Fix for Load/LoadTable to specify load location Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 30/73] ACPICA: Fix for Increment/Decrement operator, incorrect type change Len Brown
                     ` (43 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Problem introduced in fix for Package references.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsobject.c |   38 +++++++++++++++++++----------------
 drivers/acpi/utilities/utdelete.c  |    8 ++++--
 2 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
index fe28b9a..7556d91 100644
--- a/drivers/acpi/dispatcher/dsobject.c
+++ b/drivers/acpi/dispatcher/dsobject.c
@@ -172,7 +172,19 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
 			switch (op->common.node->type) {
 				/*
 				 * For these types, we need the actual node, not the subobject.
-				 * However, the subobject got an extra reference count above.
+				 * However, the subobject did not get an extra reference count above.
+				 *
+				 * TBD: should ex_resolve_node_to_value be changed to fix this?
+				 */
+			case ACPI_TYPE_DEVICE:
+			case ACPI_TYPE_THERMAL:
+
+				acpi_ut_add_reference(op->common.node->object);
+
+				/*lint -fallthrough */
+				/*
+				 * For these types, we need the actual node, not the subobject.
+				 * The subobject got an extra reference count in ex_resolve_node_to_value.
 				 */
 			case ACPI_TYPE_MUTEX:
 			case ACPI_TYPE_METHOD:
@@ -180,25 +192,15 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
 			case ACPI_TYPE_PROCESSOR:
 			case ACPI_TYPE_EVENT:
 			case ACPI_TYPE_REGION:
-			case ACPI_TYPE_DEVICE:
-			case ACPI_TYPE_THERMAL:
 
-				obj_desc =
-				    (union acpi_operand_object *)op->common.
-				    node;
+				/* We will create a reference object for these types below */
 				break;
 
 			default:
-				break;
-			}
-
-			/*
-			 * If above resolved to an operand object, we are done. Otherwise,
-			 * we have a NS node, we must create the package entry as a named
-			 * reference.
-			 */
-			if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) !=
-			    ACPI_DESC_TYPE_NAMED) {
+				/*
+				 * All other types - the node was resolved to an actual
+				 * object, we are done.
+				 */
 				goto exit;
 			}
 		}
@@ -223,7 +225,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
 
       exit:
 	*obj_desc_ptr = obj_desc;
-	return_ACPI_STATUS(AE_OK);
+	return_ACPI_STATUS(status);
 }
 
 /*******************************************************************************
@@ -743,6 +745,8 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
 				/* Node was saved in Op */
 
 				obj_desc->reference.node = op->common.node;
+				obj_desc->reference.object =
+				    op->common.node->object;
 			}
 
 			obj_desc->reference.opcode = opcode;
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index dcb34f8..6a763cd 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -524,10 +524,12 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 
 		case ACPI_TYPE_LOCAL_REFERENCE:
 			/*
-			 * The target of an Index (a package, string, or buffer) must track
-			 * changes to the ref count of the index.
+			 * The target of an Index (a package, string, or buffer) or a named
+			 * reference must track changes to the ref count of the index or
+			 * target object.
 			 */
-			if (object->reference.opcode == AML_INDEX_OP) {
+			if ((object->reference.opcode == AML_INDEX_OP) ||
+			    (object->reference.opcode == AML_INT_NAMEPATH_OP)) {
 				next_object = object->reference.object;
 			}
 			break;
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 30/73] ACPICA: Fix for Increment/Decrement operator, incorrect type change
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (27 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 29/73] ACPICA: Fixed a memory leak when Device or Thermal objects referenced in packages Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 31/73] ACPICA: Added additional parameter validation for LoadTable Len Brown
                     ` (42 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem with the Increment and Decrement operators where
the type of the target object could be unexpectedly and incorrectly
changed. (BZ 353) Lin Ming.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acopcode.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
index e6f76a2..ab54349 100644
--- a/include/acpi/acopcode.h
+++ b/include/acpi/acopcode.h
@@ -233,7 +233,7 @@
 #define ARGI_CREATE_WORD_FIELD_OP       ARGI_LIST3 (ARGI_BUFFER,     ARGI_INTEGER,       ARGI_REFERENCE)
 #define ARGI_DATA_REGION_OP             ARGI_LIST3 (ARGI_STRING,     ARGI_STRING,        ARGI_STRING)
 #define ARGI_DEBUG_OP                   ARG_NONE
-#define ARGI_DECREMENT_OP               ARGI_LIST1 (ARGI_INTEGER_REF)
+#define ARGI_DECREMENT_OP               ARGI_LIST1 (ARGI_TARGETREF)
 #define ARGI_DEREF_OF_OP                ARGI_LIST1 (ARGI_REF_OR_STRING)
 #define ARGI_DEVICE_OP                  ARGI_INVALID_OPCODE
 #define ARGI_DIVIDE_OP                  ARGI_LIST4 (ARGI_INTEGER,    ARGI_INTEGER,       ARGI_TARGETREF,    ARGI_TARGETREF)
@@ -246,7 +246,7 @@
 #define ARGI_FIND_SET_RIGHT_BIT_OP      ARGI_LIST2 (ARGI_INTEGER,    ARGI_TARGETREF)
 #define ARGI_FROM_BCD_OP                ARGI_LIST2 (ARGI_INTEGER,    ARGI_FIXED_TARGET)
 #define ARGI_IF_OP                      ARGI_INVALID_OPCODE
-#define ARGI_INCREMENT_OP               ARGI_LIST1 (ARGI_INTEGER_REF)
+#define ARGI_INCREMENT_OP               ARGI_LIST1 (ARGI_TARGETREF)
 #define ARGI_INDEX_FIELD_OP             ARGI_INVALID_OPCODE
 #define ARGI_INDEX_OP                   ARGI_LIST3 (ARGI_COMPLEXOBJ, ARGI_INTEGER,       ARGI_TARGETREF)
 #define ARGI_LAND_OP                    ARGI_LIST2 (ARGI_INTEGER,    ARGI_INTEGER)
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 31/73] ACPICA: Added additional parameter validation for LoadTable
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (28 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 30/73] ACPICA: Fix for Increment/Decrement operator, incorrect type change Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 32/73] ACPICA: Update version to 20071019 Len Brown
                     ` (41 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Implemented additional parameter validation for the LoadTable
operator. The length of the input strings SignatureString,
OemIdString, and OemTableId are now checked for maximum
lengths. (BZ 582) Lin Ming.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exconfig.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index b9543a7..3370aad 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -138,6 +138,14 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
 
 	ACPI_FUNCTION_TRACE(ex_load_table_op);
 
+	/* Validate lengths for the signature_string, OEMIDString, OEMtable_iD */
+
+	if ((operand[0]->string.length > ACPI_NAME_SIZE) ||
+	    (operand[1]->string.length > ACPI_OEM_ID_SIZE) ||
+	    (operand[2]->string.length > ACPI_OEM_TABLE_ID_SIZE)) {
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
+	}
+
 	/* Find the ACPI table in the RSDT/XSDT */
 
 	status = acpi_tb_find_table(operand[0]->string.pointer,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 32/73] ACPICA: Update version to 20071019
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (29 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 31/73] ACPICA: Added additional parameter validation for LoadTable Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 33/73] ACPICA: Cosmetic changes only, no functional changes Len Brown
                     ` (40 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Update version to 20071019.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 6581500..a2d4c87 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20070919
+#define ACPI_CA_VERSION                 0x20071019
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 33/73] ACPICA: Cosmetic changes only, no functional changes
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (30 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 32/73] ACPICA: Update version to 20071019 Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 34/73] " Len Brown
                     ` (39 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Lint changes, fix compiler warnings, etc.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/events/evmisc.c      |    7 ++++---
 drivers/acpi/events/evregion.c    |    2 +-
 drivers/acpi/hardware/hwsleep.c   |   14 ++++++++------
 drivers/acpi/namespace/nsdump.c   |    9 +++++----
 drivers/acpi/namespace/nsload.c   |    2 +-
 drivers/acpi/namespace/nsnames.c  |    2 +-
 drivers/acpi/namespace/nsparse.c  |   17 +++++++++++------
 drivers/acpi/resources/rscalc.c   |    6 +++---
 drivers/acpi/resources/rsutils.c  |    6 +++---
 drivers/acpi/utilities/utalloc.c  |    2 +-
 drivers/acpi/utilities/utcopy.c   |    2 +-
 drivers/acpi/utilities/utdebug.c  |   10 ++++------
 drivers/acpi/utilities/utglobal.c |    2 +-
 13 files changed, 44 insertions(+), 37 deletions(-)

diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index d075062..4e7a13a 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -349,9 +349,10 @@ acpi_status acpi_ev_init_global_lock_handler(void)
 
 	ACPI_FUNCTION_TRACE(ev_init_global_lock_handler);
 
-	status =
-	    acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
-				    (struct acpi_table_header **)&facs);
+	status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
+					 ACPI_CAST_INDIRECT_PTR(struct
+								acpi_table_header,
+								&facs));
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
index 58ad097..03624e9 100644
--- a/drivers/acpi/events/evregion.c
+++ b/drivers/acpi/events/evregion.c
@@ -394,7 +394,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
 	ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
 			  "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
 			  &region_obj->region.handler->address_space, handler,
-			  ACPI_FORMAT_UINT64(address),
+			  ACPI_FORMAT_NATIVE_UINT(address),
 			  acpi_ut_get_region_name(region_obj->region.
 						  space_id)));
 
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
index 4290e01..202f11a 100644
--- a/drivers/acpi/hardware/hwsleep.c
+++ b/drivers/acpi/hardware/hwsleep.c
@@ -70,9 +70,10 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address)
 
 	/* Get the FACS */
 
-	status =
-	    acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
-				    (struct acpi_table_header **)&facs);
+	status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
+					 ACPI_CAST_INDIRECT_PTR(struct
+								acpi_table_header,
+								&facs));
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
@@ -124,9 +125,10 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address)
 
 	/* Get the FACS */
 
-	status =
-	    acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
-				    (struct acpi_table_header **)&facs);
+	status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
+					 ACPI_CAST_INDIRECT_PTR(struct
+								acpi_table_header,
+								&facs));
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index 1fc4f86..3068e20 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -249,7 +249,9 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
 			acpi_os_printf("ID %X Len %.4X Addr %p\n",
 				       obj_desc->processor.proc_id,
 				       obj_desc->processor.length,
-				       (char *)obj_desc->processor.address);
+				       ACPI_CAST_PTR(void,
+						     obj_desc->processor.
+						     address));
 			break;
 
 		case ACPI_TYPE_DEVICE:
@@ -320,9 +322,8 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
 							       space_id));
 			if (obj_desc->region.flags & AOPOBJ_DATA_VALID) {
 				acpi_os_printf(" Addr %8.8X%8.8X Len %.4X\n",
-					       ACPI_FORMAT_UINT64(obj_desc->
-								  region.
-								  address),
+					       ACPI_FORMAT_NATIVE_UINT
+					       (obj_desc->region.address),
 					       obj_desc->region.length);
 			} else {
 				acpi_os_printf
diff --git a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c
index 545010d..1bfcb6f 100644
--- a/drivers/acpi/namespace/nsload.c
+++ b/drivers/acpi/namespace/nsload.c
@@ -111,7 +111,7 @@ acpi_ns_load_table(acpi_native_uint table_index,
 	if (ACPI_SUCCESS(status)) {
 		acpi_tb_set_table_loaded_flag(table_index, TRUE);
 	} else {
-		acpi_tb_release_owner_id(table_index);
+		(void)acpi_tb_release_owner_id(table_index);
 	}
 
       unlock:
diff --git a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c
index e14a141..ba1a4f0 100644
--- a/drivers/acpi/namespace/nsnames.c
+++ b/drivers/acpi/namespace/nsnames.c
@@ -182,7 +182,7 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node)
 	while (next_node && (next_node != acpi_gbl_root_node)) {
 		if (ACPI_GET_DESCRIPTOR_TYPE(next_node) != ACPI_DESC_TYPE_NAMED) {
 			ACPI_ERROR((AE_INFO,
-				    "Invalid NS Node (%X) while traversing path",
+				    "Invalid NS Node (%p) while traversing path",
 				    next_node));
 			return 0;
 		}
diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c
index 86bd6e5..f260b69 100644
--- a/drivers/acpi/namespace/nsparse.c
+++ b/drivers/acpi/namespace/nsparse.c
@@ -112,21 +112,25 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number,
 		aml_start = (u8 *) table + sizeof(struct acpi_table_header);
 		aml_length = table->length - sizeof(struct acpi_table_header);
 		status = acpi_ds_init_aml_walk(walk_state, parse_root, NULL,
-					       aml_start, aml_length, NULL,
-					       (u8) pass_number);
+					       aml_start, (u32) aml_length,
+					       NULL, (u8) pass_number);
 	}
 
 	if (ACPI_FAILURE(status)) {
 		acpi_ds_delete_walk_state(walk_state);
-		acpi_ps_delete_parse_tree(parse_root);
-		return_ACPI_STATUS(status);
+		goto cleanup;
 	}
 
 	/* start_node is the default location to load the table */
 
 	if (start_node && start_node != acpi_gbl_root_node) {
-		acpi_ds_scope_stack_push(start_node, ACPI_TYPE_METHOD,
-					 walk_state);
+		status =
+		    acpi_ds_scope_stack_push(start_node, ACPI_TYPE_METHOD,
+					     walk_state);
+		if (ACPI_FAILURE(status)) {
+			acpi_ds_delete_walk_state(walk_state);
+			goto cleanup;
+		}
 	}
 
 	/* Parse the AML */
@@ -135,6 +139,7 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number,
 			  (unsigned)pass_number));
 	status = acpi_ps_parse_aml(walk_state);
 
+      cleanup:
 	acpi_ps_delete_parse_tree(parse_root);
 	return_ACPI_STATUS(status);
 }
diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index 0dd2ce8..dcc51e9 100644
--- a/drivers/acpi/resources/rscalc.c
+++ b/drivers/acpi/resources/rscalc.c
@@ -73,7 +73,7 @@ acpi_rs_stream_option_length(u32 resource_length, u32 minimum_total_length);
 
 static u8 acpi_rs_count_set_bits(u16 bit_field)
 {
-	u8 bits_set;
+	acpi_native_uint bits_set;
 
 	ACPI_FUNCTION_ENTRY();
 
@@ -81,10 +81,10 @@ static u8 acpi_rs_count_set_bits(u16 bit_field)
 
 		/* Zero the least significant bit that is set */
 
-		bit_field &= (bit_field - 1);
+		bit_field &= (u16) (bit_field - 1);
 	}
 
-	return (bits_set);
+	return ((u8) bits_set);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/resources/rsutils.c b/drivers/acpi/resources/rsutils.c
index 11c0bd7..935a482 100644
--- a/drivers/acpi/resources/rsutils.c
+++ b/drivers/acpi/resources/rsutils.c
@@ -97,17 +97,17 @@ u8 acpi_rs_decode_bitmask(u16 mask, u8 * list)
 u16 acpi_rs_encode_bitmask(u8 * list, u8 count)
 {
 	acpi_native_uint i;
-	u16 mask;
+	acpi_native_uint mask;
 
 	ACPI_FUNCTION_ENTRY();
 
 	/* Encode the list into a single bitmask */
 
 	for (i = 0, mask = 0; i < count; i++) {
-		mask |= (0x0001 << list[i]);
+		mask |= (0x1 << list[i]);
 	}
 
-	return (mask);
+	return ((u16) mask);
 }
 
 /*******************************************************************************
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
index 6e56d5f..181e669 100644
--- a/drivers/acpi/utilities/utalloc.c
+++ b/drivers/acpi/utilities/utalloc.c
@@ -147,7 +147,7 @@ acpi_status acpi_ut_delete_caches(void)
 
 	if (acpi_gbl_display_final_mem_stats) {
 		ACPI_STRCPY(buffer, "MEMORY");
-		acpi_db_display_statistics(buffer);
+		(void)acpi_db_display_statistics(buffer);
 	}
 #endif
 
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 879eaa1..b56953d 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -570,7 +570,7 @@ acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
 
 			/* Truncate package and delete it */
 
-			package_object->package.count = i;
+			package_object->package.count = (u32) i;
 			package_elements[i] = NULL;
 			acpi_ut_remove_reference(package_object);
 			return_ACPI_STATUS(status);
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index a914867..2d6a78f 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -68,9 +68,9 @@ static const char *acpi_ut_trim_function_name(const char *function_name);
 
 void acpi_ut_init_stack_ptr_trace(void)
 {
-	u32 current_sp;
+	acpi_size current_sp;
 
-	acpi_gbl_entry_stack_pointer = ACPI_PTR_DIFF(&current_sp, NULL);
+	acpi_gbl_entry_stack_pointer = &current_sp;
 }
 
 /*******************************************************************************
@@ -89,10 +89,8 @@ void acpi_ut_track_stack_ptr(void)
 {
 	acpi_size current_sp;
 
-	current_sp = ACPI_PTR_DIFF(&current_sp, NULL);
-
-	if (current_sp < acpi_gbl_lowest_stack_pointer) {
-		acpi_gbl_lowest_stack_pointer = current_sp;
+	if (&current_sp < acpi_gbl_lowest_stack_pointer) {
+		acpi_gbl_lowest_stack_pointer = &current_sp;
 	}
 
 	if (acpi_gbl_nesting_level > acpi_gbl_deepest_nesting) {
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 4442543..d2097de 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -723,7 +723,7 @@ void acpi_ut_init_globals(void)
 	acpi_gbl_root_node_struct.flags = ANOBJ_END_OF_PEER_LIST;
 
 #ifdef ACPI_DEBUG_OUTPUT
-	acpi_gbl_lowest_stack_pointer = ACPI_SIZE_MAX;
+	acpi_gbl_lowest_stack_pointer = ACPI_CAST_PTR(acpi_size, ACPI_SIZE_MAX);
 #endif
 
 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 34/73] ACPICA: Cosmetic changes only, no functional changes
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (31 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 33/73] ACPICA: Cosmetic changes only, no functional changes Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 35/73] ACPICA: Cleanup of debug output Len Brown
                     ` (38 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Lint changes, fix compiler warnings, etc.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsmethod.c |   38 ++++++++++++++++-------------------
 drivers/acpi/dispatcher/dsobject.c |    4 ++-
 drivers/acpi/dispatcher/dsopcode.c |    2 +-
 drivers/acpi/dispatcher/dsutils.c  |   10 +++-----
 drivers/acpi/dispatcher/dswstate.c |    6 ++--
 drivers/acpi/executer/exconfig.c   |   10 ++++----
 drivers/acpi/executer/exdump.c     |   10 +++++++-
 drivers/acpi/executer/exfldio.c    |    3 +-
 drivers/acpi/executer/exregion.c   |    8 ++++--
 drivers/acpi/executer/exstore.c    |    6 +++-
 drivers/acpi/executer/exsystem.c   |    1 -
 drivers/acpi/executer/exutils.c    |    1 -
 drivers/acpi/parser/psopcode.c     |    3 +-
 include/acpi/acglobal.h            |    8 ++----
 include/acpi/acmacros.h            |   10 +++++++++
 include/acpi/actypes.h             |    2 +
 16 files changed, 69 insertions(+), 53 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index 3db651c..7a99740 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -42,7 +42,6 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/acparser.h>
 #include <acpi/amlcode.h>
 #include <acpi/acdispat.h>
 #include <acpi/acinterp.h>
@@ -102,7 +101,7 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
 						    walk_state->opcode,
 						    walk_state->aml_offset,
 						    NULL);
-		(void)acpi_ex_enter_interpreter();
+		acpi_ex_enter_interpreter();
 	}
 #ifdef ACPI_DISASSEMBLER
 	if (ACPI_FAILURE(status)) {
@@ -535,7 +534,6 @@ void
 acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 				 struct acpi_walk_state *walk_state)
 {
-	acpi_status status;
 
 	ACPI_FUNCTION_TRACE_PTR(ds_terminate_control_method, walk_state);
 
@@ -550,29 +548,27 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 		/* Delete all arguments and locals */
 
 		acpi_ds_method_data_delete_all(walk_state);
-	}
 
-	/*
-	 * If method is serialized, release the mutex and restore the
-	 * current sync level for this thread
-	 */
-	if (method_desc->method.mutex) {
+		/*
+		 * If method is serialized, release the mutex and restore the
+		 * current sync level for this thread
+		 */
+		if (method_desc->method.mutex) {
 
-		/* Acquisition Depth handles recursive calls */
+			/* Acquisition Depth handles recursive calls */
 
-		method_desc->method.mutex->mutex.acquisition_depth--;
-		if (!method_desc->method.mutex->mutex.acquisition_depth) {
-			walk_state->thread->current_sync_level =
-			    method_desc->method.mutex->mutex.
-			    original_sync_level;
+			method_desc->method.mutex->mutex.acquisition_depth--;
+			if (!method_desc->method.mutex->mutex.acquisition_depth) {
+				walk_state->thread->current_sync_level =
+				    method_desc->method.mutex->mutex.
+				    original_sync_level;
 
-			acpi_os_release_mutex(method_desc->method.mutex->mutex.
-					      os_mutex);
-			method_desc->method.mutex->mutex.thread_id = 0;
+				acpi_os_release_mutex(method_desc->method.
+						      mutex->mutex.os_mutex);
+				method_desc->method.mutex->mutex.thread_id = 0;
+			}
 		}
-	}
 
-	if (walk_state) {
 		/*
 		 * Delete any namespace objects created anywhere within
 		 * the namespace by the execution of this method
@@ -613,7 +609,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 		 */
 		if ((method_desc->method.method_flags & AML_METHOD_SERIALIZED)
 		    && (!method_desc->method.mutex)) {
-			status = acpi_ds_create_method_mutex(method_desc);
+			(void)acpi_ds_create_method_mutex(method_desc);
 		}
 
 		/* No more threads, we can free the owner_id */
diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
index 7556d91..58d4d91 100644
--- a/drivers/acpi/dispatcher/dsobject.c
+++ b/drivers/acpi/dispatcher/dsobject.c
@@ -157,7 +157,9 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
 			 * will remain as named references. This behavior is not described
 			 * in the ACPI spec, but it appears to be an oversight.
 			 */
-			obj_desc = (union acpi_operand_object *)op->common.node;
+			obj_desc =
+			    ACPI_CAST_PTR(union acpi_operand_object,
+					  op->common.node);
 
 			status =
 			    acpi_ex_resolve_node_to_value(ACPI_CAST_INDIRECT_PTR
diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
index 0c4630d..f0847ee 100644
--- a/drivers/acpi/dispatcher/dsopcode.c
+++ b/drivers/acpi/dispatcher/dsopcode.c
@@ -770,7 +770,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
 
 	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
 			  obj_desc,
-			  ACPI_FORMAT_UINT64(obj_desc->region.address),
+			  ACPI_FORMAT_NATIVE_UINT(obj_desc->region.address),
 			  obj_desc->region.length));
 
 	/* Now the address and length are valid for this opregion */
diff --git a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c
index 36518b4..97d01dc 100644
--- a/drivers/acpi/dispatcher/dsutils.c
+++ b/drivers/acpi/dispatcher/dsutils.c
@@ -700,10 +700,9 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
 	acpi_status status = AE_OK;
 	union acpi_parse_object *arg;
 	union acpi_parse_object *arguments[ACPI_OBJ_NUM_OPERANDS];
-	u8 arg_count = 0;
-	u8 count = 0;
-	u8 index = walk_state->num_operands;
-	u8 i;
+	u32 arg_count = 0;
+	u32 index = walk_state->num_operands;
+	u32 i;
 
 	ACPI_FUNCTION_TRACE_PTR(ds_create_operands, first_arg);
 
@@ -734,14 +733,13 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
 
 		/* Force the filling of the operand stack in inverse order */
 
-		walk_state->operand_index = index;
+		walk_state->operand_index = (u8) index;
 
 		status = acpi_ds_create_operand(walk_state, arg, index);
 		if (ACPI_FAILURE(status)) {
 			goto cleanup;
 		}
 
-		count++;
 		index--;
 
 		ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c
index 698d2e1..4c402be 100644
--- a/drivers/acpi/dispatcher/dswstate.c
+++ b/drivers/acpi/dispatcher/dswstate.c
@@ -220,7 +220,7 @@ static acpi_status acpi_ds_result_stack_push(struct acpi_walk_state *walk_state)
 
 	/* Check for stack overflow */
 
-	if ((walk_state->result_size + ACPI_RESULTS_FRAME_OBJ_NUM) >
+	if (((u32) walk_state->result_size + ACPI_RESULTS_FRAME_OBJ_NUM) >
 	    ACPI_RESULTS_OBJ_NUM_MAX) {
 		ACPI_ERROR((AE_INFO, "Result stack overflow: State=%p Num=%X",
 			    walk_state, walk_state->result_size));
@@ -400,7 +400,7 @@ void
 acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
 				 struct acpi_walk_state *walk_state)
 {
-	u32 i;
+	acpi_native_int i;
 	union acpi_operand_object *obj_desc;
 
 	ACPI_FUNCTION_NAME(ds_obj_stack_pop_and_delete);
@@ -409,7 +409,7 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
 		return;
 	}
 
-	for (i = (pop_count - 1); i >= 0; i--) {
+	for (i = (acpi_native_int) (pop_count - 1); i >= 0; i--) {
 		if (walk_state->num_operands == 0) {
 			return;
 		}
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 3370aad..52b1e95 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -45,7 +45,6 @@
 #include <acpi/acinterp.h>
 #include <acpi/amlcode.h>
 #include <acpi/acnamesp.h>
-#include <acpi/acevents.h>
 #include <acpi/actables.h>
 #include <acpi/acdispat.h>
 
@@ -341,9 +340,10 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 
 		/* Validate checksum here. It won't get validated in tb_add_table */
 
-		status = acpi_tb_verify_checksum((struct acpi_table_header *)
-						 obj_desc->buffer.pointer,
-						 length);
+		status =
+		    acpi_tb_verify_checksum(ACPI_CAST_PTR
+					    (struct acpi_table_header,
+					     obj_desc->buffer.pointer), length);
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
 		}
@@ -468,7 +468,7 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)
 	 * (Offset contains the table_id)
 	 */
 	acpi_tb_delete_namespace_by_owner(table_index);
-	acpi_tb_release_owner_id(table_index);
+	(void)acpi_tb_release_owner_id(table_index);
 
 	acpi_tb_set_table_loaded_flag(table_index, FALSE);
 
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index fcb1da0..e48d916 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -506,6 +506,12 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 				       obj_desc->reference.object);
 			break;
 
+		case AML_LOAD_OP:
+
+			acpi_os_printf("Reference: [DdbHandle] TableIndex %p\n",
+				       obj_desc->reference.object);
+			break;
+
 		case AML_REF_OF_OP:
 
 			acpi_os_printf("Reference: (RefOf) %p\n",
@@ -631,8 +637,8 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 			acpi_os_printf("\n");
 		} else {
 			acpi_os_printf(" base %8.8X%8.8X Length %X\n",
-				       ACPI_FORMAT_UINT64(obj_desc->region.
-							  address),
+				       ACPI_FORMAT_NATIVE_UINT(obj_desc->region.
+							       address),
 				       obj_desc->region.length);
 		}
 		break;
diff --git a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c
index 65a48b6..1ece1c3 100644
--- a/drivers/acpi/executer/exfldio.c
+++ b/drivers/acpi/executer/exfldio.c
@@ -263,7 +263,8 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
 			      rgn_desc->region.space_id,
 			      obj_desc->common_field.access_byte_width,
 			      obj_desc->common_field.base_byte_offset,
-			      field_datum_byte_offset, (void *)address));
+			      field_datum_byte_offset, ACPI_CAST_PTR(void,
+								     address)));
 
 	/* Invoke the appropriate address_space/op_region handler */
 
diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c
index 3f51b7e..cbc6788 100644
--- a/drivers/acpi/executer/exregion.c
+++ b/drivers/acpi/executer/exregion.c
@@ -160,7 +160,7 @@ acpi_ex_system_memory_space_handler(u32 function,
 		if (!mem_info->mapped_logical_address) {
 			ACPI_ERROR((AE_INFO,
 				    "Could not map memory at %8.8X%8.8X, size %X",
-				    ACPI_FORMAT_UINT64(address),
+				    ACPI_FORMAT_NATIVE_UINT(address),
 				    (u32) window_size));
 			mem_info->mapped_length = 0;
 			return_ACPI_STATUS(AE_NO_MEMORY);
@@ -182,7 +182,8 @@ acpi_ex_system_memory_space_handler(u32 function,
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 			  "System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n",
-			  bit_width, function, ACPI_FORMAT_UINT64(address)));
+			  bit_width, function,
+			  ACPI_FORMAT_NATIVE_UINT(address)));
 
 	/*
 	 * Perform the memory read or write
@@ -284,7 +285,8 @@ acpi_ex_system_io_space_handler(u32 function,
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 			  "System-IO (width %d) R/W %d Address=%8.8X%8.8X\n",
-			  bit_width, function, ACPI_FORMAT_UINT64(address)));
+			  bit_width, function,
+			  ACPI_FORMAT_NATIVE_UINT(address)));
 
 	/* Decode the function parameter */
 
diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index d860f9c..2408122 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -189,7 +189,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 
 		if (source_desc->reference.opcode == AML_LOAD_OP) {	/* Load and load_table */
 			ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
-					      " Table OwnerId %X\n",
+					      " Table OwnerId %p\n",
 					      source_desc->reference.object));
 			break;
 		}
@@ -213,7 +213,9 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 			    (source_desc->reference.node) !=
 			    ACPI_DESC_TYPE_NAMED) {
 				ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
-						      " %p - Not a valid namespace node\n"));
+						      " %p - Not a valid namespace node\n",
+						      source_desc->reference.
+						      node));
 			} else {
 				acpi_ex_do_debug_object((source_desc->reference.
 							 node)->object,
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c
index 9460baf..a20a974 100644
--- a/drivers/acpi/executer/exsystem.c
+++ b/drivers/acpi/executer/exsystem.c
@@ -44,7 +44,6 @@
 
 #include <acpi/acpi.h>
 #include <acpi/acinterp.h>
-#include <acpi/acevents.h>
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exsystem")
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index fd543ee..1b93f4d 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -61,7 +61,6 @@
 #include <acpi/acpi.h>
 #include <acpi/acinterp.h>
 #include <acpi/amlcode.h>
-#include <acpi/acevents.h>
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exutils")
diff --git a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c
index 3bf8105..153621d 100644
--- a/drivers/acpi/parser/psopcode.c
+++ b/drivers/acpi/parser/psopcode.c
@@ -49,7 +49,8 @@
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("psopcode")
 
-const u8 acpi_gbl_argument_count[] = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 6 };
+static const u8 acpi_gbl_argument_count[] =
+    { 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 6 };
 
 /*******************************************************************************
  *
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 8624686..86cff21 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -267,8 +267,6 @@ extern char const *acpi_gbl_exception_names_ctrl[];
  *
  ****************************************************************************/
 
-#define NUM_NS_TYPES                    ACPI_TYPE_INVALID+1
-
 #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
 #define NUM_PREDEFINED_NAMES            10
 #else
@@ -279,7 +277,7 @@ ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct;
 ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node;
 ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device;
 
-extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES];
+extern const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES];
 extern const struct acpi_predefined_names
     acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES];
 
@@ -287,8 +285,8 @@ extern const struct acpi_predefined_names
 ACPI_EXTERN u32 acpi_gbl_current_node_count;
 ACPI_EXTERN u32 acpi_gbl_current_node_size;
 ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count;
-ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer;
-ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer;
+ACPI_EXTERN acpi_size *acpi_gbl_entry_stack_pointer;
+ACPI_EXTERN acpi_size *acpi_gbl_lowest_stack_pointer;
 ACPI_EXTERN u32 acpi_gbl_deepest_nesting;
 #endif
 
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 401228d..dc6a037 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -65,7 +65,11 @@
  * Full 64-bit integer must be available on both 32-bit and 64-bit platforms
  */
 #define ACPI_LODWORD(l)                 ((u32)(u64)(l))
+#define ACPI_HIDWORD(l)                 ((u16)((((u64)(l)) >> 32) & 0xFFFFFFFF))
+
+#if 0
 #define ACPI_HIDWORD(l)                 ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi))
+#endif
 
 /*
  * printf() format helpers
@@ -75,6 +79,12 @@
 
 #define ACPI_FORMAT_UINT64(i)           ACPI_HIDWORD(i),ACPI_LODWORD(i)
 
+#if ACPI_MACHINE_WIDTH == 64
+#define ACPI_FORMAT_NATIVE_UINT(i)      ACPI_FORMAT_UINT64(i)
+#else
+#define ACPI_FORMAT_NATIVE_UINT(i)      0, (i)
+#endif
+
 /*
  * Extract data using a pointer.  Any more than a byte and we
  * get into potential aligment issues -- see the STORE macros below.
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 766178c..bb44700 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -477,6 +477,8 @@ typedef u32 acpi_object_type;
 #define ACPI_TYPE_INVALID               0x1E
 #define ACPI_TYPE_NOT_FOUND             0xFF
 
+#define ACPI_NUM_NS_TYPES               (ACPI_TYPE_INVALID + 1)
+
 /*
  * All I/O
  */
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 35/73] ACPICA: Cleanup of debug output
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (32 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 34/73] " Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 36/73] ACPICA: Fixes a problem with control method references within packages Len Brown
                     ` (37 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Improved output of object dump routine.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exdump.c |   39 ++++++++++++++++++++++++++++++---------
 1 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index e48d916..251d84b 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -514,8 +514,14 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 
 		case AML_REF_OF_OP:
 
-			acpi_os_printf("Reference: (RefOf) %p\n",
-				       obj_desc->reference.object);
+			acpi_os_printf("Reference: (RefOf) %p [%s]\n",
+				       obj_desc->reference.object,
+				       acpi_ut_get_type_name(((union
+							       acpi_operand_object
+							       *)obj_desc->
+							      reference.
+							      object)->common.
+							     type));
 			break;
 
 		case AML_ARG_OP:
@@ -556,8 +562,9 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 
 		case AML_INT_NAMEPATH_OP:
 
-			acpi_os_printf("Reference.Node->Name %X\n",
-				       obj_desc->reference.node->name.integer);
+			acpi_os_printf("Reference: Namepath %X [%4.4s]\n",
+				       obj_desc->reference.node->name.integer,
+				       obj_desc->reference.node->name.ascii);
 			break;
 
 		default:
@@ -874,20 +881,32 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
 	ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER;
 
 	if (obj_desc->reference.opcode == AML_INT_NAMEPATH_OP) {
-		acpi_os_printf("Named Object %p ", obj_desc->reference.node);
+		acpi_os_printf(" Named Object %p ", obj_desc->reference.node);
 
 		status =
 		    acpi_ns_handle_to_pathname(obj_desc->reference.node,
 					       &ret_buf);
 		if (ACPI_FAILURE(status)) {
-			acpi_os_printf("Could not convert name to pathname\n");
+			acpi_os_printf(" Could not convert name to pathname\n");
 		} else {
 			acpi_os_printf("%s\n", (char *)ret_buf.pointer);
 			ACPI_FREE(ret_buf.pointer);
 		}
 	} else if (obj_desc->reference.object) {
-		acpi_os_printf("\nReferenced Object: %p\n",
-			       obj_desc->reference.object);
+		if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
+		    ACPI_DESC_TYPE_OPERAND) {
+			acpi_os_printf(" Target: %p [%s]\n",
+				       obj_desc->reference.object,
+				       acpi_ut_get_type_name(((union
+							       acpi_operand_object
+							       *)obj_desc->
+							      reference.
+							      object)->common.
+							     type));
+		} else {
+			acpi_os_printf(" Target: %p\n",
+				       obj_desc->reference.object);
+		}
 	}
 }
 
@@ -973,7 +992,9 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
 
 	case ACPI_TYPE_LOCAL_REFERENCE:
 
-		acpi_os_printf("[Object Reference] ");
+		acpi_os_printf("[Object Reference] %s",
+			       (acpi_ps_get_opcode_info
+				(obj_desc->reference.opcode))->name);
 		acpi_ex_dump_reference_obj(obj_desc);
 		break;
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 36/73] ACPICA: Fixes a problem with control method references within packages
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (33 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 35/73] ACPICA: Cleanup of debug output Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 37/73] ACPICA: Fixed a problem with FromBCD and ToBCD with some compilers Len Brown
                     ` (36 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Completes the package changes started with version 20071019.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dswexec.c |    2 +-
 drivers/acpi/executer/exresnte.c  |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index 514b9d2..6af4671 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -493,7 +493,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 
 				op->common.node =
 				    (struct acpi_namespace_node *)op->asl.value.
-				    arg->asl.node->object;
+				    arg->asl.node;
 				acpi_ut_add_reference(op->asl.value.arg->asl.
 						      node->object);
 				return_ACPI_STATUS(AE_OK);
diff --git a/drivers/acpi/executer/exresnte.c b/drivers/acpi/executer/exresnte.c
index 2b3a01c..79a0d28 100644
--- a/drivers/acpi/executer/exresnte.c
+++ b/drivers/acpi/executer/exresnte.c
@@ -116,9 +116,11 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
 	 * Several object types require no further processing:
 	 * 1) Device/Thermal objects don't have a "real" subobject, return the Node
 	 * 2) Method locals and arguments have a pseudo-Node
+	 * 3) 10/2007: Added method type to assist with Package construction.
 	 */
 	if ((entry_type == ACPI_TYPE_DEVICE) ||
 	    (entry_type == ACPI_TYPE_THERMAL) ||
+	    (entry_type == ACPI_TYPE_METHOD) ||
 	    (node->flags & (ANOBJ_METHOD_ARG | ANOBJ_METHOD_LOCAL))) {
 		return_ACPI_STATUS(AE_OK);
 	}
@@ -214,7 +216,6 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
 		/* For these objects, just return the object attached to the Node */
 
 	case ACPI_TYPE_MUTEX:
-	case ACPI_TYPE_METHOD:
 	case ACPI_TYPE_POWER:
 	case ACPI_TYPE_PROCESSOR:
 	case ACPI_TYPE_EVENT:
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 37/73] ACPICA: Fixed a problem with FromBCD and ToBCD with some compilers
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (34 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 36/73] ACPICA: Fixes a problem with control method references within packages Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 38/73] ACPICA: Fixed a problem with Index references passed as method arguments Len Brown
                     ` (35 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

On some compilers, the ShortDivide function worked incorrectly,
causing problems with the BCD functions with large input
values. (Truncation from 64-bit to 32-bit occurred.) Internal
BZ 435

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/utilities/utmath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/utilities/utmath.c b/drivers/acpi/utilities/utmath.c
index 0c56a0d..16dbf66 100644
--- a/drivers/acpi/utilities/utmath.c
+++ b/drivers/acpi/utilities/utmath.c
@@ -276,7 +276,7 @@ acpi_ut_short_divide(acpi_integer in_dividend,
 		*out_quotient = in_dividend / divisor;
 	}
 	if (out_remainder) {
-		*out_remainder = (u32) in_dividend % divisor;
+		*out_remainder = (u32) (in_dividend % divisor);
 	}
 
 	return_ACPI_STATUS(AE_OK);
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 38/73] ACPICA: Fixed a problem with Index references passed as method arguments
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (35 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 37/73] ACPICA: Fixed a problem with FromBCD and ToBCD with some compilers Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 39/73] ACPICA: Fixed a problem with CopyObject used in conjunction with the Index operator Len Brown
                     ` (34 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

References passed as arguments to control methods were dereferenced
immediately (before control was passed to the called method). The
references are now correctly passed directly to the called
method. BZ 5389. Lin Ming

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exresolv.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 74ab220..795ec8c 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -194,6 +194,12 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
 
 			case ACPI_TYPE_PACKAGE:
 
+				/* If method call - leave the Reference on the stack */
+
+				if (walk_state->opcode == AML_INT_METHODCALL_OP) {
+					break;
+				}
+
 				obj_desc = *stack_desc->reference.where;
 				if (obj_desc) {
 					/*
@@ -210,7 +216,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
 					 * the package, can't dereference it
 					 */
 					ACPI_ERROR((AE_INFO,
-						    "Attempt to deref an Index to NULL pkg element Idx=%p",
+						    "Attempt to dereference an Index to NULL package element Idx=%p",
 						    stack_desc));
 					status = AE_AML_UNINITIALIZED_ELEMENT;
 				}
@@ -221,7 +227,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
 				/* Invalid reference object */
 
 				ACPI_ERROR((AE_INFO,
-					    "Unknown TargetType %X in Index/Reference obj %p",
+					    "Unknown TargetType %X in Index/Reference object %p",
 					    stack_desc->reference.target_type,
 					    stack_desc));
 				status = AE_AML_INTERNAL;
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 39/73] ACPICA: Fixed a problem with CopyObject used in conjunction with the Index operator
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (36 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 38/73] ACPICA: Fixed a problem with Index references passed as method arguments Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 40/73] ACPICA: Update version to 20071114 Len Brown
                     ` (33 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

The reference was incorrectly dereferenced before the copy. The
reference is now correctly copied. BZ 5391 Lin Ming

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exresnte.c |    7 +++----
 drivers/acpi/executer/exresolv.c |   16 ++++++++++------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/executer/exresnte.c b/drivers/acpi/executer/exresnte.c
index 79a0d28..42c8a0f 100644
--- a/drivers/acpi/executer/exresnte.c
+++ b/drivers/acpi/executer/exresnte.c
@@ -239,13 +239,12 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
 	case ACPI_TYPE_LOCAL_REFERENCE:
 
 		switch (source_desc->reference.opcode) {
-		case AML_LOAD_OP:
+		case AML_LOAD_OP:	/* This is a ddb_handle */
+		case AML_REF_OF_OP:
+		case AML_INDEX_OP:
 
-			/* This is a ddb_handle */
 			/* Return an additional reference to the object */
 
-		case AML_REF_OF_OP:
-
 			obj_desc = source_desc;
 			acpi_ut_add_reference(obj_desc);
 			break;
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 795ec8c..9c3cdf6 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -189,21 +189,25 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
 			switch (stack_desc->reference.target_type) {
 			case ACPI_TYPE_BUFFER_FIELD:
 
-				/* Just return - leave the Reference on the stack */
+				/* Just return - do not dereference */
 				break;
 
 			case ACPI_TYPE_PACKAGE:
 
-				/* If method call - leave the Reference on the stack */
+				/* If method call or copy_object - do not dereference */
 
-				if (walk_state->opcode == AML_INT_METHODCALL_OP) {
+				if ((walk_state->opcode ==
+				     AML_INT_METHODCALL_OP)
+				    || (walk_state->opcode == AML_COPY_OP)) {
 					break;
 				}
 
+				/* Otherwise, dereference the package_index to a package element */
+
 				obj_desc = *stack_desc->reference.where;
 				if (obj_desc) {
 					/*
-					 * Valid obj descriptor, copy pointer to return value
+					 * Valid object descriptor, copy pointer to return value
 					 * (i.e., dereference the package index)
 					 * Delete the ref object, increment the returned object
 					 */
@@ -212,7 +216,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
 					*stack_ptr = obj_desc;
 				} else {
 					/*
-					 * A NULL object descriptor means an unitialized element of
+					 * A NULL object descriptor means an uninitialized element of
 					 * the package, can't dereference it
 					 */
 					ACPI_ERROR((AE_INFO,
@@ -239,7 +243,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
 		case AML_DEBUG_OP:
 		case AML_LOAD_OP:
 
-			/* Just leave the object as-is */
+			/* Just leave the object as-is, do not dereference */
 
 			break;
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 40/73] ACPICA: Update version to 20071114
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (37 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 39/73] ACPICA: Fixed a problem with CopyObject used in conjunction with the Index operator Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 41/73] ACPICA: Fixed a problem with AcpiGetDevices where the search of a branch of the device tree could be terminated prematurely Len Brown
                     ` (32 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Update version to 20071114.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index a2d4c87..c21e12d 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20071019
+#define ACPI_CA_VERSION                 0x20071114
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 41/73] ACPICA: Fixed a problem with AcpiGetDevices where the search of a branch of the device tree could be terminated prematurely
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (38 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 40/73] ACPICA: Update version to 20071114 Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 42/73] ACPICA: Fixed a problem with Index Fields where the Index register was incorrectly limited to a maximum of 32 bits Len Brown
                     ` (31 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

In accordance with the ACPI specification, the search is terminated
if a device is both not present and not functional (instead of
just not present.) Yakui Zhao.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/namespace/nsxfeval.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
index b92133f..cd97c80 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -467,10 +467,13 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
 		return (AE_CTRL_DEPTH);
 	}
 
-	if (!(flags & ACPI_STA_DEVICE_PRESENT)) {
-
-		/* Don't examine children of the device if not present */
-
+	if (!(flags & ACPI_STA_DEVICE_PRESENT) &&
+	    !(flags & ACPI_STA_DEVICE_FUNCTIONING)) {
+		/*
+		 * Don't examine the children of the device only when the
+		 * device is neither present nor functional. See ACPI spec,
+		 * description of _STA for more information.
+		 */
 		return (AE_CTRL_DEPTH);
 	}
 
@@ -539,7 +542,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
  *              value is returned to the caller.
  *
  *              This is a wrapper for walk_namespace, but the callback performs
- *              additional filtering. Please see acpi_get_device_callback.
+ *              additional filtering. Please see acpi_ns_get_device_callback.
  *
  ******************************************************************************/
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 42/73] ACPICA: Fixed a problem with Index Fields where the Index register was incorrectly limited to a maximum of 32 bits
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (39 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 41/73] ACPICA: Fixed a problem with AcpiGetDevices where the search of a branch of the device tree could be terminated prematurely Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 43/73] ACPICA: Implemented full support for deferred execution for the TermArg string arguments for DataTableRegion Len Brown
                     ` (30 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Now any size may be used.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exfield.c |   37 -----------------------------------
 drivers/acpi/executer/exfldio.c |   41 ++++++++++++++++++++++++++++++++------
 2 files changed, 34 insertions(+), 44 deletions(-)

diff --git a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c
index da772cb..aef8db8 100644
--- a/drivers/acpi/executer/exfield.c
+++ b/drivers/acpi/executer/exfield.c
@@ -210,9 +210,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 {
 	acpi_status status;
 	u32 length;
-	u32 required_length;
 	void *buffer;
-	void *new_buffer;
 	union acpi_operand_object *buffer_desc;
 
 	ACPI_FUNCTION_TRACE_PTR(ex_write_data_to_field, obj_desc);
@@ -312,35 +310,6 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 		return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
 	}
 
-	/*
-	 * We must have a buffer that is at least as long as the field
-	 * we are writing to.  This is because individual fields are
-	 * indivisible and partial writes are not supported -- as per
-	 * the ACPI specification.
-	 */
-	new_buffer = NULL;
-	required_length =
-	    ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length);
-
-	if (length < required_length) {
-
-		/* We need to create a new buffer */
-
-		new_buffer = ACPI_ALLOCATE_ZEROED(required_length);
-		if (!new_buffer) {
-			return_ACPI_STATUS(AE_NO_MEMORY);
-		}
-
-		/*
-		 * Copy the original data to the new buffer, starting
-		 * at Byte zero.  All unused (upper) bytes of the
-		 * buffer will be 0.
-		 */
-		ACPI_MEMCPY((char *)new_buffer, (char *)buffer, length);
-		buffer = new_buffer;
-		length = required_length;
-	}
-
 	ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
 			  "FieldWrite [FROM]: Obj %p (%s:%X), Buf %p, ByteLen %X\n",
 			  source_desc,
@@ -366,11 +335,5 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 	status = acpi_ex_insert_into_field(obj_desc, buffer, length);
 	acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
 
-	/* Free temporary buffer if we used one */
-
-	if (new_buffer) {
-		ACPI_FREE(new_buffer);
-	}
-
 	return_ACPI_STATUS(status);
 }
diff --git a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c
index 1ece1c3..ae40294 100644
--- a/drivers/acpi/executer/exfldio.c
+++ b/drivers/acpi/executer/exfldio.c
@@ -806,18 +806,39 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
 	u32 datum_count;
 	u32 field_datum_count;
 	u32 i;
+	u32 required_length;
+	void *new_buffer;
 
 	ACPI_FUNCTION_TRACE(ex_insert_into_field);
 
 	/* Validate input buffer */
 
-	if (buffer_length <
-	    ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length)) {
-		ACPI_ERROR((AE_INFO,
-			    "Field size %X (bits) is too large for buffer (%X)",
-			    obj_desc->common_field.bit_length, buffer_length));
+	new_buffer = NULL;
+	required_length =
+	    ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length);
+	/*
+	 * We must have a buffer that is at least as long as the field
+	 * we are writing to.  This is because individual fields are
+	 * indivisible and partial writes are not supported -- as per
+	 * the ACPI specification.
+	 */
+	if (buffer_length < required_length) {
 
-		return_ACPI_STATUS(AE_BUFFER_OVERFLOW);
+		/* We need to create a new buffer */
+
+		new_buffer = ACPI_ALLOCATE_ZEROED(required_length);
+		if (!new_buffer) {
+			return_ACPI_STATUS(AE_NO_MEMORY);
+		}
+
+		/*
+		 * Copy the original data to the new buffer, starting
+		 * at Byte zero.  All unused (upper) bytes of the
+		 * buffer will be 0.
+		 */
+		ACPI_MEMCPY((char *)new_buffer, (char *)buffer, buffer_length);
+		buffer = new_buffer;
+		buffer_length = required_length;
 	}
 
 	/*
@@ -867,7 +888,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
 							merged_datum,
 							field_offset);
 		if (ACPI_FAILURE(status)) {
-			return_ACPI_STATUS(status);
+			goto exit;
 		}
 
 		field_offset += obj_desc->common_field.access_byte_width;
@@ -925,5 +946,11 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
 						mask, merged_datum,
 						field_offset);
 
+      exit:
+	/* Free temporary buffer if we used one */
+
+	if (new_buffer) {
+		ACPI_FREE(new_buffer);
+	}
 	return_ACPI_STATUS(status);
 }
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 43/73] ACPICA: Implemented full support for deferred execution for the TermArg string arguments for DataTableRegion
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (40 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 42/73] ACPICA: Fixed a problem with Index Fields where the Index register was incorrectly limited to a maximum of 32 bits Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 44/73] ACPICA: Undo accidental checkin of not-fully-tested mutex changes Len Brown
                     ` (29 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

This enables forward references and full operand resolution for
the three string arguments. Similar to OperationRegion deferred
argument execution.) Lin Ming. BZ 430

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsopcode.c |  103 ++++++++++++++++++++++++++++++++++++
 drivers/acpi/dispatcher/dswexec.c  |   11 ++++
 drivers/acpi/dispatcher/dswload.c  |   29 +++++++---
 drivers/acpi/executer/excreate.c   |   95 ---------------------------------
 drivers/acpi/executer/exmutex.c    |   16 ++++++
 drivers/acpi/parser/psloop.c       |    6 ++-
 drivers/acpi/parser/psopcode.c     |    4 +-
 include/acpi/acdispat.h            |    4 ++
 include/acpi/acinterp.h            |    2 -
 9 files changed, 160 insertions(+), 110 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
index f0847ee..a3f2979 100644
--- a/drivers/acpi/dispatcher/dsopcode.c
+++ b/drivers/acpi/dispatcher/dsopcode.c
@@ -49,6 +49,7 @@
 #include <acpi/acinterp.h>
 #include <acpi/acnamesp.h>
 #include <acpi/acevents.h>
+#include <acpi/actables.h>
 
 #define _COMPONENT          ACPI_DISPATCHER
 ACPI_MODULE_NAME("dsopcode")
@@ -782,6 +783,108 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
 
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_ds_eval_table_region_operands
+ *
+ * PARAMETERS:  walk_state      - Current walk
+ *              Op              - A valid region Op object
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Get region address and length
+ *              Called from acpi_ds_exec_end_op during data_table_region parse tree walk
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
+				   union acpi_parse_object *op)
+{
+	acpi_status status;
+	union acpi_operand_object *obj_desc;
+	union acpi_operand_object **operand;
+	struct acpi_namespace_node *node;
+	union acpi_parse_object *next_op;
+	acpi_native_uint table_index;
+	struct acpi_table_header *table;
+
+	ACPI_FUNCTION_TRACE_PTR(ds_eval_table_region_operands, op);
+
+	/*
+	 * This is where we evaluate the signature_string and oem_iDString
+	 * and oem_table_iDString of the data_table_region declaration
+	 */
+	node = op->common.node;
+
+	/* next_op points to signature_string op */
+
+	next_op = op->common.value.arg;
+
+	/*
+	 * Evaluate/create the signature_string and oem_iDString
+	 * and oem_table_iDString operands
+	 */
+	status = acpi_ds_create_operands(walk_state, next_op);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	/*
+	 * Resolve the signature_string and oem_iDString
+	 * and oem_table_iDString operands
+	 */
+	status = acpi_ex_resolve_operands(op->common.aml_opcode,
+					  ACPI_WALK_OPERANDS, walk_state);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	ACPI_DUMP_OPERANDS(ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
+			   acpi_ps_get_opcode_name(op->common.aml_opcode),
+			   1, "after AcpiExResolveOperands");
+
+	operand = &walk_state->operands[0];
+
+	/* Find the ACPI table */
+
+	status = acpi_tb_find_table(operand[0]->string.pointer,
+				    operand[1]->string.pointer,
+				    operand[2]->string.pointer, &table_index);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	acpi_ut_remove_reference(operand[0]);
+	acpi_ut_remove_reference(operand[1]);
+	acpi_ut_remove_reference(operand[2]);
+
+	status = acpi_get_table_by_index(table_index, &table);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	obj_desc = acpi_ns_get_attached_object(node);
+	if (!obj_desc) {
+		return_ACPI_STATUS(AE_NOT_EXIST);
+	}
+
+	obj_desc->region.address =
+	    (acpi_physical_address) ACPI_TO_INTEGER(table);
+	obj_desc->region.length = table->length;
+
+	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
+			  obj_desc,
+			  ACPI_FORMAT_NATIVE_UINT(obj_desc->region.address),
+			  obj_desc->region.length));
+
+	/* Now the address and length are valid for this opregion */
+
+	obj_desc->region.flags |= AOPOBJ_DATA_VALID;
+
+	return_ACPI_STATUS(status);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_ds_eval_data_object_operands
  *
  * PARAMETERS:  walk_state      - Current walk
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index 6af4671..8ba4bb3 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -641,6 +641,17 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 				if (ACPI_FAILURE(status)) {
 					break;
 				}
+			} else if (op->common.aml_opcode == AML_DATA_REGION_OP) {
+				ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+						  "Executing DataTableRegion Strings Op=%p\n",
+						  op));
+
+				status =
+				    acpi_ds_eval_table_region_operands
+				    (walk_state, op);
+				if (ACPI_FAILURE(status)) {
+					break;
+				}
 			}
 			break;
 
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
index 8ab9d1b..ec68c1d 100644
--- a/drivers/acpi/dispatcher/dswload.c
+++ b/drivers/acpi/dispatcher/dswload.c
@@ -443,6 +443,15 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
 			if (ACPI_FAILURE(status)) {
 				return_ACPI_STATUS(status);
 			}
+		} else if (op->common.aml_opcode == AML_DATA_REGION_OP) {
+			status =
+			    acpi_ex_create_region(op->named.data,
+						  op->named.length,
+						  REGION_DATA_TABLE,
+						  walk_state);
+			if (ACPI_FAILURE(status)) {
+				return_ACPI_STATUS(status);
+			}
 		}
 	}
 #endif
@@ -823,6 +832,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
 	struct acpi_namespace_node *new_node;
 #ifndef ACPI_NO_METHOD_EXECUTION
 	u32 i;
+	u8 region_space;
 #endif
 
 	ACPI_FUNCTION_TRACE(ds_load2_end_op);
@@ -1003,11 +1013,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
 			status = acpi_ex_create_event(walk_state);
 			break;
 
-		case AML_DATA_REGION_OP:
-
-			status = acpi_ex_create_table_region(walk_state);
-			break;
-
 		case AML_ALIAS_OP:
 
 			status = acpi_ex_create_alias(walk_state);
@@ -1035,6 +1040,15 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
 		switch (op->common.aml_opcode) {
 #ifndef ACPI_NO_METHOD_EXECUTION
 		case AML_REGION_OP:
+		case AML_DATA_REGION_OP:
+
+			if (op->common.aml_opcode == AML_REGION_OP) {
+				region_space = (acpi_adr_space_type)
+				    ((op->common.value.arg)->common.value.
+				     integer);
+			} else {
+				region_space = REGION_DATA_TABLE;
+			}
 
 			/*
 			 * If we are executing a method, initialize the region
@@ -1043,10 +1057,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
 				status =
 				    acpi_ex_create_region(op->named.data,
 							  op->named.length,
-							  (acpi_adr_space_type)
-							  ((op->common.value.
-							    arg)->common.value.
-							   integer),
+							  region_space,
 							  walk_state);
 				if (ACPI_FAILURE(status)) {
 					return (status);
diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c
index b391439..0396bd4 100644
--- a/drivers/acpi/executer/excreate.c
+++ b/drivers/acpi/executer/excreate.c
@@ -352,101 +352,6 @@ acpi_ex_create_region(u8 * aml_start,
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_ex_create_table_region
- *
- * PARAMETERS:  walk_state          - Current state
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Create a new data_table_region object
- *
- ******************************************************************************/
-
-acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state)
-{
-	acpi_status status;
-	union acpi_operand_object **operand = &walk_state->operands[0];
-	union acpi_operand_object *obj_desc;
-	struct acpi_namespace_node *node;
-	union acpi_operand_object *region_obj2;
-	acpi_native_uint table_index;
-	struct acpi_table_header *table;
-
-	ACPI_FUNCTION_TRACE(ex_create_table_region);
-
-	/* Get the Node from the object stack  */
-
-	node = walk_state->op->common.node;
-
-	/*
-	 * If the region object is already attached to this node,
-	 * just return
-	 */
-	if (acpi_ns_get_attached_object(node)) {
-		return_ACPI_STATUS(AE_OK);
-	}
-
-	/* Find the ACPI table */
-
-	status = acpi_tb_find_table(operand[1]->string.pointer,
-				    operand[2]->string.pointer,
-				    operand[3]->string.pointer, &table_index);
-	if (ACPI_FAILURE(status)) {
-		return_ACPI_STATUS(status);
-	}
-
-	/* Create the region descriptor */
-
-	obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_REGION);
-	if (!obj_desc) {
-		return_ACPI_STATUS(AE_NO_MEMORY);
-	}
-
-	region_obj2 = obj_desc->common.next_object;
-	region_obj2->extra.region_context = NULL;
-
-	status = acpi_get_table_by_index(table_index, &table);
-	if (ACPI_FAILURE(status)) {
-		return_ACPI_STATUS(status);
-	}
-
-	/* Init the region from the operands */
-
-	obj_desc->region.space_id = REGION_DATA_TABLE;
-	obj_desc->region.address =
-	    (acpi_physical_address) ACPI_TO_INTEGER(table);
-	obj_desc->region.length = table->length;
-	obj_desc->region.node = node;
-	obj_desc->region.flags = AOPOBJ_DATA_VALID;
-
-	/* Install the new region object in the parent Node */
-
-	status = acpi_ns_attach_object(node, obj_desc, ACPI_TYPE_REGION);
-	if (ACPI_FAILURE(status)) {
-		goto cleanup;
-	}
-
-	status = acpi_ev_initialize_region(obj_desc, FALSE);
-	if (ACPI_FAILURE(status)) {
-		if (status == AE_NOT_EXIST) {
-			status = AE_OK;
-		} else {
-			goto cleanup;
-		}
-	}
-
-	obj_desc->region.flags |= AOPOBJ_SETUP_COMPLETE;
-
-      cleanup:
-
-	/* Remove local reference to the object */
-
-	acpi_ut_remove_reference(obj_desc);
-	return_ACPI_STATUS(status);
-}
-
-/*******************************************************************************
- *
  * FUNCTION:    acpi_ex_create_processor
  *
  * PARAMETERS:  walk_state          - Current state
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index b8d035c..7c70938 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -85,6 +85,7 @@ void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc)
 	} else {
 		thread->acquired_mutex_list = obj_desc->mutex.next;
 	}
+	return;
 }
 
 /*******************************************************************************
@@ -298,6 +299,17 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc)
 		return (AE_NOT_ACQUIRED);
 	}
 
+	/* No obj_desc->Mutex.owner_thread for Global Lock */
+
+	/*
+	 * Mutex to be released must be at the head of acquired list to prevent
+	 * deadlock. (The head of the list is the last mutex acquired.)
+	 */
+	if (obj_desc->mutex.owner_thread &&
+	    (obj_desc != obj_desc->mutex.owner_thread->acquired_mutex_list)) {
+		return (AE_AML_MUTEX_ORDER);
+	}
+
 	/* Match multiple Acquires with multiple Releases */
 
 	obj_desc->mutex.acquisition_depth--;
@@ -403,6 +415,9 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 	}
 
 	status = acpi_ex_release_mutex_object(obj_desc);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
 
 	if (obj_desc->mutex.acquisition_depth == 0) {
 
@@ -411,6 +426,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 		walk_state->thread->current_sync_level =
 		    obj_desc->mutex.original_sync_level;
 	}
+
 	return_ACPI_STATUS(status);
 }
 
diff --git a/drivers/acpi/parser/psloop.c b/drivers/acpi/parser/psloop.c
index 4348b05..a079975 100644
--- a/drivers/acpi/parser/psloop.c
+++ b/drivers/acpi/parser/psloop.c
@@ -242,7 +242,8 @@ acpi_ps_build_named_op(struct acpi_walk_state *walk_state,
 	acpi_ps_append_arg(*op, unnamed_op->common.value.arg);
 	acpi_gbl_depth++;
 
-	if ((*op)->common.aml_opcode == AML_REGION_OP) {
+	if ((*op)->common.aml_opcode == AML_REGION_OP ||
+	    (*op)->common.aml_opcode == AML_DATA_REGION_OP) {
 		/*
 		 * Defer final parsing of an operation_region body, because we don't
 		 * have enough info in the first pass to parse it correctly (i.e.,
@@ -1013,7 +1014,8 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
 				acpi_gbl_depth--;
 			}
 
-			if (op->common.aml_opcode == AML_REGION_OP) {
+			if (op->common.aml_opcode == AML_REGION_OP ||
+			    op->common.aml_opcode == AML_DATA_REGION_OP) {
 				/*
 				 * Skip parsing of control method or opregion body,
 				 * because we don't have enough info in the first pass
diff --git a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c
index 153621d..b273a0a 100644
--- a/drivers/acpi/parser/psopcode.c
+++ b/drivers/acpi/parser/psopcode.c
@@ -624,9 +624,9 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {
 		 AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R),
 /* 7C */ ACPI_OP("DataTableRegion", ARGP_DATA_REGION_OP,
 		 ARGI_DATA_REGION_OP, ACPI_TYPE_REGION,
-		 AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE,
+		 AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX,
 		 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
-		 AML_NSNODE | AML_NAMED),
+		 AML_NSNODE | AML_NAMED | AML_DEFER),
 /* 7D */ ACPI_OP("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP,
 		 ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT,
 		 AML_TYPE_NAMED_NO_OBJ,
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 3bffb4d..d8dabe8 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -68,6 +68,10 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
 			     union acpi_parse_object *op);
 
 acpi_status
+acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
+				   union acpi_parse_object *op);
+
+acpi_status
 acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state,
 				  union acpi_parse_object *op,
 				  union acpi_operand_object *obj_desc);
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index 92eb014..f4dd98f 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -215,8 +215,6 @@ acpi_ex_create_region(u8 * aml_start,
 		      u32 aml_length,
 		      u8 region_space, struct acpi_walk_state *walk_state);
 
-acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state);
-
 acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state);
 
 acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state);
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 44/73] ACPICA: Undo accidental checkin of not-fully-tested mutex changes
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (41 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 43/73] ACPICA: Implemented full support for deferred execution for the TermArg string arguments for DataTableRegion Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 45/73] ACPICA: Implemented full argument resolution support for the BankValue argument to BankField Len Brown
                     ` (28 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exmutex.c |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index 7c70938..b8d035c 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -85,7 +85,6 @@ void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc)
 	} else {
 		thread->acquired_mutex_list = obj_desc->mutex.next;
 	}
-	return;
 }
 
 /*******************************************************************************
@@ -299,17 +298,6 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc)
 		return (AE_NOT_ACQUIRED);
 	}
 
-	/* No obj_desc->Mutex.owner_thread for Global Lock */
-
-	/*
-	 * Mutex to be released must be at the head of acquired list to prevent
-	 * deadlock. (The head of the list is the last mutex acquired.)
-	 */
-	if (obj_desc->mutex.owner_thread &&
-	    (obj_desc != obj_desc->mutex.owner_thread->acquired_mutex_list)) {
-		return (AE_AML_MUTEX_ORDER);
-	}
-
 	/* Match multiple Acquires with multiple Releases */
 
 	obj_desc->mutex.acquisition_depth--;
@@ -415,9 +403,6 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 	}
 
 	status = acpi_ex_release_mutex_object(obj_desc);
-	if (ACPI_FAILURE(status)) {
-		return_ACPI_STATUS(status);
-	}
 
 	if (obj_desc->mutex.acquisition_depth == 0) {
 
@@ -426,7 +411,6 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 		walk_state->thread->current_sync_level =
 		    obj_desc->mutex.original_sync_level;
 	}
-
 	return_ACPI_STATUS(status);
 }
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 45/73] ACPICA: Implemented full argument resolution support for the BankValue argument to BankField
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (42 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 44/73] ACPICA: Undo accidental checkin of not-fully-tested mutex changes Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 46/73] ACPICA: Fixed a couple memory leaks associated with "implicit return" objects when the AML Interpreter slack mode is enabled Len Brown
                     ` (27 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Previously, only constants were supported, now any TermArg may
be used. Lin Ming BZ 387, 393

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsfield.c  |   80 ++++++++++----------
 drivers/acpi/dispatcher/dsopcode.c |  144 ++++++++++++++++++++++++++++++++++++
 drivers/acpi/dispatcher/dsutils.c  |    4 +-
 drivers/acpi/dispatcher/dswexec.c  |   11 +++
 drivers/acpi/executer/exprep.c     |   15 ++++
 drivers/acpi/namespace/nsinit.c    |   10 +++
 drivers/acpi/parser/psloop.c       |   19 +++++
 drivers/acpi/parser/psopcode.c     |    5 +-
 drivers/acpi/parser/psparse.c      |    2 +
 drivers/acpi/utilities/utdelete.c  |   11 +++
 drivers/acpi/utilities/utobject.c  |    1 +
 include/acpi/acdispat.h            |    7 ++
 12 files changed, 267 insertions(+), 42 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c
index f049639..e87f6bf 100644
--- a/drivers/acpi/dispatcher/dsfield.c
+++ b/drivers/acpi/dispatcher/dsfield.c
@@ -281,11 +281,17 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
 				arg->common.node = info->field_node;
 				info->field_bit_length = arg->common.value.size;
 
-				/* Create and initialize an object for the new Field Node */
-
-				status = acpi_ex_prep_field_value(info);
-				if (ACPI_FAILURE(status)) {
-					return_ACPI_STATUS(status);
+				/*
+				 * If there is no object attached to the node, this node was just created
+				 * and we need to create the field object.  Otherwise, this was a lookup
+				 * of an existing node and we don't want to create the field object again.
+				 */
+				if (!acpi_ns_get_attached_object
+				    (info->field_node)) {
+					status = acpi_ex_prep_field_value(info);
+					if (ACPI_FAILURE(status)) {
+						return_ACPI_STATUS(status);
+					}
 				}
 			}
 
@@ -399,9 +405,22 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
 	union acpi_parse_object *arg = NULL;
 	struct acpi_namespace_node *node;
 	u8 type = 0;
+	u32 flags;
 
 	ACPI_FUNCTION_TRACE_PTR(ds_init_field_objects, op);
 
+	/*
+	 * During the load phase, we want to enter the name of the field into
+	 * the namespace. During the execute phase (when we evaluate the bank_value
+	 * operand), we want to lookup the name.
+	 */
+	if (walk_state->deferred_node) {
+		flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE;
+	} else {
+		flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
+		    ACPI_NS_ERROR_IF_FOUND;
+	}
+
 	switch (walk_state->opcode) {
 	case AML_FIELD_OP:
 		arg = acpi_ps_get_arg(op, 2);
@@ -433,10 +452,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
 			status = acpi_ns_lookup(walk_state->scope_info,
 						(char *)&arg->named.name,
 						type, ACPI_IMODE_LOAD_PASS1,
-						ACPI_NS_NO_UPSEARCH |
-						ACPI_NS_DONT_OPEN_SCOPE |
-						ACPI_NS_ERROR_IF_FOUND,
-						walk_state, &node);
+						flags, walk_state, &node);
 			if (ACPI_FAILURE(status)) {
 				ACPI_ERROR_NAMESPACE((char *)&arg->named.name,
 						     status);
@@ -466,7 +482,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
  *
  * PARAMETERS:  Op              - Op containing the Field definition and args
  *              region_node     - Object for the containing Operation Region
- *  `           walk_state      - Current method state
+ *              walk_state      - Current method state
  *
  * RETURN:      Status
  *
@@ -513,36 +529,13 @@ acpi_ds_create_bank_field(union acpi_parse_object *op,
 		return_ACPI_STATUS(status);
 	}
 
-	/* Third arg is the bank_value */
-
-	/* TBD: This arg is a term_arg, not a constant, and must be evaluated */
-
+	/*
+	 * Third arg is the bank_value
+	 * This arg is a term_arg, not a constant
+	 * It will be evaluated later, by acpi_ds_eval_bank_field_operands
+	 */
 	arg = arg->common.next;
 
-	/* Currently, only the following constants are supported */
-
-	switch (arg->common.aml_opcode) {
-	case AML_ZERO_OP:
-		info.bank_value = 0;
-		break;
-
-	case AML_ONE_OP:
-		info.bank_value = 1;
-		break;
-
-	case AML_BYTE_OP:
-	case AML_WORD_OP:
-	case AML_DWORD_OP:
-	case AML_QWORD_OP:
-		info.bank_value = (u32) arg->common.value.integer;
-		break;
-
-	default:
-		info.bank_value = 0;
-		ACPI_ERROR((AE_INFO,
-			    "Non-constant BankValue for BankField is not implemented"));
-	}
-
 	/* Fourth arg is the field flags */
 
 	arg = arg->common.next;
@@ -553,8 +546,17 @@ acpi_ds_create_bank_field(union acpi_parse_object *op,
 	info.field_type = ACPI_TYPE_LOCAL_BANK_FIELD;
 	info.region_node = region_node;
 
-	status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
+	/*
+	 * Use Info.data_register_node to store bank_field Op
+	 * It's safe because data_register_node will never be used when create bank field
+	 * We store aml_start and aml_length in the bank_field Op for late evaluation
+	 * Used in acpi_ex_prep_field_value(Info)
+	 *
+	 * TBD: Or, should we add a field in struct acpi_create_field_info, like "void *ParentOp"?
+	 */
+	info.data_register_node = (struct acpi_namespace_node *)op;
 
+	status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
 	return_ACPI_STATUS(status);
 }
 
diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
index a3f2979..35a7efd 100644
--- a/drivers/acpi/dispatcher/dsopcode.c
+++ b/drivers/acpi/dispatcher/dsopcode.c
@@ -220,6 +220,50 @@ acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc)
 
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_ds_get_bank_field_arguments
+ *
+ * PARAMETERS:  obj_desc        - A valid bank_field object
+ *
+ * RETURN:      Status.
+ *
+ * DESCRIPTION: Get bank_field bank_value. This implements the late
+ *              evaluation of these field attributes.
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ds_get_bank_field_arguments(union acpi_operand_object *obj_desc)
+{
+	union acpi_operand_object *extra_desc;
+	struct acpi_namespace_node *node;
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE_PTR(ds_get_bank_field_arguments, obj_desc);
+
+	if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
+		return_ACPI_STATUS(AE_OK);
+	}
+
+	/* Get the AML pointer (method object) and bank_field node */
+
+	extra_desc = acpi_ns_get_secondary_object(obj_desc);
+	node = obj_desc->bank_field.node;
+
+	ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
+			(ACPI_TYPE_LOCAL_BANK_FIELD, node, NULL));
+	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s] BankField Arg Init\n",
+			  acpi_ut_get_node_name(node)));
+
+	/* Execute the AML code for the term_arg arguments */
+
+	status = acpi_ds_execute_arguments(node, acpi_ns_get_parent_node(node),
+					   extra_desc->extra.aml_length,
+					   extra_desc->extra.aml_start);
+	return_ACPI_STATUS(status);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_ds_get_buffer_arguments
  *
  * PARAMETERS:  obj_desc        - A valid Buffer object
@@ -987,6 +1031,106 @@ acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state,
 
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_ds_eval_bank_field_operands
+ *
+ * PARAMETERS:  walk_state      - Current walk
+ *              Op              - A valid bank_field Op object
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Get bank_field bank_value
+ *              Called from acpi_ds_exec_end_op during bank_field parse tree walk
+ *
+ ******************************************************************************/
+
+acpi_status
+acpi_ds_eval_bank_field_operands(struct acpi_walk_state *walk_state,
+				 union acpi_parse_object *op)
+{
+	acpi_status status;
+	union acpi_operand_object *obj_desc;
+	union acpi_operand_object *operand_desc;
+	struct acpi_namespace_node *node;
+	union acpi_parse_object *next_op;
+	union acpi_parse_object *arg;
+
+	ACPI_FUNCTION_TRACE_PTR(ds_eval_bank_field_operands, op);
+
+	/*
+	 * This is where we evaluate the bank_value field of the
+	 * bank_field declaration
+	 */
+
+	/* next_op points to the op that holds the Region */
+
+	next_op = op->common.value.arg;
+
+	/* next_op points to the op that holds the Bank Register */
+
+	next_op = next_op->common.next;
+
+	/* next_op points to the op that holds the Bank Value */
+
+	next_op = next_op->common.next;
+
+	/*
+	 * Set proper index into operand stack for acpi_ds_obj_stack_push
+	 * invoked inside acpi_ds_create_operand.
+	 *
+	 * We use walk_state->Operands[0] to store the evaluated bank_value
+	 */
+	walk_state->operand_index = 0;
+
+	status = acpi_ds_create_operand(walk_state, next_op, 0);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	status = acpi_ex_resolve_to_value(&walk_state->operands[0], walk_state);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	ACPI_DUMP_OPERANDS(ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
+			   acpi_ps_get_opcode_name(op->common.aml_opcode),
+			   1, "after AcpiExResolveOperands");
+
+	/*
+	 * Get the bank_value operand and save it
+	 * (at Top of stack)
+	 */
+	operand_desc = walk_state->operands[0];
+
+	/* Arg points to the start Bank Field */
+
+	arg = acpi_ps_get_arg(op, 4);
+	while (arg) {
+
+		/* Ignore OFFSET and ACCESSAS terms here */
+
+		if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) {
+			node = arg->common.node;
+
+			obj_desc = acpi_ns_get_attached_object(node);
+			if (!obj_desc) {
+				return_ACPI_STATUS(AE_NOT_EXIST);
+			}
+
+			obj_desc->bank_field.value =
+			    (u32) operand_desc->integer.value;
+		}
+
+		/* Move to next field in the list */
+
+		arg = arg->common.next;
+	}
+
+	acpi_ut_remove_reference(operand_desc);
+	return_ACPI_STATUS(status);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_ds_exec_begin_control_op
  *
  * PARAMETERS:  walk_list       - The list that owns the walk stack
diff --git a/drivers/acpi/dispatcher/dsutils.c b/drivers/acpi/dispatcher/dsutils.c
index 97d01dc..f6c28d7 100644
--- a/drivers/acpi/dispatcher/dsutils.c
+++ b/drivers/acpi/dispatcher/dsutils.c
@@ -278,7 +278,9 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
 			AML_VAR_PACKAGE_OP)
 		    || (op->common.parent->common.aml_opcode == AML_BUFFER_OP)
 		    || (op->common.parent->common.aml_opcode ==
-			AML_INT_EVAL_SUBTREE_OP)) {
+			AML_INT_EVAL_SUBTREE_OP)
+		    || (op->common.parent->common.aml_opcode ==
+			AML_BANK_FIELD_OP)) {
 			/*
 			 * These opcodes allow term_arg(s) as operands and therefore
 			 * the operands can be method calls.  The result is used.
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index 8ba4bb3..bfe4450 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -652,6 +652,17 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 				if (ACPI_FAILURE(status)) {
 					break;
 				}
+			} else if (op->common.aml_opcode == AML_BANK_FIELD_OP) {
+				ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+						  "Executing BankField Op=%p\n",
+						  op));
+
+				status =
+				    acpi_ds_eval_bank_field_operands(walk_state,
+								     op);
+				if (ACPI_FAILURE(status)) {
+					break;
+				}
 			}
 			break;
 
diff --git a/drivers/acpi/executer/exprep.c b/drivers/acpi/executer/exprep.c
index efe5d4b..6eb45bf 100644
--- a/drivers/acpi/executer/exprep.c
+++ b/drivers/acpi/executer/exprep.c
@@ -412,6 +412,7 @@ acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc,
 acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
 {
 	union acpi_operand_object *obj_desc;
+	union acpi_operand_object *second_desc = NULL;
 	u32 type;
 	acpi_status status;
 
@@ -494,6 +495,20 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
 				  obj_desc->field.access_byte_width,
 				  obj_desc->bank_field.region_obj,
 				  obj_desc->bank_field.bank_obj));
+
+		/*
+		 * Remember location in AML stream of the field unit
+		 * opcode and operands -- since the bank_value
+		 * operands must be evaluated.
+		 */
+		second_desc = obj_desc->common.next_object;
+		second_desc->extra.aml_start =
+		    ((union acpi_parse_object *)(info->data_register_node))->
+		    named.data;
+		second_desc->extra.aml_length =
+		    ((union acpi_parse_object *)(info->data_register_node))->
+		    named.length;
+
 		break;
 
 	case ACPI_TYPE_LOCAL_INDEX_FIELD:
diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c
index 33db224..72b3245 100644
--- a/drivers/acpi/namespace/nsinit.c
+++ b/drivers/acpi/namespace/nsinit.c
@@ -244,6 +244,10 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
 		info->field_count++;
 		break;
 
+	case ACPI_TYPE_LOCAL_BANK_FIELD:
+		info->field_count++;
+		break;
+
 	case ACPI_TYPE_BUFFER:
 		info->buffer_count++;
 		break;
@@ -287,6 +291,12 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
 		status = acpi_ds_get_buffer_field_arguments(obj_desc);
 		break;
 
+	case ACPI_TYPE_LOCAL_BANK_FIELD:
+
+		info->field_init++;
+		status = acpi_ds_get_bank_field_arguments(obj_desc);
+		break;
+
 	case ACPI_TYPE_BUFFER:
 
 		info->buffer_init++;
diff --git a/drivers/acpi/parser/psloop.c b/drivers/acpi/parser/psloop.c
index a079975..a7c7688 100644
--- a/drivers/acpi/parser/psloop.c
+++ b/drivers/acpi/parser/psloop.c
@@ -325,6 +325,15 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state,
 		op->named.length = 0;
 	}
 
+	if (walk_state->opcode == AML_BANK_FIELD_OP) {
+		/*
+		 * Backup to beginning of bank_field declaration
+		 * body_length is unknown until we parse the body
+		 */
+		op->named.data = aml_op_start;
+		op->named.length = 0;
+	}
+
 	parent_scope = acpi_ps_get_parent_scope(&(walk_state->parser_state));
 	acpi_ps_append_arg(parent_scope, op);
 
@@ -1040,6 +1049,16 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
 			    (u32) (parser_state->aml - op->named.data);
 		}
 
+		if (op->common.aml_opcode == AML_BANK_FIELD_OP) {
+			/*
+			 * Backup to beginning of bank_field declaration
+			 *
+			 * body_length is unknown until we parse the body
+			 */
+			op->named.length =
+			    (u32) (parser_state->aml - op->named.data);
+		}
+
 		/* This op complete, notify the dispatcher */
 
 		if (walk_state->ascending_callback != NULL) {
diff --git a/drivers/acpi/parser/psopcode.c b/drivers/acpi/parser/psopcode.c
index b273a0a..18ed59d 100644
--- a/drivers/acpi/parser/psopcode.c
+++ b/drivers/acpi/parser/psopcode.c
@@ -520,9 +520,10 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {
 		 AML_TYPE_NAMED_FIELD,
 		 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
 /* 5F */ ACPI_OP("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP,
-		 ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT,
+		 ACPI_TYPE_LOCAL_BANK_FIELD, AML_CLASS_NAMED_OBJECT,
 		 AML_TYPE_NAMED_FIELD,
-		 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
+		 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD |
+		 AML_DEFER),
 
 /* Internal opcodes that map to invalid AML opcodes */
 
diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
index 1442e55..a8995ca 100644
--- a/drivers/acpi/parser/psparse.c
+++ b/drivers/acpi/parser/psparse.c
@@ -205,6 +205,8 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
 			    || (op->common.parent->common.aml_opcode ==
 				AML_PACKAGE_OP)
 			    || (op->common.parent->common.aml_opcode ==
+				AML_BANK_FIELD_OP)
+			    || (op->common.parent->common.aml_opcode ==
 				AML_VAR_PACKAGE_OP)) {
 				replacement_op =
 				    acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP);
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 6a763cd..f5b2f6a 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -252,6 +252,17 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
 		}
 		break;
 
+	case ACPI_TYPE_LOCAL_BANK_FIELD:
+
+		ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
+				  "***** Bank Field %p\n", object));
+
+		second_desc = acpi_ns_get_secondary_object(object);
+		if (second_desc) {
+			acpi_ut_delete_object_desc(second_desc);
+		}
+		break;
+
 	default:
 		break;
 	}
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index e08b3fa..1eccd3d 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -107,6 +107,7 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name,
 	switch (type) {
 	case ACPI_TYPE_REGION:
 	case ACPI_TYPE_BUFFER_FIELD:
+	case ACPI_TYPE_LOCAL_BANK_FIELD:
 
 		/* These types require a secondary object */
 
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index d8dabe8..a5b97f0 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -53,6 +53,9 @@
 acpi_status
 acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc);
 
+acpi_status
+acpi_ds_get_bank_field_arguments(union acpi_operand_object *obj_desc);
+
 acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *rgn_desc);
 
 acpi_status acpi_ds_get_buffer_arguments(union acpi_operand_object *obj_desc);
@@ -76,6 +79,10 @@ acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state,
 				  union acpi_parse_object *op,
 				  union acpi_operand_object *obj_desc);
 
+acpi_status
+acpi_ds_eval_bank_field_operands(struct acpi_walk_state *walk_state,
+				 union acpi_parse_object *op);
+
 acpi_status acpi_ds_initialize_region(acpi_handle obj_handle);
 
 /*
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 46/73] ACPICA: Fixed a couple memory leaks associated with "implicit return" objects when the AML Interpreter slack mode is enabled
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (43 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 45/73] ACPICA: Implemented full argument resolution support for the BankValue argument to BankField Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-22 18:24     ` Len Brown
  2008-04-12  4:25   ` [PATCH 47/73] ACPICA: Update version to 20071219 Len Brown
                     ` (26 subsequent siblings)
  71 siblings, 1 reply; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Lin Ming BZ 349

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsmethod.c |    3 +++
 drivers/acpi/dispatcher/dsmthdat.c |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index 7a99740..9e24641 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -103,6 +103,9 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
 						    NULL);
 		acpi_ex_enter_interpreter();
 	}
+
+	acpi_ds_clear_implicit_return(walk_state);
+
 #ifdef ACPI_DISASSEMBLER
 	if (ACPI_FAILURE(status)) {
 
diff --git a/drivers/acpi/dispatcher/dsmthdat.c b/drivers/acpi/dispatcher/dsmthdat.c
index ba4626e..38510d1 100644
--- a/drivers/acpi/dispatcher/dsmthdat.c
+++ b/drivers/acpi/dispatcher/dsmthdat.c
@@ -172,6 +172,8 @@ void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state)
 		}
 	}
 
+	acpi_ds_clear_implicit_return(walk_state);
+
 	return_VOID;
 }
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 47/73] ACPICA: Update version to 20071219
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (44 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 46/73] ACPICA: Fixed a couple memory leaks associated with "implicit return" objects when the AML Interpreter slack mode is enabled Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 48/73] ACPICA: Fix for SizeOf when used with Buffers and Packages Len Brown
                     ` (25 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Update version to 20071219.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index c21e12d..010703e 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20071114
+#define ACPI_CA_VERSION                 0x20071219
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 48/73] ACPICA: Fix for SizeOf when used with Buffers and Packages
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (45 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 47/73] ACPICA: Update version to 20071219 Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 49/73] ACPICA: Methods now implicitly return 0 in slack mode Len Brown
                     ` (24 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem with the SizeOf operator when used with Package
and Buffer objects. These objects have deferred execution for some
arguments, and the execution is now completed before the SizeOf is
executed. This problem caused unexpected AE_PACKAGE_LIMIT errors
on some systems (Lin Ming, Bob Moore) BZ 9558

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exoparg1.c |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index ab5c037..313803b 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -740,26 +740,38 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 			value = acpi_gbl_integer_byte_width;
 			break;
 
-		case ACPI_TYPE_BUFFER:
-			value = temp_desc->buffer.length;
-			break;
-
 		case ACPI_TYPE_STRING:
 			value = temp_desc->string.length;
 			break;
 
+		case ACPI_TYPE_BUFFER:
+
+			/* Buffer arguments may not be evaluated at this point */
+
+			status = acpi_ds_get_buffer_arguments(temp_desc);
+			value = temp_desc->buffer.length;
+			break;
+
 		case ACPI_TYPE_PACKAGE:
+
+			/* Package arguments may not be evaluated at this point */
+
+			status = acpi_ds_get_package_arguments(temp_desc);
 			value = temp_desc->package.count;
 			break;
 
 		default:
 			ACPI_ERROR((AE_INFO,
-				    "Operand is not Buf/Int/Str/Pkg - found type %s",
+				    "Operand must be Buffer/Integer/String/Package - found type %s",
 				    acpi_ut_get_type_name(type)));
 			status = AE_AML_OPERAND_TYPE;
 			goto cleanup;
 		}
 
+		if (ACPI_FAILURE(status)) {
+			goto cleanup;
+		}
+
 		/*
 		 * Now that we have the size of the object, create a result
 		 * object to hold the value
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 49/73] ACPICA: Methods now implicitly return 0 in slack mode
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (46 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 48/73] ACPICA: Fix for SizeOf when used with Buffers and Packages Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 50/73] ACPICA: Fix for Load operator Len Brown
                     ` (23 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Implemented an enhancement to the interpreter "slack mode". In the
absence of an explicit return or an implicitly returned object from
the last executed opcode, a control method will now implicitly
return an integer of value 0 for Microsoft compatibility. (Lin
Ming) BZ 392

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/parser/psparse.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c
index a8995ca..a4c4020 100644
--- a/drivers/acpi/parser/psparse.c
+++ b/drivers/acpi/parser/psparse.c
@@ -594,6 +594,30 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
 				 * The object is deleted
 				 */
 				if (!previous_walk_state->return_desc) {
+					/*
+					 * In slack mode execution, if there is no return value
+					 * we should implicitly return zero (0) as a default value.
+					 */
+					if (acpi_gbl_enable_interpreter_slack &&
+					    !previous_walk_state->
+					    implicit_return_obj) {
+						previous_walk_state->
+						    implicit_return_obj =
+						    acpi_ut_create_internal_object
+						    (ACPI_TYPE_INTEGER);
+						if (!previous_walk_state->
+						    implicit_return_obj) {
+							return_ACPI_STATUS
+							    (AE_NO_MEMORY);
+						}
+
+						previous_walk_state->
+						    implicit_return_obj->
+						    integer.value = 0;
+					}
+
+					/* Restart the calling control method */
+
 					status =
 					    acpi_ds_restart_control_method
 					    (walk_state,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 50/73] ACPICA: Fix for Load operator
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (47 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 49/73] ACPICA: Methods now implicitly return 0 in slack mode Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 51/73] ACPICA: Fix for LoadTable operator, input strings Len Brown
                     ` (22 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem with the Load operator where an exception was not
returned in the case where the table is already loaded. (Lin Ming)
BZ 463

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/tables/tbinstal.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 6a6ee1f..c4a9abb 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -169,6 +169,7 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc,
 
 		acpi_tb_delete_table(table_desc);
 		*table_index = i;
+		status = AE_ALREADY_EXISTS;
 		goto release;
 	}
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 51/73] ACPICA: Fix for LoadTable operator, input strings
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (48 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 50/73] ACPICA: Fix for Load operator Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 52/73] ACPICA: Include file support for new ACPI tables Len Brown
                     ` (21 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem with the LoadTable operator where the OemId
and OemTableId input strings could cause unexpected failures if
they were shorter than the maximum lengths allowed. (Lin Ming,
Bob Moore) BZ 576

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exconfig.c |    5 +----
 drivers/acpi/tables/tbfind.c     |   32 +++++++++++++++++++++++---------
 2 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 52b1e95..ed92fb5 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -236,7 +236,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
 	status = acpi_get_table_by_index(table_index, &table);
 	if (ACPI_SUCCESS(status)) {
 		ACPI_INFO((AE_INFO,
-			   "Dynamic OEM Table Load - [%4.4s] OemId [%6.6s] OemTableId [%8.8s]",
+			   "Dynamic OEM Table Load - [%.4s] OemId [%.6s] OemTableId [%.8s]",
 			   table->signature, table->oem_id,
 			   table->oem_table_id));
 	}
@@ -472,8 +472,5 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)
 
 	acpi_tb_set_table_loaded_flag(table_index, FALSE);
 
-	/* Delete the table descriptor (ddb_handle) */
-
-	acpi_ut_remove_reference(table_desc);
 	return_ACPI_STATUS(AE_OK);
 }
diff --git a/drivers/acpi/tables/tbfind.c b/drivers/acpi/tables/tbfind.c
index 058c064..772ca41 100644
--- a/drivers/acpi/tables/tbfind.c
+++ b/drivers/acpi/tables/tbfind.c
@@ -70,12 +70,22 @@ acpi_tb_find_table(char *signature,
 {
 	acpi_native_uint i;
 	acpi_status status;
+	struct acpi_table_header header;
 
 	ACPI_FUNCTION_TRACE(tb_find_table);
 
+	/* Normalize the input strings */
+
+	ACPI_MEMSET(&header, 0, sizeof(struct acpi_table_header));
+	ACPI_STRNCPY(header.signature, signature, ACPI_NAME_SIZE);
+	ACPI_STRNCPY(header.oem_id, oem_id, ACPI_OEM_ID_SIZE);
+	ACPI_STRNCPY(header.oem_table_id, oem_table_id, ACPI_OEM_TABLE_ID_SIZE);
+
+	/* Search for the table */
+
 	for (i = 0; i < acpi_gbl_root_table_list.count; ++i) {
 		if (ACPI_MEMCMP(&(acpi_gbl_root_table_list.tables[i].signature),
-				signature, ACPI_NAME_SIZE)) {
+				header.signature, ACPI_NAME_SIZE)) {
 
 			/* Not the requested table */
 
@@ -104,20 +114,24 @@ acpi_tb_find_table(char *signature,
 
 		if (!ACPI_MEMCMP
 		    (acpi_gbl_root_table_list.tables[i].pointer->signature,
-		     signature, ACPI_NAME_SIZE) && (!oem_id[0]
-						    ||
-						    !ACPI_MEMCMP
-						    (acpi_gbl_root_table_list.
-						     tables[i].pointer->oem_id,
-						     oem_id, ACPI_OEM_ID_SIZE))
+		     header.signature, ACPI_NAME_SIZE) && (!oem_id[0]
+							   ||
+							   !ACPI_MEMCMP
+							   (acpi_gbl_root_table_list.
+							    tables[i].pointer->
+							    oem_id,
+							    header.oem_id,
+							    ACPI_OEM_ID_SIZE))
 		    && (!oem_table_id[0]
 			|| !ACPI_MEMCMP(acpi_gbl_root_table_list.tables[i].
-					pointer->oem_table_id, oem_table_id,
+					pointer->oem_table_id,
+					header.oem_table_id,
 					ACPI_OEM_TABLE_ID_SIZE))) {
 			*table_index = i;
 
 			ACPI_DEBUG_PRINT((ACPI_DB_TABLES,
-					  "Found table [%4.4s]\n", signature));
+					  "Found table [%4.4s]\n",
+					  header.signature));
 			return_ACPI_STATUS(AE_OK);
 		}
 	}
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 52/73] ACPICA: Include file support for new ACPI tables
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (49 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 51/73] ACPICA: Fix for LoadTable operator, input strings Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 53/73] ACPICA: Bulletproof disassembler for bad " Len Brown
                     ` (20 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Implemented header file support for new ACPI tables - BERT, ERST,
EINJ, HEST, IBFT, UEFI, WDAT. Disassembler support is forthcoming.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/actbl1.h |  335 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 334 insertions(+), 1 deletions(-)

diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index dd8e11e..5d39992 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -58,12 +58,17 @@
  * it more difficult to inadvertently type in the wrong signature.
  */
 #define ACPI_SIG_ASF            "ASF!"	/* Alert Standard Format table */
+#define ACPI_SIG_BERT           "BERT"	/* Boot Error Record Table */
 #define ACPI_SIG_BOOT           "BOOT"	/* Simple Boot Flag Table */
 #define ACPI_SIG_CPEP           "CPEP"	/* Corrected Platform Error Polling table */
 #define ACPI_SIG_DBGP           "DBGP"	/* Debug Port table */
 #define ACPI_SIG_DMAR           "DMAR"	/* DMA Remapping table */
 #define ACPI_SIG_ECDT           "ECDT"	/* Embedded Controller Boot Resources Table */
+#define ACPI_SIG_EINJ           "EINJ"	/* Error Injection table */
+#define ACPI_SIG_ERST           "ERST"	/* Error Record Serialization Table */
+#define ACPI_SIG_HEST           "HEST"	/* Hardware Error Source Table */
 #define ACPI_SIG_HPET           "HPET"	/* High Precision Event Timer table */
+#define ACPI_SIG_IBFT           "IBFT"	/* i_sCSI Boot Firmware Table */
 #define ACPI_SIG_MADT           "APIC"	/* Multiple APIC Description Table */
 #define ACPI_SIG_MCFG           "MCFG"	/* PCI Memory Mapped Configuration table */
 #define ACPI_SIG_SBST           "SBST"	/* Smart Battery Specification Table */
@@ -73,6 +78,8 @@
 #define ACPI_SIG_SPMI           "SPMI"	/* Server Platform Management Interface table */
 #define ACPI_SIG_SRAT           "SRAT"	/* System Resource Affinity Table */
 #define ACPI_SIG_TCPA           "TCPA"	/* Trusted Computing Platform Alliance table */
+#define ACPI_SIG_UEFI           "UEFI"	/* Uefi Boot Optimization Table */
+#define ACPI_SIG_WDAT           "WDAT"	/* Watchdog Action Table */
 #define ACPI_SIG_WDRT           "WDRT"	/* Watchdog Resource Table */
 
 /*
@@ -87,13 +94,25 @@
  * portable, so do not use any other bitfield types.
  */
 
-/* Common Sub-table header (used in MADT, SRAT, etc.) */
+/* Common Subtable header (used in MADT, SRAT, etc.) */
 
 struct acpi_subtable_header {
 	u8 type;
 	u8 length;
 };
 
+/* Common Subtable header for WHEA tables (EINJ, ERST, WDAT) */
+
+struct acpi_whea_header {
+	u8 action;
+	u8 instruction;
+	u8 flags;
+	u8 reserved;
+	struct acpi_generic_address register_region;
+	u32 value;		/* Value used with Read/Write register */
+	u32 mask;		/* Bitmask required for this register instruction */
+};
+
 /*******************************************************************************
  *
  * ASF - Alert Standard Format table (Signature "ASF!")
@@ -205,6 +224,34 @@ struct acpi_asf_address {
 
 /*******************************************************************************
  *
+ * BERT - Boot Error Record Table
+ *
+ ******************************************************************************/
+
+struct acpi_table_bert {
+	struct acpi_table_header header;	/* Common ACPI table header */
+	u32 region_length;	/* Length of the boot error region */
+	u64 address;		/* Physical addresss of the error region */
+};
+
+struct acpi_bert_region {
+	u32 block_status;
+	u32 raw_data_offset;
+	u32 raw_data_length;
+	u32 data_length;
+	u32 error_severity;
+	u8 error_data[1];
+};
+
+/* block_status Flags */
+
+#define ACPI_BERT_UNCORRECTABLE             (1)
+#define ACPI_BERT_CORRECTABLE               (2)
+#define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (4)
+#define ACPI_BERT_MULTIPLE_CORRECTABLE      (8)
+
+/*******************************************************************************
+ *
  * BOOT - Simple Boot Flag Table
  *
  ******************************************************************************/
@@ -351,6 +398,130 @@ struct acpi_table_ecdt {
 
 /*******************************************************************************
  *
+ * EINJ - Error Injection Table
+ *
+ ******************************************************************************/
+
+struct acpi_table_einj {
+	struct acpi_table_header header;	/* Common ACPI table header */
+	u32 header_length;
+	u32 reserved;
+	u32 entries;
+};
+
+/* EINJ Injection Instruction Entries (actions) */
+
+struct acpi_einj_entry {
+	struct acpi_whea_header whea_header;	/* Common header for WHEA tables */
+};
+
+/* Values for Action field above */
+
+enum acpi_einj_actions {
+	ACPI_EINJ_BEGIN_OPERATION = 0,
+	ACPI_EINJ_GET_TRIGGER_TABLE = 1,
+	ACPI_EINJ_SET_ERROR_TYPE = 2,
+	ACPI_EINJ_GET_ERROR_TYPE = 3,
+	ACPI_EINJ_END_OPERATION = 4,
+	ACPI_EINJ_EXECUTE_OPERATION = 5,
+	ACPI_EINJ_CHECK_BUSY_STATUS = 6,
+	ACPI_EINJ_GET_COMMAND_STATUS = 7,
+	ACPI_EINJ_ACTION_RESERVED = 8,	/* 8 and greater are reserved */
+	ACPI_EINJ_TRIGGER_ERROR = 0xFF	/* Except for this value */
+};
+
+/* Values for Instruction field above */
+
+enum acpi_einj_instructions {
+	ACPI_EINJ_READ_REGISTER = 0,
+	ACPI_EINJ_READ_REGISTER_VALUE = 1,
+	ACPI_EINJ_WRITE_REGISTER = 2,
+	ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
+	ACPI_EINJ_NOOP = 4,
+	ACPI_EINJ_INSTRUCTION_RESERVED = 5	/* 5 and greater are reserved */
+};
+
+/*******************************************************************************
+ *
+ * ERST - Error Record Serialization Table
+ *
+ ******************************************************************************/
+
+struct acpi_table_erst {
+	struct acpi_table_header header;	/* Common ACPI table header */
+	u32 header_length;
+	u32 reserved;
+	u32 entries;
+};
+
+/* ERST Serialization Entries (actions) */
+
+struct acpi_erst_entry {
+	struct acpi_whea_header whea_header;	/* Common header for WHEA tables */
+};
+
+/* Values for Action field above */
+
+enum acpi_erst_actions {
+	ACPI_ERST_BEGIN_WRITE_OPERATION = 0,
+	ACPI_ERST_BEGIN_READ_OPERATION = 1,
+	ACPI_ERST_BETGIN_CLEAR_OPERATION = 2,
+	ACPI_ERST_END_OPERATION = 3,
+	ACPI_ERST_SET_RECORD_OFFSET = 4,
+	ACPI_ERST_EXECUTE_OPERATION = 5,
+	ACPI_ERST_CHECK_BUSY_STATUS = 6,
+	ACPI_ERST_GET_COMMAND_STATUS = 7,
+	ACPI_ERST_GET_RECORD_IDENTIFIER = 8,
+	ACPI_ERST_SET_RECORD_IDENTIFIER = 9,
+	ACPI_ERST_GET_RECORD_COUNT = 10,
+	ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
+	ACPI_ERST_NOT_USED = 12,
+	ACPI_ERST_GET_ERROR_RANGE = 13,
+	ACPI_ERST_GET_ERROR_LENGTH = 14,
+	ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
+	ACPI_ERST_ACTION_RESERVED = 16	/* 16 and greater are reserved */
+};
+
+/* Values for Instruction field above */
+
+enum acpi_erst_instructions {
+	ACPI_ERST_READ_REGISTER = 0,
+	ACPI_ERST_READ_REGISTER_VALUE = 1,
+	ACPI_ERST_WRITE_REGISTER = 2,
+	ACPI_ERST_WRITE_REGISTER_VALUE = 3,
+	ACPI_ERST_NOOP = 4,
+	ACPI_ERST_LOAD_VAR1 = 5,
+	ACPI_ERST_LOAD_VAR2 = 6,
+	ACPI_ERST_STORE_VAR1 = 7,
+	ACPI_ERST_ADD = 8,
+	ACPI_ERST_SUBTRACT = 9,
+	ACPI_ERST_ADD_VALUE = 10,
+	ACPI_ERST_SUBTRACT_VALUE = 11,
+	ACPI_ERST_STALL = 12,
+	ACPI_ERST_STALL_WHILE_TRUE = 13,
+	ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
+	ACPI_ERST_GOTO = 15,
+	ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
+	ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
+	ACPI_ERST_MOVE_DATA = 18,
+	ACPI_ERST_INSTRUCTION_RESERVED = 19	/* 19 and greater are reserved */
+};
+
+/*******************************************************************************
+ *
+ * HEST - Hardware Error Source Table
+ *
+ ******************************************************************************/
+
+struct acpi_table_hest {
+	struct acpi_table_header header;	/* Common ACPI table header */
+	u32 error_source_count;
+};
+
+/* TBD: Need Error Source Descriptor layout */
+
+/*******************************************************************************
+ *
  * HPET - High Precision Event Timer table
  *
  ******************************************************************************/
@@ -374,6 +545,96 @@ struct acpi_table_hpet {
 
 /*******************************************************************************
  *
+ * IBFT - i_sCSI Boot Firmware Table
+ *
+ ******************************************************************************/
+
+struct acpi_table_ibft {
+	struct acpi_table_header header;	/* Common ACPI table header */
+	u8 reserved[12];
+};
+
+/* IBFT common subtable header */
+
+struct acpi_ibft_header {
+	u8 type;
+	u8 version;
+	u16 length;
+	u8 index;
+	u8 flags;
+};
+
+/* Values for Type field above */
+
+enum acpi_ibft_type {
+	ACPI_IBFT_TYPE_NOT_USED = 0,
+	ACPI_IBFT_TYPE_CONTROL = 1,
+	ACPI_IBFT_TYPE_INITIATOR = 2,
+	ACPI_IBFT_TYPE_NIC = 3,
+	ACPI_IBFT_TYPE_TARGET = 4,
+	ACPI_IBFT_TYPE_EXTENSIONS = 5,
+	ACPI_IBFT_TYPE_RESERVED = 6	/* 6 and greater are reserved */
+};
+
+/* IBFT subtables */
+
+struct acpi_ibft_control {
+	struct acpi_ibft_header header;
+	u16 extensions;
+	u16 initiator_offset;
+	u16 nic0_offset;
+	u16 target0_offset;
+	u16 nic1_offset;
+	u16 target1_offset;
+};
+
+struct acpi_ibft_initiator {
+	struct acpi_ibft_header header;
+	u8 sns_server[16];
+	u8 slp_server[16];
+	u8 primary_server[16];
+	u8 secondary_server[16];
+	u16 name_length;
+	u16 name_offset;
+};
+
+struct acpi_ibft_nic {
+	struct acpi_ibft_header header;
+	u8 ip_address[16];
+	u8 subnet_mask_prefix;
+	u8 origin;
+	u8 gateway[16];
+	u8 primary_dns[16];
+	u8 secondary_dns[16];
+	u8 dhcp[16];
+	u16 vlan;
+	u8 mac_address[6];
+	u16 pci_address;
+	u16 name_length;
+	u16 name_offset;
+};
+
+struct acpi_ibft_target {
+	struct acpi_ibft_header header;
+	u8 target_ip_address[16];
+	u16 target_ip_socket;
+	u8 target_boot_lun[8];
+	u8 chap_type;
+	u8 nic_association;
+	u16 target_name_length;
+	u16 target_name_offset;
+	u16 chap_name_length;
+	u16 chap_name_offset;
+	u16 chap_secret_length;
+	u16 chap_secret_offset;
+	u16 reverse_chap_name_length;
+	u16 reverse_chap_name_offset;
+	u16 reverse_chap_secret_length;
+	u16 reverse_chap_secret_offset;
+};
+
+/*******************************************************************************
+ *
  * MADT - Multiple APIC Description Table
  *
  ******************************************************************************/
@@ -698,6 +959,78 @@ struct acpi_table_tcpa {
 
 /*******************************************************************************
  *
+ * UEFI - UEFI Boot optimization Table
+ *
+ ******************************************************************************/
+
+struct acpi_table_uefi {
+	struct acpi_table_header header;	/* Common ACPI table header */
+	u8 identifier[16];	/* UUID identifier */
+	u16 data_offset;	/* Offset of remaining data in table */
+	u8 data;
+};
+
+/*******************************************************************************
+ *
+ * WDAT - Watchdog Action Table
+ *
+ ******************************************************************************/
+
+struct acpi_table_wdat {
+	struct acpi_table_header header;	/* Common ACPI table header */
+	u32 header_length;	/* Watchdog Header Length */
+	u16 pci_segment;	/* PCI Segment number */
+	u8 pci_bus;		/* PCI Bus number */
+	u8 pci_device;		/* PCI Device number */
+	u8 pci_function;	/* PCI Function number */
+	u8 reserved[3];
+	u32 timer_period;	/* Period of one timer count (msec) */
+	u32 max_count;		/* Maximum counter value supported */
+	u32 min_count;		/* Minimum counter value */
+	u8 flags;
+	u8 reserved2[3];
+	u32 entries;		/* Number of watchdog entries that follow */
+};
+
+/* WDAT Instruction Entries (actions) */
+
+struct acpi_wdat_entry {
+	struct acpi_whea_header whea_header;	/* Common header for WHEA tables */
+};
+
+/* Values for Action field above */
+
+enum acpi_wdat_actions {
+	ACPI_WDAT_RESET = 1,
+	ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
+	ACPI_WDAT_GET_COUNTDOWN = 5,
+	ACPI_WDAT_SET_COUNTDOWN = 6,
+	ACPI_WDAT_GET_RUNNING_STATE = 8,
+	ACPI_WDAT_SET_RUNNING_STATE = 9,
+	ACPI_WDAT_GET_STOPPED_STATE = 10,
+	ACPI_WDAT_SET_STOPPED_STATE = 11,
+	ACPI_WDAT_GET_REBOOT = 16,
+	ACPI_WDAT_SET_REBOOT = 17,
+	ACPI_WDAT_GET_SHUTDOWN = 18,
+	ACPI_WDAT_SET_SHUTDOWN = 19,
+	ACPI_WDAT_GET_STATUS = 32,
+	ACPI_WDAT_SET_STATUS = 33,
+	ACPI_WDAT_ACTION_RESERVED = 34	/* 34 and greater are reserved */
+};
+
+/* Values for Instruction field above */
+
+enum acpi_wdat_instructions {
+	ACPI_WDAT_READ_VALUE = 0,
+	ACPI_WDAT_READ_COUNTDOWN = 1,
+	ACPI_WDAT_WRITE_VALUE = 2,
+	ACPI_WDAT_WRITE_COUNTDOWN = 3,
+	ACPI_WDAT_INSTRUCTION_RESERVED = 4,	/* 4 and greater are reserved */
+	ACPI_WDAT_PRESERVE_REGISTER = 0x80	/* Except for this value */
+};
+
+/*******************************************************************************
+ *
  * WDRT - Watchdog Resource Table
  *
  ******************************************************************************/
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 53/73] ACPICA: Bulletproof disassembler for bad ACPI tables
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (50 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 52/73] ACPICA: Include file support for new ACPI tables Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 54/73] ACPICA: Fixes for Unload and DDBHandles Len Brown
                     ` (19 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem with the disassembler where invalid ACPI tables
could cause faults or infinite loops.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acdisasm.h |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 67d152e..07d5241 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -97,11 +97,12 @@ typedef const struct acpi_dmtable_info {
 #define ACPI_DMT_CHKSUM                 20
 #define ACPI_DMT_SPACEID                21
 #define ACPI_DMT_GAS                    22
-#define ACPI_DMT_DMAR                   23
-#define ACPI_DMT_MADT                   24
-#define ACPI_DMT_SRAT                   25
-#define ACPI_DMT_EXIT                   26
-#define ACPI_DMT_SIG                    27
+#define ACPI_DMT_ASF                    23
+#define ACPI_DMT_DMAR                   24
+#define ACPI_DMT_MADT                   25
+#define ACPI_DMT_SRAT                   26
+#define ACPI_DMT_EXIT                   27
+#define ACPI_DMT_SIG                    28
 
 typedef
 void (*acpi_dmtable_handler) (struct acpi_table_header * table);
@@ -195,7 +196,7 @@ extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[];
  */
 void acpi_dm_dump_data_table(struct acpi_table_header *table);
 
-void
+acpi_status
 acpi_dm_dump_table(u32 table_length,
 		   u32 table_offset,
 		   void *table,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 54/73] ACPICA: Fixes for Unload and DDBHandles
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (51 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 53/73] ACPICA: Bulletproof disassembler for bad " Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 55/73] ACPICA: Update version to 20080123 Len Brown
                     ` (18 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Implemented support for the use of DDBHandles as an Indexed
Reference, as per the ACPI spec. (Lin Ming) BZ 486. Implemented
support for UserTerm (Method invocation) for the Unload operator
as per the ACPI spec. (Lin Ming) BZ 580

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exdump.c   |   27 +++++++++++++++++++--------
 drivers/acpi/executer/exresolv.c |   13 +++++++++----
 drivers/acpi/executer/exstore.c  |   23 ++++++++++++++++++-----
 drivers/acpi/parser/psargs.c     |   37 ++++++++++++++++++++++++++++++++++---
 drivers/acpi/utilities/utcopy.c  |    8 ++++++++
 5 files changed, 88 insertions(+), 20 deletions(-)

diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index 251d84b..ed560e6 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -895,14 +895,25 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
 	} else if (obj_desc->reference.object) {
 		if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
 		    ACPI_DESC_TYPE_OPERAND) {
-			acpi_os_printf(" Target: %p [%s]\n",
-				       obj_desc->reference.object,
-				       acpi_ut_get_type_name(((union
-							       acpi_operand_object
-							       *)obj_desc->
-							      reference.
-							      object)->common.
-							     type));
+			acpi_os_printf(" Target: %p",
+				       obj_desc->reference.object);
+			if (obj_desc->reference.opcode == AML_LOAD_OP) {
+				/*
+				 * For DDBHandle reference,
+				 * obj_desc->Reference.Object is the table index
+				 */
+				acpi_os_printf(" [DDBHandle]\n");
+			} else {
+				acpi_os_printf(" [%s]\n",
+					       acpi_ut_get_type_name(((union
+								       acpi_operand_object
+								       *)
+								      obj_desc->
+								      reference.
+								      object)->
+								     common.
+								     type));
+			}
 		} else {
 			acpi_os_printf(" Target: %p\n",
 				       obj_desc->reference.object);
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index 9c3cdf6..5b5b2ff 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -382,10 +382,10 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
 	}
 
 	/*
-	 * For reference objects created via the ref_of or Index operators,
-	 * we need to get to the base object (as per the ACPI specification
-	 * of the object_type and size_of operators). This means traversing
-	 * the list of possibly many nested references.
+	 * For reference objects created via the ref_of, Index, or Load/load_table
+	 * operators, we need to get to the base object (as per the ACPI
+	 * specification of the object_type and size_of operators). This means
+	 * traversing the list of possibly many nested references.
 	 */
 	while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
 		switch (obj_desc->reference.opcode) {
@@ -455,6 +455,11 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
 			}
 			break;
 
+		case AML_LOAD_OP:
+
+			type = ACPI_TYPE_DDB_HANDLE;
+			goto exit;
+
 		case AML_LOCAL_OP:
 		case AML_ARG_OP:
 
diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index 2408122..725614e 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -434,11 +434,24 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
 		 */
 		obj_desc = *(index_desc->reference.where);
 
-		status =
-		    acpi_ut_copy_iobject_to_iobject(source_desc, &new_desc,
-						    walk_state);
-		if (ACPI_FAILURE(status)) {
-			return_ACPI_STATUS(status);
+		if (ACPI_GET_OBJECT_TYPE(source_desc) ==
+		    ACPI_TYPE_LOCAL_REFERENCE
+		    && source_desc->reference.opcode == AML_LOAD_OP) {
+
+			/* This is a DDBHandle, just add a reference to it */
+
+			acpi_ut_add_reference(source_desc);
+			new_desc = source_desc;
+		} else {
+			/* Normal object, copy it */
+
+			status =
+			    acpi_ut_copy_iobject_to_iobject(source_desc,
+							    &new_desc,
+							    walk_state);
+			if (ACPI_FAILURE(status)) {
+				return_ACPI_STATUS(status);
+			}
 		}
 
 		if (obj_desc) {
diff --git a/drivers/acpi/parser/psargs.c b/drivers/acpi/parser/psargs.c
index 442880f..2a3a948 100644
--- a/drivers/acpi/parser/psargs.c
+++ b/drivers/acpi/parser/psargs.c
@@ -235,6 +235,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
 	union acpi_parse_object *name_op;
 	union acpi_operand_object *method_desc;
 	struct acpi_namespace_node *node;
+	u8 *start = parser_state->aml;
 
 	ACPI_FUNCTION_TRACE(ps_get_next_namepath);
 
@@ -267,6 +268,16 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
 	 */
 	if (ACPI_SUCCESS(status) &&
 	    possible_method_call && (node->type == ACPI_TYPE_METHOD)) {
+		if (walk_state->op->common.aml_opcode == AML_UNLOAD_OP) {
+			/*
+			 * acpi_ps_get_next_namestring has increased the AML pointer,
+			 * so we need to restore the saved AML pointer for method call.
+			 */
+			walk_state->parser_state.aml = start;
+			walk_state->arg_count = 1;
+			acpi_ps_init_op(arg, AML_INT_METHODCALL_OP);
+			return_ACPI_STATUS(AE_OK);
+		}
 
 		/* This name is actually a control method invocation */
 
@@ -678,9 +689,29 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 				return_ACPI_STATUS(AE_NO_MEMORY);
 			}
 
-			status =
-			    acpi_ps_get_next_namepath(walk_state, parser_state,
-						      arg, 0);
+			/* To support super_name arg of Unload */
+
+			if (walk_state->op->common.aml_opcode == AML_UNLOAD_OP) {
+				status =
+				    acpi_ps_get_next_namepath(walk_state,
+							      parser_state, arg,
+							      1);
+
+				/*
+				 * If the super_name arg of Unload is a method call,
+				 * we have restored the AML pointer, just free this Arg
+				 */
+				if (arg->common.aml_opcode ==
+				    AML_INT_METHODCALL_OP) {
+					acpi_ps_free_op(arg);
+					arg = NULL;
+				}
+			} else {
+				status =
+				    acpi_ps_get_next_namepath(walk_state,
+							      parser_state, arg,
+							      0);
+			}
 		} else {
 			/* Single complex argument, nothing returned */
 
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index b56953d..ba89971 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -709,7 +709,15 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
 		/*
 		 * We copied the reference object, so we now must add a reference
 		 * to the object pointed to by the reference
+		 *
+		 * DDBHandle reference (from Load/load_table is a special reference,
+		 * it's Reference.Object is the table index, so does not need to
+		 * increase the reference count
 		 */
+		if (source_desc->reference.opcode == AML_LOAD_OP) {
+			break;
+		}
+
 		acpi_ut_add_reference(source_desc->reference.object);
 		break;
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 55/73] ACPICA: Update version to 20080123
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (52 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 54/73] ACPICA: Fixes for Unload and DDBHandles Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 56/73] ACPICA: Add va_end statements as appropriate Len Brown
                     ` (17 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Update version to 20080123.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 010703e..c7d5c91 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20071219
+#define ACPI_CA_VERSION                 0x20080123
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 56/73] ACPICA: Add va_end statements as appropriate
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (53 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 55/73] ACPICA: Update version to 20080123 Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 57/73] ACPICA: Added new error messages Len Brown
                     ` (16 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Added missing va_end statements that should correspond with each
va_start statement.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/utilities/utdebug.c |    2 ++
 drivers/acpi/utilities/utmisc.c  |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index 2d6a78f..8014442 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -201,6 +201,7 @@ acpi_ut_debug_print(u32 requested_debug_level,
 
 	va_start(args, format);
 	acpi_os_vprintf(format, args);
+	va_end(args);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_ut_debug_print)
@@ -238,6 +239,7 @@ acpi_ut_debug_print_raw(u32 requested_debug_level,
 
 	va_start(args, format);
 	acpi_os_vprintf(format, args);
+	va_end(args);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_ut_debug_print_raw)
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 2d19f71..2f48fd6 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -1033,6 +1033,7 @@ acpi_ut_error(char *module_name, u32 line_number, char *format, ...)
 	va_start(args, format);
 	acpi_os_vprintf(format, args);
 	acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
+	va_end(args);
 }
 
 void ACPI_INTERNAL_VAR_XFACE
@@ -1061,6 +1062,8 @@ acpi_ut_warning(char *module_name, u32 line_number, char *format, ...)
 	va_start(args, format);
 	acpi_os_vprintf(format, args);
 	acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
+	va_end(args);
+	va_end(args);
 }
 
 void ACPI_INTERNAL_VAR_XFACE
@@ -1077,4 +1080,5 @@ acpi_ut_info(char *module_name, u32 line_number, char *format, ...)
 	va_start(args, format);
 	acpi_os_vprintf(format, args);
 	acpi_os_printf("\n");
+	va_end(args);
 }
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 57/73] ACPICA: Added new error messages
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (54 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 56/73] ACPICA: Add va_end statements as appropriate Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 58/73] ACPICA: Fix for ACPI_HIDWORD macro Len Brown
                     ` (15 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

New messages for the 2 AE_SUPPORT cases.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/utilities/utcopy.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index ba89971..4c4021d 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -215,6 +215,11 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object,
 		/*
 		 * There is no corresponding external object type
 		 */
+		ACPI_ERROR((AE_INFO,
+			    "Unsupported object type, cannot convert to external object: %s",
+			    acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE
+						  (internal_object))));
+
 		return_ACPI_STATUS(AE_SUPPORT);
 	}
 
@@ -467,6 +472,10 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
 	default:
 		/* All other types are not supported */
 
+		ACPI_ERROR((AE_INFO,
+			    "Unsupported object type, cannot convert to internal object: %s",
+			    acpi_ut_get_type_name(external_object->type)));
+
 		return_ACPI_STATUS(AE_SUPPORT);
 	}
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 58/73] ACPICA: Fix for ACPI_HIDWORD macro
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (55 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 57/73] ACPICA: Added new error messages Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 59/73] ACPICA: Disassembler support for new ACPI tables Len Brown
                     ` (14 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a regression introduced in version 20071114. The ACPI_HIDWORD
macro was inadvertently changed to return a 16-bit value instead of
a 32-bit value, truncating the upper Dword of a 64-bit value. This
macro is only used to display debug output, so no incorrect
calculations were made.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acmacros.h |   69 ++++++++++++++++++++++++-----------------------
 1 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index dc6a037..1f0fdbf 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -62,30 +62,6 @@
 #define ACPI_ARRAY_LENGTH(x)            (sizeof(x) / sizeof((x)[0]))
 
 /*
- * Full 64-bit integer must be available on both 32-bit and 64-bit platforms
- */
-#define ACPI_LODWORD(l)                 ((u32)(u64)(l))
-#define ACPI_HIDWORD(l)                 ((u16)((((u64)(l)) >> 32) & 0xFFFFFFFF))
-
-#if 0
-#define ACPI_HIDWORD(l)                 ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi))
-#endif
-
-/*
- * printf() format helpers
- */
-
-/* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */
-
-#define ACPI_FORMAT_UINT64(i)           ACPI_HIDWORD(i),ACPI_LODWORD(i)
-
-#if ACPI_MACHINE_WIDTH == 64
-#define ACPI_FORMAT_NATIVE_UINT(i)      ACPI_FORMAT_UINT64(i)
-#else
-#define ACPI_FORMAT_NATIVE_UINT(i)      0, (i)
-#endif
-
-/*
  * Extract data using a pointer.  Any more than a byte and we
  * get into potential aligment issues -- see the STORE macros below.
  * Use with care.
@@ -122,6 +98,31 @@
 #endif
 
 /*
+ * Full 64-bit integer must be available on both 32-bit and 64-bit platforms
+ */
+struct acpi_integer_overlay {
+	u32 lo_dword;
+	u32 hi_dword;
+};
+
+#define ACPI_LODWORD(integer)           (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->lo_dword)
+#define ACPI_HIDWORD(integer)           (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->hi_dword)
+
+/*
+ * printf() format helpers
+ */
+
+/* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */
+
+#define ACPI_FORMAT_UINT64(i)           ACPI_HIDWORD(i),ACPI_LODWORD(i)
+
+#if ACPI_MACHINE_WIDTH == 64
+#define ACPI_FORMAT_NATIVE_UINT(i)      ACPI_FORMAT_UINT64(i)
+#else
+#define ACPI_FORMAT_NATIVE_UINT(i)      0, (i)
+#endif
+
+/*
  * Macros for moving data around to/from buffers that are possibly unaligned.
  * If the hardware supports the transfer of unaligned data, just do the store.
  * Otherwise, we have to move one byte at a time.
@@ -137,29 +138,29 @@
 
 /* These macros reverse the bytes during the move, converting little-endian to big endian */
 
-	 /* Big Endian      <==        Little Endian */
-	 /*  Hi...Lo                     Lo...Hi     */
+			  /* Big Endian      <==        Little Endian */
+			  /*  Hi...Lo                     Lo...Hi     */
 /* 16-bit source, 16/32/64 destination */
 
 #define ACPI_MOVE_16_TO_16(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[1];\
-			  ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[0];}
+					   ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[0];}
 
 #define ACPI_MOVE_16_TO_32(d,s)         {(*(u32 *)(void *)(d))=0;\
-					  ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\
-					  ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];}
+							   ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\
+							   ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];}
 
 #define ACPI_MOVE_16_TO_64(d,s)         {(*(u64 *)(void *)(d))=0;\
-							   ((u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[1];\
-							   ((u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[0];}
+									 ((u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[1];\
+									 ((u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[0];}
 
 /* 32-bit source, 16/32/64 destination */
 
 #define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)	/* Truncate to 16 */
 
 #define ACPI_MOVE_32_TO_32(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\
-									  ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\
-									  ((  u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\
-									  ((  u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];}
+										 ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\
+										 ((  u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\
+										 ((  u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];}
 
 #define ACPI_MOVE_32_TO_64(d,s)         {(*(u64 *)(void *)(d))=0;\
 										   ((u8 *)(void *)(d))[4] = ((u8 *)(void *)(s))[3];\
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 59/73] ACPICA: Disassembler support for new ACPI tables
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (56 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 58/73] ACPICA: Fix for ACPI_HIDWORD macro Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 60/73] ACPICA: Additional GPE/Notify handling change Len Brown
                     ` (13 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Implemented full disassembler support for the following new ACPI
tables: BERT, EINJ, and ERST. Partial disassembler support for
the complicated HEST table. These tables support the Windows
Hardware Error Architecture (WHEA).

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acdisasm.h |   26 ++++-
 include/acpi/actbl1.h   |  233 ++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 249 insertions(+), 10 deletions(-)

diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 07d5241..73d86eb 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -99,10 +99,13 @@ typedef const struct acpi_dmtable_info {
 #define ACPI_DMT_GAS                    22
 #define ACPI_DMT_ASF                    23
 #define ACPI_DMT_DMAR                   24
-#define ACPI_DMT_MADT                   25
-#define ACPI_DMT_SRAT                   26
-#define ACPI_DMT_EXIT                   27
-#define ACPI_DMT_SIG                    28
+#define ACPI_DMT_HEST                   25
+#define ACPI_DMT_HESTNTFY               26
+#define ACPI_DMT_HESTNTYP               27
+#define ACPI_DMT_MADT                   28
+#define ACPI_DMT_SRAT                   29
+#define ACPI_DMT_EXIT                   30
+#define ACPI_DMT_SIG                    31
 
 typedef
 void (*acpi_dmtable_handler) (struct acpi_table_header * table);
@@ -150,6 +153,7 @@ extern struct acpi_dmtable_info acpi_dm_table_info_asf3[];
 extern struct acpi_dmtable_info acpi_dm_table_info_asf4[];
 extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[];
 extern struct acpi_dmtable_info acpi_dm_table_info_boot[];
+extern struct acpi_dmtable_info acpi_dm_table_info_bert[];
 extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
 extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
 extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
@@ -159,11 +163,17 @@ extern struct acpi_dmtable_info acpi_dm_table_info_dmar_scope[];
 extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[];
 extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[];
 extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
+extern struct acpi_dmtable_info acpi_dm_table_info_einj[];
+extern struct acpi_dmtable_info acpi_dm_table_info_einj0[];
+extern struct acpi_dmtable_info acpi_dm_table_info_erst[];
 extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
 extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
 extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[];
 extern struct acpi_dmtable_info acpi_dm_table_info_gas[];
 extern struct acpi_dmtable_info acpi_dm_table_info_header[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest9[];
+extern struct acpi_dmtable_info acpi_dm_table_info_hest_notify[];
 extern struct acpi_dmtable_info acpi_dm_table_info_hpet[];
 extern struct acpi_dmtable_info acpi_dm_table_info_madt[];
 extern struct acpi_dmtable_info acpi_dm_table_info_madt0[];
@@ -215,9 +225,13 @@ void acpi_dm_dump_cpep(struct acpi_table_header *table);
 
 void acpi_dm_dump_dmar(struct acpi_table_header *table);
 
+void acpi_dm_dump_einj(struct acpi_table_header *table);
+
+void acpi_dm_dump_erst(struct acpi_table_header *table);
+
 void acpi_dm_dump_fadt(struct acpi_table_header *table);
 
-void acpi_dm_dump_srat(struct acpi_table_header *table);
+void acpi_dm_dump_hest(struct acpi_table_header *table);
 
 void acpi_dm_dump_mcfg(struct acpi_table_header *table);
 
@@ -229,6 +243,8 @@ void acpi_dm_dump_rsdt(struct acpi_table_header *table);
 
 void acpi_dm_dump_slit(struct acpi_table_header *table);
 
+void acpi_dm_dump_srat(struct acpi_table_header *table);
+
 void acpi_dm_dump_xsdt(struct acpi_table_header *table);
 
 /*
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 5d39992..604dfb3 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -109,8 +109,8 @@ struct acpi_whea_header {
 	u8 flags;
 	u8 reserved;
 	struct acpi_generic_address register_region;
-	u32 value;		/* Value used with Read/Write register */
-	u32 mask;		/* Bitmask required for this register instruction */
+	u64 value;		/* Value used with Read/Write register */
+	u64 mask;		/* Bitmask required for this register instruction */
 };
 
 /*******************************************************************************
@@ -234,13 +234,14 @@ struct acpi_table_bert {
 	u64 address;		/* Physical addresss of the error region */
 };
 
+/* Boot Error Region */
+
 struct acpi_bert_region {
 	u32 block_status;
 	u32 raw_data_offset;
 	u32 raw_data_length;
 	u32 data_length;
 	u32 error_severity;
-	u8 error_data[1];
 };
 
 /* block_status Flags */
@@ -441,6 +442,15 @@ enum acpi_einj_instructions {
 	ACPI_EINJ_INSTRUCTION_RESERVED = 5	/* 5 and greater are reserved */
 };
 
+/* EINJ Trigger Error Action Table */
+
+struct acpi_einj_trigger {
+	u32 header_size;
+	u32 revision;
+	u32 table_size;
+	u32 entry_count;
+};
+
 /*******************************************************************************
  *
  * ERST - Error Record Serialization Table
@@ -518,7 +528,220 @@ struct acpi_table_hest {
 	u32 error_source_count;
 };
 
-/* TBD: Need Error Source Descriptor layout */
+/* HEST subtable header */
+
+struct acpi_hest_header {
+	u16 type;
+};
+
+/* Values for Type field above for subtables */
+
+enum acpi_hest_types {
+	ACPI_HEST_TYPE_XPF_MACHINE_CHECK = 0,
+	ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK = 1,
+	ACPI_HEST_TYPE_XPF_UNUSED = 2,
+	ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT = 3,
+	ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK = 4,
+	ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR = 5,
+	ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
+	ACPI_HEST_TYPE_AER_ENDPOINT = 7,
+	ACPI_HEST_TYPE_AER_BRIDGE = 8,
+	ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE = 9,
+	ACPI_HEST_TYPE_RESERVED = 10	/* 10 and greater are reserved */
+};
+
+/*
+ * HEST Sub-subtables
+ */
+
+/* XPF Machine Check Error Bank */
+
+struct acpi_hest_xpf_error_bank {
+	u8 bank_number;
+	u8 clear_status_on_init;
+	u8 status_format;
+	u8 config_write_enable;
+	u32 control_register;
+	u64 control_init_data;
+	u32 status_register;
+	u32 address_register;
+	u32 misc_register;
+};
+
+/* Generic Error Status */
+
+struct acpi_hest_generic_status {
+	u32 block_status;
+	u32 raw_data_offset;
+	u32 raw_data_length;
+	u32 data_length;
+	u32 error_severity;
+};
+
+/* Generic Error Data */
+
+struct acpi_hest_generic_data {
+	u8 section_type[16];
+	u32 error_severity;
+	u16 revision;
+	u8 validation_bits;
+	u8 flags;
+	u32 error_data_length;
+	u8 fru_id[16];
+	u8 fru_text[20];
+};
+
+/* Common HEST structure for PCI/AER types below (6,7,8) */
+
+struct acpi_hest_aer_common {
+	u16 source_id;
+	u16 config_write_enable;
+	u8 flags;
+	u8 enabled;
+	u32 records_to_pre_allocate;
+	u32 max_sections_per_record;
+	u32 bus;
+	u16 device;
+	u16 function;
+	u16 device_control;
+	u16 reserved;
+	u32 uncorrectable_error_mask;
+	u32 uncorrectable_error_severity;
+	u32 correctable_error_mask;
+	u32 advanced_error_cababilities;
+};
+
+/* Hardware Error Notification */
+
+struct acpi_hest_notify {
+	u8 type;
+	u8 length;
+	u16 config_write_enable;
+	u32 poll_interval;
+	u32 vector;
+	u32 polling_threshold_value;
+	u32 polling_threshold_window;
+	u32 error_threshold_value;
+	u32 error_threshold_window;
+};
+
+/* Values for Notify Type field above */
+
+enum acpi_hest_notify_types {
+	ACPI_HEST_NOTIFY_POLLED = 0,
+	ACPI_HEST_NOTIFY_EXTERNAL = 1,
+	ACPI_HEST_NOTIFY_LOCAL = 2,
+	ACPI_HEST_NOTIFY_SCI = 3,
+	ACPI_HEST_NOTIFY_NMI = 4,
+	ACPI_HEST_NOTIFY_RESERVED = 5	/* 5 and greater are reserved */
+};
+
+/*
+ * HEST subtables
+ *
+ * From WHEA Design Document, 16 May 2007.
+ * Note: There is no subtable type 2 in this version of the document,
+ * and there are two different subtable type 3s.
+ */
+
+ /* 0: XPF Machine Check Exception */
+
+struct acpi_hest_xpf_machine_check {
+	struct acpi_hest_header header;
+	u16 source_id;
+	u16 config_write_enable;
+	u8 flags;
+	u8 reserved1;
+	u32 records_to_pre_allocate;
+	u32 max_sections_per_record;
+	u64 global_capability_data;
+	u64 global_control_data;
+	u8 num_hardware_banks;
+	u8 reserved2[7];
+};
+
+/* 1: XPF Corrected Machine Check */
+
+struct acpi_table_hest_xpf_corrected {
+	struct acpi_hest_header header;
+	u16 source_id;
+	u16 config_write_enable;
+	u8 flags;
+	u8 enabled;
+	u32 records_to_pre_allocate;
+	u32 max_sections_per_record;
+	struct acpi_hest_notify notify;
+	u8 num_hardware_banks;
+	u8 reserved[3];
+};
+
+/* 3: XPF Non-Maskable Interrupt */
+
+struct acpi_hest_xpf_nmi {
+	struct acpi_hest_header header;
+	u16 source_id;
+	u32 reserved;
+	u32 records_to_pre_allocate;
+	u32 max_sections_per_record;
+	u32 max_raw_data_length;
+};
+
+/* 4: IPF Corrected Machine Check */
+
+struct acpi_hest_ipf_corrected {
+	struct acpi_hest_header header;
+	u8 enabled;
+	u8 reserved;
+};
+
+/* 5: IPF Corrected Platform Error */
+
+struct acpi_hest_ipf_corrected_platform {
+	struct acpi_hest_header header;
+	u8 enabled;
+	u8 reserved;
+};
+
+/* 6: PCI Express Root Port AER */
+
+struct acpi_hest_aer_root {
+	struct acpi_hest_header header;
+	struct acpi_hest_aer_common aer;
+	u32 root_error_command;
+};
+
+/* 7: PCI Express AER (AER Endpoint) */
+
+struct acpi_hest_aer {
+	struct acpi_hest_header header;
+	struct acpi_hest_aer_common aer;
+};
+
+/* 8: PCI Express/PCI-X Bridge AER */
+
+struct acpi_hest_aer_bridge {
+	struct acpi_hest_header header;
+	struct acpi_hest_aer_common aer;
+	u32 secondary_uncorrectable_error_mask;
+	u32 secondary_uncorrectable_error_severity;
+	u32 secondary_advanced_capabilities;
+};
+
+/* 9: Generic Hardware Error Source */
+
+struct acpi_hest_generic {
+	struct acpi_hest_header header;
+	u16 source_id;
+	u16 related_source_id;
+	u8 config_write_enable;
+	u8 enabled;
+	u32 records_to_pre_allocate;
+	u32 max_sections_per_record;
+	u32 max_raw_data_length;
+	struct acpi_generic_address error_status_address;
+	struct acpi_hest_notify notify;
+	u32 error_status_block_length;
+};
 
 /*******************************************************************************
  *
@@ -545,7 +768,7 @@ struct acpi_table_hpet {
 
 /*******************************************************************************
  *
- * IBFT - i_sCSI Boot Firmware Table
+ * IBFT - Boot Firmware Table
  *
  ******************************************************************************/
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 60/73] ACPICA: Additional GPE/Notify handling change
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (57 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 59/73] ACPICA: Disassembler support for new ACPI tables Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 61/73] ACPICA: Fix for resource descriptor optimization issues for _CRS/_SRC Len Brown
                     ` (12 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Implemented another MS compatibility design change for GPE/Notify
handling. GPEs are now cleared/enabled asynchronously to
allow all pending notifies to complete first. It is expected
that the OSL will queue the enable request behind all pending
notify requests (may require changes to the local host OSL in
AcpiOsExecute). Alexey Starikovskiy

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/events/evgpe.c |   40 ++++++++++++++++++++++++++++++----------
 1 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index 0dadd2a..897baed 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -51,6 +51,8 @@ ACPI_MODULE_NAME("evgpe")
 /* Local prototypes */
 static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context);
 
+static void ACPI_SYSTEM_XFACE acpi_ev_asynch_enable_gpe(void *context);
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ev_set_gpe_type
@@ -505,13 +507,22 @@ static void acpi_ev_asynch_enable_gpe(void *context);
 
 static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
 {
-	struct acpi_gpe_event_info *gpe_event_info = (void *)context;
+	struct acpi_gpe_event_info *gpe_event_info = context;
 	acpi_status status;
-	struct acpi_gpe_event_info local_gpe_event_info;
+	struct acpi_gpe_event_info *local_gpe_event_info;
 	struct acpi_evaluate_info *info;
 
 	ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method);
 
+	/* Allocate a local GPE block */
+
+	local_gpe_event_info =
+	    ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_event_info));
+	if (!local_gpe_event_info) {
+		ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY, "while handling a GPE"));
+		return_VOID;
+	}
+
 	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
 	if (ACPI_FAILURE(status)) {
 		return_VOID;
@@ -532,7 +543,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
 	 * Take a snapshot of the GPE info for this level - we copy the
 	 * info to prevent a race condition with remove_handler/remove_block.
 	 */
-	ACPI_MEMCPY(&local_gpe_event_info, gpe_event_info,
+	ACPI_MEMCPY(local_gpe_event_info, gpe_event_info,
 		    sizeof(struct acpi_gpe_event_info));
 
 	status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
@@ -544,7 +555,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
 	 * Must check for control method type dispatch one more
 	 * time to avoid race with ev_gpe_install_handler
 	 */
-	if ((local_gpe_event_info.flags & ACPI_GPE_DISPATCH_MASK) ==
+	if ((local_gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
 	    ACPI_GPE_DISPATCH_METHOD) {
 
 		/* Allocate the evaluation information block */
@@ -558,10 +569,10 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
 			 * control method that corresponds to this GPE
 			 */
 			info->prefix_node =
-			    local_gpe_event_info.dispatch.method_node;
+			    local_gpe_event_info->dispatch.method_node;
 			info->parameters =
 			    ACPI_CAST_PTR(union acpi_operand_object *,
-					  gpe_event_info);
+					  local_gpe_event_info);
 			info->parameter_type = ACPI_PARAM_GPE;
 			info->flags = ACPI_IGNORE_RETURN_VALUE;
 
@@ -573,13 +584,18 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
 			ACPI_EXCEPTION((AE_INFO, status,
 					"while evaluating GPE method [%4.4s]",
 					acpi_ut_get_node_name
-					(local_gpe_event_info.dispatch.
+					(local_gpe_event_info->dispatch.
 					 method_node)));
 		}
 	}
 	/* Defer enabling of GPE until all notify handlers are done */
-	acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_asynch_enable_gpe,
+	status = acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_asynch_enable_gpe,
 				gpe_event_info);
+
+	if (ACPI_FAILURE(status)) {
+		ACPI_FREE(local_gpe_event_info);
+	}
+
 	return_VOID;
 }
 
@@ -595,12 +611,15 @@ static void acpi_ev_asynch_enable_gpe(void *context)
 		 */
 		status = acpi_hw_clear_gpe(gpe_event_info);
 		if (ACPI_FAILURE(status)) {
-			return_VOID;
+			goto exit;
 		}
 	}
 
 	/* Enable this GPE */
 	(void)acpi_hw_write_gpe_enable_reg(gpe_event_info);
+  exit:
+	ACPI_FREE(gpe_event_info);
+	return;
 	return_VOID;
 }
 
@@ -621,7 +640,8 @@ static void acpi_ev_asynch_enable_gpe(void *context)
  ******************************************************************************/
 
 u32
-acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
+acpi_ev_gpe_dispatch(struct acpi_gpe_event_info * gpe_event_info,
+		     u32 gpe_number)
 {
 	acpi_status status;
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 61/73] ACPICA: Fix for resource descriptor optimization issues for _CRS/_SRC
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (58 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 60/73] ACPICA: Additional GPE/Notify handling change Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 62/73] ACPICA: Update behavior of CopyObject to match ACPI spec Len Brown
                     ` (11 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem where resource descriptor size optimization
could cause a problem when a _CRS resource template is passed
to a _SRS method. The _SRS resource template must use the same
descriptors (with the same size) as returned from _CRS. This
change affects the following resource descriptors: IRQ/IRQNoFlags
and StartDependendentFn/StartDependentFnNoPri. (BZ 9487)

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/resources/rscalc.c |    7 ++++++
 drivers/acpi/resources/rsdump.c |    8 +++++-
 drivers/acpi/resources/rsio.c   |   39 +++++++++++++++++++++++++++++++++-
 drivers/acpi/resources/rsirq.c  |   43 +++++++++++++++++++++++++++++++++++---
 drivers/acpi/resources/rsmisc.c |   11 ++++++++++
 include/acpi/acresrc.h          |    1 +
 include/acpi/actypes.h          |    2 +
 7 files changed, 103 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index dcc51e9..db0a835 100644
--- a/drivers/acpi/resources/rscalc.c
+++ b/drivers/acpi/resources/rscalc.c
@@ -211,6 +211,13 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
 		 * variable-length fields
 		 */
 		switch (resource->type) {
+		case ACPI_RESOURCE_TYPE_IRQ:
+
+			if (resource->data.irq.descriptor_length == 2) {
+				total_size--;
+			}
+			break;
+
 		case ACPI_RESOURCE_TYPE_VENDOR:
 			/*
 			 * Vendor Defined Resource:
diff --git a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c
index 46da116..ed6447d 100644
--- a/drivers/acpi/resources/rsdump.c
+++ b/drivers/acpi/resources/rsdump.c
@@ -87,8 +87,10 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table);
  *
  ******************************************************************************/
 
-struct acpi_rsdump_info acpi_rs_dump_irq[6] = {
+struct acpi_rsdump_info acpi_rs_dump_irq[7] = {
 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_irq), "IRQ", NULL},
+	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.descriptor_length),
+	 "Descriptor Length", NULL},
 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.triggering), "Triggering",
 	 acpi_gbl_he_decode},
 	{ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.polarity), "Polarity",
@@ -115,9 +117,11 @@ struct acpi_rsdump_info acpi_rs_dump_dma[6] = {
 	 NULL}
 };
 
-struct acpi_rsdump_info acpi_rs_dump_start_dpf[3] = {
+struct acpi_rsdump_info acpi_rs_dump_start_dpf[4] = {
 	{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_start_dpf),
 	 "Start-Dependent-Functions", NULL},
+	{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(start_dpf.descriptor_length),
+	 "Descriptor Length", NULL},
 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(start_dpf.compatibility_priority),
 	 "Compatibility Priority", acpi_gbl_config_decode},
 	{ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(start_dpf.performance_robustness),
diff --git a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c
index b297bc3..50f3acd 100644
--- a/drivers/acpi/resources/rsio.c
+++ b/drivers/acpi/resources/rsio.c
@@ -185,7 +185,7 @@ struct acpi_rsconvert_info acpi_rs_convert_end_tag[2] = {
  *
  ******************************************************************************/
 
-struct acpi_rsconvert_info acpi_rs_get_start_dpf[5] = {
+struct acpi_rsconvert_info acpi_rs_get_start_dpf[6] = {
 	{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_START_DEPENDENT,
 	 ACPI_RS_SIZE(struct acpi_resource_start_dependent),
 	 ACPI_RSC_TABLE_SIZE(acpi_rs_get_start_dpf)},
@@ -196,6 +196,12 @@ struct acpi_rsconvert_info acpi_rs_get_start_dpf[5] = {
 	 ACPI_ACCEPTABLE_CONFIGURATION,
 	 2},
 
+	/* Get the descriptor length (0 or 1 for Start Dpf descriptor) */
+
+	{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.start_dpf.descriptor_length),
+	 AML_OFFSET(start_dpf.descriptor_type),
+	 0},
+
 	/* All done if there is no flag byte present in the descriptor */
 
 	{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 1},
@@ -219,7 +225,9 @@ struct acpi_rsconvert_info acpi_rs_get_start_dpf[5] = {
  *
  ******************************************************************************/
 
-struct acpi_rsconvert_info acpi_rs_set_start_dpf[6] = {
+struct acpi_rsconvert_info acpi_rs_set_start_dpf[10] = {
+	/* Start with a default descriptor of length 1 */
+
 	{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_START_DEPENDENT,
 	 sizeof(struct aml_resource_start_dependent),
 	 ACPI_RSC_TABLE_SIZE(acpi_rs_set_start_dpf)},
@@ -236,6 +244,33 @@ struct acpi_rsconvert_info acpi_rs_set_start_dpf[6] = {
 	 AML_OFFSET(start_dpf.flags),
 	 2},
 	/*
+	 * All done if the output descriptor length is required to be 1
+	 * (i.e., optimization to 0 bytes cannot be attempted)
+	 */
+	{ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
+	 ACPI_RS_OFFSET(data.start_dpf.descriptor_length),
+	 1},
+
+	/* Set length to 0 bytes (no flags byte) */
+
+	{ACPI_RSC_LENGTH, 0, 0,
+	 sizeof(struct aml_resource_start_dependent_noprio)},
+
+	/*
+	 * All done if the output descriptor length is required to be 0.
+	 *
+	 * TBD: Perhaps we should check for error if input flags are not
+	 * compatible with a 0-byte descriptor.
+	 */
+	{ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
+	 ACPI_RS_OFFSET(data.start_dpf.descriptor_length),
+	 0},
+
+	/* Reset length to 1 byte (descriptor with flags byte) */
+
+	{ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)},
+
+	/*
 	 * All done if flags byte is necessary -- if either priority value
 	 * is not ACPI_ACCEPTABLE_CONFIGURATION
 	 */
diff --git a/drivers/acpi/resources/rsirq.c b/drivers/acpi/resources/rsirq.c
index 5657f7b..382a77b 100644
--- a/drivers/acpi/resources/rsirq.c
+++ b/drivers/acpi/resources/rsirq.c
@@ -52,7 +52,7 @@ ACPI_MODULE_NAME("rsirq")
  * acpi_rs_get_irq
  *
  ******************************************************************************/
-struct acpi_rsconvert_info acpi_rs_get_irq[7] = {
+struct acpi_rsconvert_info acpi_rs_get_irq[8] = {
 	{ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ,
 	 ACPI_RS_SIZE(struct acpi_resource_irq),
 	 ACPI_RSC_TABLE_SIZE(acpi_rs_get_irq)},
@@ -69,6 +69,12 @@ struct acpi_rsconvert_info acpi_rs_get_irq[7] = {
 	 ACPI_EDGE_SENSITIVE,
 	 1},
 
+	/* Get the descriptor length (2 or 3 for IRQ descriptor) */
+
+	{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.descriptor_length),
+	 AML_OFFSET(irq.descriptor_type),
+	 0},
+
 	/* All done if no flag byte present in descriptor */
 
 	{ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3},
@@ -94,7 +100,9 @@ struct acpi_rsconvert_info acpi_rs_get_irq[7] = {
  *
  ******************************************************************************/
 
-struct acpi_rsconvert_info acpi_rs_set_irq[9] = {
+struct acpi_rsconvert_info acpi_rs_set_irq[13] = {
+	/* Start with a default descriptor of length 3 */
+
 	{ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ,
 	 sizeof(struct aml_resource_irq),
 	 ACPI_RSC_TABLE_SIZE(acpi_rs_set_irq)},
@@ -105,7 +113,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[9] = {
 	 AML_OFFSET(irq.irq_mask),
 	 ACPI_RS_OFFSET(data.irq.interrupt_count)},
 
-	/* Set the flags byte by default */
+	/* Set the flags byte */
 
 	{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
 	 AML_OFFSET(irq.flags),
@@ -118,6 +126,33 @@ struct acpi_rsconvert_info acpi_rs_set_irq[9] = {
 	{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
 	 AML_OFFSET(irq.flags),
 	 4},
+
+	/*
+	 * All done if the output descriptor length is required to be 3
+	 * (i.e., optimization to 2 bytes cannot be attempted)
+	 */
+	{ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
+	 ACPI_RS_OFFSET(data.irq.descriptor_length),
+	 3},
+
+	/* Set length to 2 bytes (no flags byte) */
+
+	{ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)},
+
+	/*
+	 * All done if the output descriptor length is required to be 2.
+	 *
+	 * TBD: Perhaps we should check for error if input flags are not
+	 * compatible with a 2-byte descriptor.
+	 */
+	{ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
+	 ACPI_RS_OFFSET(data.irq.descriptor_length),
+	 2},
+
+	/* Reset length to 3 bytes (descriptor with flags byte) */
+
+	{ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)},
+
 	/*
 	 * Check if the flags byte is necessary. Not needed if the flags are:
 	 * ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH, ACPI_EXCLUSIVE
@@ -134,7 +169,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[9] = {
 	 ACPI_RS_OFFSET(data.irq.sharable),
 	 ACPI_EXCLUSIVE},
 
-	/* irq_no_flags() descriptor can be used */
+	/* We can optimize to a 2-byte irq_no_flags() descriptor */
 
 	{ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)}
 };
diff --git a/drivers/acpi/resources/rsmisc.c b/drivers/acpi/resources/rsmisc.c
index c7081af..3e69eff 100644
--- a/drivers/acpi/resources/rsmisc.c
+++ b/drivers/acpi/resources/rsmisc.c
@@ -497,6 +497,17 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			}
 			break;
 
+		case ACPI_RSC_EXIT_EQ:
+			/*
+			 * Control - Exit conversion if equal
+			 */
+			if (*ACPI_ADD_PTR(u8, resource,
+					  COMPARE_TARGET(info)) ==
+			    COMPARE_VALUE(info)) {
+				goto exit;
+			}
+			break;
+
 		default:
 
 			ACPI_ERROR((AE_INFO, "Invalid conversion opcode"));
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index 9486ab2..33e9f38 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -94,6 +94,7 @@ typedef const struct acpi_rsconvert_info {
 #define ACPI_RSC_BITMASK16              18
 #define ACPI_RSC_EXIT_NE                19
 #define ACPI_RSC_EXIT_LE                20
+#define ACPI_RSC_EXIT_EQ                21
 
 /* Resource Conversion sub-opcodes */
 
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index bb44700..599657e 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -986,6 +986,7 @@ struct acpi_vendor_uuid {
  *  Structures used to describe device resources
  */
 struct acpi_resource_irq {
+	u8 descriptor_length;
 	u8 triggering;
 	u8 polarity;
 	u8 sharable;
@@ -1002,6 +1003,7 @@ struct acpi_resource_dma {
 };
 
 struct acpi_resource_start_dependent {
+	u8 descriptor_length;
 	u8 compatibility_priority;
 	u8 performance_robustness;
 };
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 62/73] ACPICA: Update behavior of CopyObject to match ACPI spec
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (59 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 61/73] ACPICA: Fix for resource descriptor optimization issues for _CRS/_SRC Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 63/73] ACPICA: Fix for possible error when packages/buffers are passed to methods externally Len Brown
                     ` (10 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem where a CopyObject to RegionField, BankField, and
IndexField objects did not perform an implicit conversion as it
should. These types must retain their initial type permanently as
per the ACPI specification. However, a CopyObject to all other
object types should not perform an implicit conversion, as per
the ACPI specification. (Lin Ming, Bob Moore) BZ 388

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exstore.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index 725614e..36c0fcc 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -603,10 +603,17 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
 
 	/* If no implicit conversion, drop into the default case below */
 
-	if ((!implicit_conversion) || (walk_state->opcode == AML_COPY_OP)) {
-
-		/* Force execution of default (no implicit conversion) */
-
+	if ((!implicit_conversion) ||
+	    ((walk_state->opcode == AML_COPY_OP) &&
+	     (target_type != ACPI_TYPE_LOCAL_REGION_FIELD) &&
+	     (target_type != ACPI_TYPE_LOCAL_BANK_FIELD) &&
+	     (target_type != ACPI_TYPE_LOCAL_INDEX_FIELD))) {
+		/*
+		 * Force execution of default (no implicit conversion). Note:
+		 * copy_object does not perform an implicit conversion, as per the ACPI
+		 * spec -- except in case of region/bank/index fields -- because these
+		 * objects must retain their original type permanently.
+		 */
 		target_type = ACPI_TYPE_ANY;
 	}
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 63/73] ACPICA: Fix for possible error when packages/buffers are passed to methods externally
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (60 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 62/73] ACPICA: Update behavior of CopyObject to match ACPI spec Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 64/73] ACPICA: Update ACPICA version to 20080213 Len Brown
                     ` (9 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem where buffer and package objects passed as
arguments to a control method via the external AcpiEvaluateObject
interface could cause an AE_AML_INTERNAL exception depending on the
order and type of operators executed by the target control method.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/utilities/utcopy.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 4c4021d..4e9a62b 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -511,6 +511,10 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
 			    external_object->buffer.length);
 
 		internal_object->buffer.length = external_object->buffer.length;
+
+		/* Mark buffer data valid */
+
+		internal_object->buffer.flags |= AOPOBJ_DATA_VALID;
 		break;
 
 	case ACPI_TYPE_INTEGER:
@@ -586,6 +590,10 @@ acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
 		}
 	}
 
+	/* Mark package data valid */
+
+	package_object->package.flags |= AOPOBJ_DATA_VALID;
+
 	*internal_object = package_object;
 	return_ACPI_STATUS(status);
 }
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 64/73] ACPICA: Update ACPICA version to 20080213
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (61 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 63/73] ACPICA: Fix for possible error when packages/buffers are passed to methods externally Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages Len Brown
                     ` (8 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Update ACPICA version to 20080213.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index c7d5c91..2c85fd3 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20080123
+#define ACPI_CA_VERSION                 0x20080213
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (62 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 64/73] ACPICA: Update ACPICA version to 20080213 Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-15  7:09     ` Len Brown
  2008-04-12  4:25   ` [PATCH 66/73] ACPICA: Fix to handle NULL package elements correctly Len Brown
                     ` (7 subsequent siblings)
  71 siblings, 1 reply; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem where an extraneous debug message was produced for
package objects (when debugging enabled). The message "Package
List length larger than NumElements count" is now produced in
the correct case, and is also an error message rather than a
debug message. Added a debug message for the opposite case, where
NumElements is larger than the Package List, and the package has
been padded out with NULL elements.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsobject.c |   33 ++++++++++++++++++++++++++++++---
 1 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
index 58d4d91..5184278 100644
--- a/drivers/acpi/dispatcher/dsobject.c
+++ b/drivers/acpi/dispatcher/dsobject.c
@@ -476,10 +476,37 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 		arg = arg->common.next;
 	}
 
-	if (!arg) {
+	/* Check for match between num_elements and actual length of package_list */
+
+	if (arg) {
+		/*
+		 * num_elements was exhausted, but there are remaining elements in the
+		 * package_list.
+		 *
+		 * Note: technically, this is an error, from ACPI spec: "It is an error
+		 * for NumElements to be less than the number of elements in the
+		 * PackageList". However, for now, we just print an error message and
+		 * no exception is returned.
+		 */
+		while (arg) {
+
+			/* Find out how many elements there really are */
+
+			i++;
+			arg = arg->common.next;
+		}
+
+		ACPI_ERROR((AE_INFO,
+			    "Package List length (%X) larger than NumElements count (%X), truncated\n",
+			    i, element_count));
+	} else if (i < element_count) {
+		/*
+		 * Arg list (elements) was exhausted, but we did not reach num_elements count.
+		 * Note: this is not an error, the package is padded out with NULLs.
+		 */
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "Package List length larger than NumElements count (%X), truncated\n",
-				  element_count));
+				  "Package List length (%X) smaller than NumElements count (%X), padded with null elements\n",
+				  i, element_count));
 	}
 
 	obj_desc->package.flags |= AOPOBJ_DATA_VALID;
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 66/73] ACPICA: Fix to handle NULL package elements correctly
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (63 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 67/73] ACPICA: Fixes for external Reference Objects Len Brown
                     ` (6 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed problem where NULL package elements were not returned to
the AcpiEvaluateObject interface correctly. Instead of returning a
NULL ACPI_OBJECT package element, the element was simply ignored,
potentially causing a buffer overflow and/or confusing the caller
who expected a fixed number of elements. BZ 10132 (Lin Ming,
Bob Moore)

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/utilities/utobject.c |    5 ++---
 include/acpi/actypes.h            |   29 +++++++++++++++++------------
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 1eccd3d..cdb8ff5 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -470,9 +470,8 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
 	case ACPI_TYPE_PROCESSOR:
 	case ACPI_TYPE_POWER:
 
-		/*
-		 * No extra data for these types
-		 */
+		/* No extra data for these types */
+
 		break;
 
 	case ACPI_TYPE_LOCAL_REFERENCE:
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 599657e..75ec153 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -639,46 +639,51 @@ typedef u8 acpi_adr_space_type;
 /*
  * External ACPI object definition
  */
+
+/*
+ * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package element
+ * or an unresolved named reference.
+ */
 union acpi_object {
 	acpi_object_type type;	/* See definition of acpi_ns_type for values */
 	struct {
-		acpi_object_type type;
+		acpi_object_type type;	/* ACPI_TYPE_INTEGER */
 		acpi_integer value;	/* The actual number */
 	} integer;
 
 	struct {
-		acpi_object_type type;
+		acpi_object_type type;	/* ACPI_TYPE_STRING */
 		u32 length;	/* # of bytes in string, excluding trailing null */
 		char *pointer;	/* points to the string value */
 	} string;
 
 	struct {
-		acpi_object_type type;
+		acpi_object_type type;	/* ACPI_TYPE_BUFFER */
 		u32 length;	/* # of bytes in buffer */
 		u8 *pointer;	/* points to the buffer */
 	} buffer;
 
 	struct {
-		acpi_object_type type;
-		u32 fill1;
-		acpi_handle handle;	/* object reference */
-	} reference;
-
-	struct {
-		acpi_object_type type;
+		acpi_object_type type;	/* ACPI_TYPE_PACKAGE */
 		u32 count;	/* # of elements in package */
 		union acpi_object *elements;	/* Pointer to an array of ACPI_OBJECTs */
 	} package;
 
 	struct {
-		acpi_object_type type;
+		acpi_object_type type;	/* ACPI_TYPE_LOCAL_REFERENCE */
+		acpi_object_type actual_type;	/* Type associated with the Handle */
+		acpi_handle handle;	/* object reference */
+	} reference;
+
+	struct {
+		acpi_object_type type;	/* ACPI_TYPE_PROCESSOR */
 		u32 proc_id;
 		acpi_io_address pblk_address;
 		u32 pblk_length;
 	} processor;
 
 	struct {
-		acpi_object_type type;
+		acpi_object_type type;	/* ACPI_TYPE_POWER */
 		u32 system_level;
 		u32 resource_order;
 	} power_resource;
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 67/73] ACPICA: Fixes for external Reference Objects
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (64 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 66/73] ACPICA: Fix to handle NULL package elements correctly Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-22 23:15     ` Len Brown
  2008-04-12  4:25   ` [PATCH 68/73] ACPICA: Updates for Debug object output Len Brown
                     ` (5 subsequent siblings)
  71 siblings, 1 reply; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

All Reference Objects returned via the AcpiEvaluteObject interface
are now marked as type "REFERENCE" instead of "ANY". The type ANY
is now reservered for NULL objects - either NULL package elements
or unresolved named references.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/utilities/utcopy.c |   32 ++++++++++++++++++++++++--------
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 4e9a62b..2a57c2c 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -43,6 +43,8 @@
 
 #include <acpi/acpi.h>
 #include <acpi/amlcode.h>
+#include <acpi/acnamesp.h>
+
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utcopy")
@@ -172,22 +174,21 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object,
 
 	case ACPI_TYPE_LOCAL_REFERENCE:
 
-		/*
-		 * This is an object reference.  Attempt to dereference it.
-		 */
+		/* This is an object reference. */
+
 		switch (internal_object->reference.opcode) {
 		case AML_INT_NAMEPATH_OP:
 
 			/* For namepath, return the object handle ("reference") */
 
 		default:
-			/*
-			 * Use the object type of "Any" to indicate a reference
-			 * to object containing a handle to an ACPI named object.
-			 */
-			external_object->type = ACPI_TYPE_ANY;
+
+			/* We are referring to the namespace node */
+
 			external_object->reference.handle =
 			    internal_object->reference.node;
+			external_object->reference.actual_type =
+			    acpi_ns_get_type(internal_object->reference.node);
 			break;
 		}
 		break;
@@ -460,6 +461,7 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
 	case ACPI_TYPE_STRING:
 	case ACPI_TYPE_BUFFER:
 	case ACPI_TYPE_INTEGER:
+	case ACPI_TYPE_LOCAL_REFERENCE:
 
 		internal_object = acpi_ut_create_internal_object((u8)
 								 external_object->
@@ -469,6 +471,11 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
 		}
 		break;
 
+	case ACPI_TYPE_ANY:	/* This is the case for a NULL object */
+
+		*ret_internal_object = NULL;
+		return_ACPI_STATUS(AE_OK);
+
 	default:
 		/* All other types are not supported */
 
@@ -522,6 +529,15 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
 		internal_object->integer.value = external_object->integer.value;
 		break;
 
+	case ACPI_TYPE_LOCAL_REFERENCE:
+
+		/* TBD: should validate incoming handle */
+
+		internal_object->reference.opcode = AML_INT_NAMEPATH_OP;
+		internal_object->reference.node =
+		    external_object->reference.handle;
+		break;
+
 	default:
 		/* Other types can't get here */
 		break;
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 68/73] ACPICA: Updates for Debug object output
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (65 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 67/73] ACPICA: Fixes for external Reference Objects Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 69/73] ACPICA: Fixes for size of StartDependent resource descriptor Len Brown
                     ` (4 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Implemented several improvements for the output of the ASL "Debug"
object to clarify and keep all data for a given object on one
output line.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/executer/exstore.c |   76 ++++++++++++++++++++++++++------------
 1 files changed, 52 insertions(+), 24 deletions(-)

diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index 36c0fcc..dbc5e18 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -84,8 +84,12 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 
 	ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc);
 
-	ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %*s",
-			      level, " "));
+	/* Print line header as long as we are not in the middle of an object display */
+
+	if (!((level > 0) && index == 0)) {
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %*s",
+				      level, " "));
+	}
 
 	/* Display index for package output only */
 
@@ -95,12 +99,12 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 	}
 
 	if (!source_desc) {
-		ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "<Null Object>\n"));
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[Null Object]\n"));
 		return_VOID;
 	}
 
 	if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) {
-		ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%s: ",
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%s ",
 				      acpi_ut_get_object_type_name
 				      (source_desc)));
 
@@ -162,7 +166,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 	case ACPI_TYPE_PACKAGE:
 
 		ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
-				      "[0x%.2X Elements]\n",
+				      "[Contains 0x%.2X Elements]\n",
 				      source_desc->package.count));
 
 		/* Output the entire contents of the package */
@@ -194,8 +198,47 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 			break;
 		}
 
-		ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "\n"));
-		if (source_desc->reference.object) {
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "  "));
+
+		/* Check for valid node first, then valid object */
+
+		if (source_desc->reference.node) {
+			if (ACPI_GET_DESCRIPTOR_TYPE
+			    (source_desc->reference.node) !=
+			    ACPI_DESC_TYPE_NAMED) {
+				ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
+						      " %p - Not a valid namespace node\n",
+						      source_desc->reference.
+						      node));
+			} else {
+				ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
+						      "Node %p [%4.4s] ",
+						      source_desc->reference.
+						      node,
+						      (source_desc->reference.
+						       node)->name.ascii));
+
+				switch ((source_desc->reference.node)->type) {
+
+					/* These types have no attached object */
+
+				case ACPI_TYPE_DEVICE:
+					acpi_os_printf("Device\n");
+					break;
+
+				case ACPI_TYPE_THERMAL:
+					acpi_os_printf("Thermal Zone\n");
+					break;
+
+				default:
+					acpi_ex_do_debug_object((source_desc->
+								 reference.
+								 node)->object,
+								level + 4, 0);
+					break;
+				}
+			}
+		} else if (source_desc->reference.object) {
 			if (ACPI_GET_DESCRIPTOR_TYPE
 			    (source_desc->reference.object) ==
 			    ACPI_DESC_TYPE_NAMED) {
@@ -208,28 +251,13 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 				acpi_ex_do_debug_object(source_desc->reference.
 							object, level + 4, 0);
 			}
-		} else if (source_desc->reference.node) {
-			if (ACPI_GET_DESCRIPTOR_TYPE
-			    (source_desc->reference.node) !=
-			    ACPI_DESC_TYPE_NAMED) {
-				ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
-						      " %p - Not a valid namespace node\n",
-						      source_desc->reference.
-						      node));
-			} else {
-				acpi_ex_do_debug_object((source_desc->reference.
-							 node)->object,
-							level + 4, 0);
-			}
 		}
 		break;
 
 	default:
 
-		ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%p %s\n",
-				      source_desc,
-				      acpi_ut_get_object_type_name
-				      (source_desc)));
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "%p\n",
+				      source_desc));
 		break;
 	}
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 69/73] ACPICA: Fixes for size of StartDependent resource descriptor
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (66 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 68/73] ACPICA: Updates for Debug object output Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs Len Brown
                     ` (3 subsequent siblings)
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a couple of size calculation issues with the variable-length
Start Dependent resource descriptor.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/resources/rscalc.c |   11 +++++++++++
 drivers/acpi/resources/rsio.c   |    2 +-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index db0a835..d801823 100644
--- a/drivers/acpi/resources/rscalc.c
+++ b/drivers/acpi/resources/rscalc.c
@@ -213,11 +213,22 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
 		switch (resource->type) {
 		case ACPI_RESOURCE_TYPE_IRQ:
 
+			/* Length can be 3 or 2 */
+
 			if (resource->data.irq.descriptor_length == 2) {
 				total_size--;
 			}
 			break;
 
+		case ACPI_RESOURCE_TYPE_START_DEPENDENT:
+
+			/* Length can be 1 or 0 */
+
+			if (resource->data.irq.descriptor_length == 0) {
+				total_size--;
+			}
+			break;
+
 		case ACPI_RESOURCE_TYPE_VENDOR:
 			/*
 			 * Vendor Defined Resource:
diff --git a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c
index 50f3acd..610d7c2 100644
--- a/drivers/acpi/resources/rsio.c
+++ b/drivers/acpi/resources/rsio.c
@@ -268,7 +268,7 @@ struct acpi_rsconvert_info acpi_rs_set_start_dpf[10] = {
 
 	/* Reset length to 1 byte (descriptor with flags byte) */
 
-	{ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)},
+	{ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_start_dependent)},
 
 	/*
 	 * All done if flags byte is necessary -- if either priority value
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (67 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 69/73] ACPICA: Fixes for size of StartDependent resource descriptor Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-23  2:57     ` Len Brown
  2008-04-12  4:25   ` [PATCH 71/73] ACPICA: Update for new Notify values Len Brown
                     ` (2 subsequent siblings)
  71 siblings, 1 reply; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Implemented another change to eliminate/suppress spurious or
stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
that are neither enabled nor disabled -- meaning that the GPE is
unknown to the system. This will prevent future interrupts from
that GPE. (Zhang Rui) BZ 6217

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/events/evgpe.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index 897baed..6940f5d 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
 
 	ACPI_FUNCTION_TRACE(ev_disable_gpe);
 
-	if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
+	/*
+	 * Ignore this if the GPE is valid and not enabled.
+	 *
+	 * Flags is only zero if GPE is neither enabled or disabled -- it may
+	 * be a spurious or stray GPE -- disable it in the default case below.
+	 */
+	if (gpe_event_info->flags &&
+	    (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
 		return_ACPI_STATUS(AE_OK);
 	}
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 71/73] ACPICA: Update for new Notify values
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (68 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 72/73] ACPICA: Update version to 20080321 Len Brown
  2008-04-12  4:25   ` [PATCH 73/73] ACPICA: Fix for some local named nodes not marked temporary and to disallow duplicates Len Brown
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Implemented several changes for Notify handling: Added support
for new Notify values (ACPI 2.0+) and improved the Notify debug
output. Notify on PowerResource objects is no longer allowed,
as per the ACPI specification. (Bob Moore, Zhang Rui)

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/events/evmisc.c      |   59 ++++++++++++++----------------------
 drivers/acpi/utilities/utglobal.c |   42 ++++++++++++++++++++++++++
 include/acpi/actypes.h            |   24 +++++++++-----
 include/acpi/acutils.h            |    2 +
 4 files changed, 82 insertions(+), 45 deletions(-)

diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 4e7a13a..16cf270 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -49,22 +49,7 @@
 #define _COMPONENT          ACPI_EVENTS
 ACPI_MODULE_NAME("evmisc")
 
-/* Names for Notify() values, used for debug output */
-#ifdef ACPI_DEBUG_OUTPUT
-static const char *acpi_notify_value_names[] = {
-	"Bus Check",
-	"Device Check",
-	"Device Wake",
-	"Eject Request",
-	"Device Check Light",
-	"Frequency Mismatch",
-	"Bus Mode Mismatch",
-	"Power Fault"
-};
-#endif
-
 /* Pointer to FACS needed for the Global Lock */
-
 static struct acpi_table_facs *facs = NULL;
 
 /* Local prototypes */
@@ -94,7 +79,6 @@ u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node)
 	switch (node->type) {
 	case ACPI_TYPE_DEVICE:
 	case ACPI_TYPE_PROCESSOR:
-	case ACPI_TYPE_POWER:
 	case ACPI_TYPE_THERMAL:
 		/*
 		 * These are the ONLY objects that can receive ACPI notifications
@@ -139,17 +123,9 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
 	 *   initiate soft-off or sleep operation?
 	 */
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-			  "Dispatching Notify(%X) on node %p\n", notify_value,
-			  node));
-
-	if (notify_value <= 7) {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Notify value: %s\n",
-				  acpi_notify_value_names[notify_value]));
-	} else {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "Notify value: 0x%2.2X **Device Specific**\n",
-				  notify_value));
-	}
+			  "Dispatching Notify on [%4.4s] Node %p Value 0x%2.2X (%s)\n",
+			  acpi_ut_get_node_name(node), node, notify_value,
+			  acpi_ut_get_notify_name(notify_value)));
 
 	/* Get the notify object attached to the NS Node */
 
@@ -159,10 +135,12 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
 		/* We have the notify object, Get the right handler */
 
 		switch (node->type) {
+
+			/* Notify allowed only on these types */
+
 		case ACPI_TYPE_DEVICE:
 		case ACPI_TYPE_THERMAL:
 		case ACPI_TYPE_PROCESSOR:
-		case ACPI_TYPE_POWER:
 
 			if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
 				handler_obj =
@@ -179,8 +157,13 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
 		}
 	}
 
-	/* If there is any handler to run, schedule the dispatcher */
-
+	/*
+	 * If there is any handler to run, schedule the dispatcher.
+	 * Check for:
+	 * 1) Global system notify handler
+	 * 2) Global device notify handler
+	 * 3) Per-device notify handler
+	 */
 	if ((acpi_gbl_system_notify.handler
 	     && (notify_value <= ACPI_MAX_SYS_NOTIFY))
 	    || (acpi_gbl_device_notify.handler
@@ -190,6 +173,13 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
 			return (AE_NO_MEMORY);
 		}
 
+		if (!handler_obj) {
+			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+					  "Executing system notify handler for Notify (%4.4s, %X) node %p\n",
+					  acpi_ut_get_node_name(node),
+					  notify_value, node));
+		}
+
 		notify_info->common.descriptor_type =
 		    ACPI_DESC_TYPE_STATE_NOTIFY;
 		notify_info->notify.node = node;
@@ -202,15 +192,12 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
 		if (ACPI_FAILURE(status)) {
 			acpi_ut_delete_generic_state(notify_info);
 		}
-	}
-
-	if (!handler_obj) {
+	} else {
 		/*
-		 * There is no per-device notify handler for this device.
-		 * This may or may not be a problem.
+		 * There is no notify handler (per-device or system) for this device.
 		 */
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "No notify handler for Notify(%4.4s, %X) node %p\n",
+				  "No notify handler for Notify (%4.4s, %X) node %p\n",
 				  acpi_ut_get_node_name(node), notify_value,
 				  node));
 	}
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index d2097de..d0226fe 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -602,6 +602,48 @@ char *acpi_ut_get_mutex_name(u32 mutex_id)
 
 	return (acpi_gbl_mutex_names[mutex_id]);
 }
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ut_get_notify_name
+ *
+ * PARAMETERS:  notify_value    - Value from the Notify() request
+ *
+ * RETURN:      String corresponding to the Notify Value.
+ *
+ * DESCRIPTION: Translate a Notify Value to a notify namestring.
+ *
+ ******************************************************************************/
+
+/* Names for Notify() values, used for debug output */
+
+static const char *acpi_gbl_notify_value_names[] = {
+	"Bus Check",
+	"Device Check",
+	"Device Wake",
+	"Eject Request",
+	"Device Check Light",
+	"Frequency Mismatch",
+	"Bus Mode Mismatch",
+	"Power Fault",
+	"Capabilities Check",
+	"Device PLD Check",
+	"Reserved",
+	"System Locality Update"
+};
+
+const char *acpi_ut_get_notify_name(u32 notify_value)
+{
+
+	if (notify_value <= ACPI_NOTIFY_MAX) {
+		return (acpi_gbl_notify_value_names[notify_value]);
+	} else if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
+		return ("Reserved");
+	} else {		/* Greater or equal to 0x80 */
+
+		return ("**Device Specific**");
+	}
+}
 #endif
 
 /*******************************************************************************
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 75ec153..cc24cef 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -402,14 +402,20 @@ typedef unsigned long long acpi_integer;
 /*
  * Standard notify values
  */
-#define ACPI_NOTIFY_BUS_CHECK           (u8) 0
-#define ACPI_NOTIFY_DEVICE_CHECK        (u8) 1
-#define ACPI_NOTIFY_DEVICE_WAKE         (u8) 2
-#define ACPI_NOTIFY_EJECT_REQUEST       (u8) 3
-#define ACPI_NOTIFY_DEVICE_CHECK_LIGHT  (u8) 4
-#define ACPI_NOTIFY_FREQUENCY_MISMATCH  (u8) 5
-#define ACPI_NOTIFY_BUS_MODE_MISMATCH   (u8) 6
-#define ACPI_NOTIFY_POWER_FAULT         (u8) 7
+#define ACPI_NOTIFY_BUS_CHECK           (u8) 0x00
+#define ACPI_NOTIFY_DEVICE_CHECK        (u8) 0x01
+#define ACPI_NOTIFY_DEVICE_WAKE         (u8) 0x02
+#define ACPI_NOTIFY_EJECT_REQUEST       (u8) 0x03
+#define ACPI_NOTIFY_DEVICE_CHECK_LIGHT  (u8) 0x04
+#define ACPI_NOTIFY_FREQUENCY_MISMATCH  (u8) 0x05
+#define ACPI_NOTIFY_BUS_MODE_MISMATCH   (u8) 0x06
+#define ACPI_NOTIFY_POWER_FAULT         (u8) 0x07
+#define ACPI_NOTIFY_CAPABILITIES_CHECK  (u8) 0x08
+#define ACPI_NOTIFY_DEVICE_PLD_CHECK    (u8) 0x09
+#define ACPI_NOTIFY_RESERVED            (u8) 0x0A
+#define ACPI_NOTIFY_LOCALITY_UPDATE     (u8) 0x0B
+
+#define ACPI_NOTIFY_MAX                 0x0B
 
 /*
  * Types associated with ACPI names and objects.  The first group of
@@ -584,7 +590,7 @@ typedef u32 acpi_event_status;
 
 #define ACPI_SYSTEM_NOTIFY              0x1
 #define ACPI_DEVICE_NOTIFY              0x2
-#define ACPI_ALL_NOTIFY                 0x3
+#define ACPI_ALL_NOTIFY                 (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY)
 #define ACPI_MAX_NOTIFY_HANDLER_TYPE    0x3
 
 #define ACPI_MAX_SYS_NOTIFY             0x7f
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index a291854..26115da 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -116,6 +116,8 @@ void acpi_ut_init_globals(void);
 
 char *acpi_ut_get_mutex_name(u32 mutex_id);
 
+const char *acpi_ut_get_notify_name(u32 notify_value);
+
 #endif
 
 char *acpi_ut_get_type_name(acpi_object_type type);
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 72/73] ACPICA: Update version to 20080321
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (69 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 71/73] ACPICA: Update for new Notify values Len Brown
@ 2008-04-12  4:25   ` Len Brown
  2008-04-12  4:25   ` [PATCH 73/73] ACPICA: Fix for some local named nodes not marked temporary and to disallow duplicates Len Brown
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Update version to 20080321.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 2c85fd3..b4668b1 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20080213
+#define ACPI_CA_VERSION                 0x20080321
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* [PATCH 73/73] ACPICA: Fix for some local named nodes not marked temporary and to disallow duplicates
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
                     ` (70 preceding siblings ...)
  2008-04-12  4:25   ` [PATCH 72/73] ACPICA: Update version to 20080321 Len Brown
@ 2008-04-12  4:25   ` Len Brown
  71 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Len Brown

From: Bob Moore <robert.moore@intel.com>

Fixed a problem with the CreateField, CreateXXXField (Bit, Byte,
Word, Dword, Qword), Field, BankField, and IndexField operators
when invoked from inside an executing control method. In this case,
these operators created namespace nodes that were incorrectly
left marked as permanent nodes instead of temporary nodes. This
could cause a problem if there is race condition between an
exiting control method and a running namespace walk. (Reported
by Linn Crosetto). Fixed a problem where the CreateField and
CreateXXXField operators would incorrectly allow duplicate names
(the name of the field) with no exception generated.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsfield.c |  121 ++++++++++++++++++++++---------------
 drivers/acpi/dispatcher/dswload.c |    6 ++
 2 files changed, 79 insertions(+), 48 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c
index e87f6bf..0befcff 100644
--- a/drivers/acpi/dispatcher/dsfield.c
+++ b/drivers/acpi/dispatcher/dsfield.c
@@ -89,12 +89,16 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
 
 	ACPI_FUNCTION_TRACE(ds_create_buffer_field);
 
-	/* Get the name_string argument */
-
+	/*
+	 * Get the name_string argument (name of the new buffer_field)
+	 */
 	if (op->common.aml_opcode == AML_CREATE_FIELD_OP) {
+
+		/* For create_field, name is the 4th argument */
+
 		arg = acpi_ps_get_arg(op, 3);
 	} else {
-		/* Create Bit/Byte/Word/Dword field */
+		/* For all other create_xXXField operators, name is the 3rd argument */
 
 		arg = acpi_ps_get_arg(op, 2);
 	}
@@ -107,26 +111,30 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
 		node = walk_state->deferred_node;
 		status = AE_OK;
 	} else {
-		/*
-		 * During the load phase, we want to enter the name of the field into
-		 * the namespace.  During the execute phase (when we evaluate the size
-		 * operand), we want to lookup the name
-		 */
-		if (walk_state->parse_flags & ACPI_PARSE_EXECUTE) {
-			flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE;
-		} else {
-			flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
-			    ACPI_NS_ERROR_IF_FOUND;
+		/* Execute flag should always be set when this function is entered */
+
+		if (!(walk_state->parse_flags & ACPI_PARSE_EXECUTE)) {
+			return_ACPI_STATUS(AE_AML_INTERNAL);
 		}
 
-		/*
-		 * Enter the name_string into the namespace
-		 */
+		/* Creating new namespace node, should not already exist */
+
+		flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
+		    ACPI_NS_ERROR_IF_FOUND;
+
+		/* Mark node temporary if we are executing a method */
+
+		if (walk_state->method_node) {
+			flags |= ACPI_NS_TEMPORARY;
+		}
+
+		/* Enter the name_string into the namespace */
+
 		status =
 		    acpi_ns_lookup(walk_state->scope_info,
 				   arg->common.value.string, ACPI_TYPE_ANY,
 				   ACPI_IMODE_LOAD_PASS1, flags, walk_state,
-				   &(node));
+				   &node);
 		if (ACPI_FAILURE(status)) {
 			ACPI_ERROR_NAMESPACE(arg->common.value.string, status);
 			return_ACPI_STATUS(status);
@@ -136,13 +144,13 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
 	/*
 	 * We could put the returned object (Node) on the object stack for later,
 	 * but for now, we will put it in the "op" object that the parser uses,
-	 * so we can get it again at the end of this scope
+	 * so we can get it again at the end of this scope.
 	 */
 	op->common.node = node;
 
 	/*
 	 * If there is no object attached to the node, this node was just created
-	 * and we need to create the field object.  Otherwise, this was a lookup
+	 * and we need to create the field object. Otherwise, this was a lookup
 	 * of an existing node and we don't want to create the field object again.
 	 */
 	obj_desc = acpi_ns_get_attached_object(node);
@@ -164,9 +172,8 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
 	}
 
 	/*
-	 * Remember location in AML stream of the field unit
-	 * opcode and operands -- since the buffer and index
-	 * operands must be evaluated.
+	 * Remember location in AML stream of the field unit opcode and operands --
+	 * since the buffer and index operands must be evaluated.
 	 */
 	second_desc = obj_desc->common.next_object;
 	second_desc->extra.aml_start = op->named.data;
@@ -261,7 +268,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
 
 		case AML_INT_NAMEDFIELD_OP:
 
-			/* Lookup the name */
+			/* Lookup the name, it should already exist */
 
 			status = acpi_ns_lookup(walk_state->scope_info,
 						(char *)&arg->named.name,
@@ -272,19 +279,16 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
 			if (ACPI_FAILURE(status)) {
 				ACPI_ERROR_NAMESPACE((char *)&arg->named.name,
 						     status);
-				if (status != AE_ALREADY_EXISTS) {
-					return_ACPI_STATUS(status);
-				}
-
-				/* Already exists, ignore error */
+				return_ACPI_STATUS(status);
 			} else {
 				arg->common.node = info->field_node;
 				info->field_bit_length = arg->common.value.size;
 
 				/*
-				 * If there is no object attached to the node, this node was just created
-				 * and we need to create the field object.  Otherwise, this was a lookup
-				 * of an existing node and we don't want to create the field object again.
+				 * If there is no object attached to the node, this node was
+				 * just created and we need to create the field object.
+				 * Otherwise, this was a lookup of an existing node and we
+				 * don't want to create the field object again.
 				 */
 				if (!acpi_ns_get_attached_object
 				    (info->field_node)) {
@@ -409,18 +413,23 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
 
 	ACPI_FUNCTION_TRACE_PTR(ds_init_field_objects, op);
 
-	/*
-	 * During the load phase, we want to enter the name of the field into
-	 * the namespace. During the execute phase (when we evaluate the bank_value
-	 * operand), we want to lookup the name.
-	 */
-	if (walk_state->deferred_node) {
-		flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE;
-	} else {
-		flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
-		    ACPI_NS_ERROR_IF_FOUND;
+	/* Execute flag should always be set when this function is entered */
+
+	if (!(walk_state->parse_flags & ACPI_PARSE_EXECUTE)) {
+		if (walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP) {
+
+			/* bank_field Op is deferred, just return OK */
+
+			return_ACPI_STATUS(AE_OK);
+		}
+
+		return_ACPI_STATUS(AE_AML_INTERNAL);
 	}
 
+	/*
+	 * Get the field_list argument for this opcode. This is the start of the
+	 * list of field elements.
+	 */
 	switch (walk_state->opcode) {
 	case AML_FIELD_OP:
 		arg = acpi_ps_get_arg(op, 2);
@@ -441,18 +450,34 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
 		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
 
+	if (!arg) {
+		return_ACPI_STATUS(AE_AML_NO_OPERAND);
+	}
+
+	/* Creating new namespace node(s), should not already exist */
+
+	flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
+	    ACPI_NS_ERROR_IF_FOUND;
+
+	/* Mark node(s) temporary if we are executing a method */
+
+	if (walk_state->method_node) {
+		flags |= ACPI_NS_TEMPORARY;
+	}
+
 	/*
 	 * Walk the list of entries in the field_list
 	 */
 	while (arg) {
-
-		/* Ignore OFFSET and ACCESSAS terms here */
-
+		/*
+		 * Ignore OFFSET and ACCESSAS terms here; we are only interested in the
+		 * field names in order to enter them into the namespace.
+		 */
 		if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) {
 			status = acpi_ns_lookup(walk_state->scope_info,
-						(char *)&arg->named.name,
-						type, ACPI_IMODE_LOAD_PASS1,
-						flags, walk_state, &node);
+						(char *)&arg->named.name, type,
+						ACPI_IMODE_LOAD_PASS1, flags,
+						walk_state, &node);
 			if (ACPI_FAILURE(status)) {
 				ACPI_ERROR_NAMESPACE((char *)&arg->named.name,
 						     status);
@@ -468,7 +493,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
 			arg->common.node = node;
 		}
 
-		/* Move to next field in the list */
+		/* Get the next field element in the list */
 
 		arg = arg->common.next;
 	}
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
index ec68c1d..775b183 100644
--- a/drivers/acpi/dispatcher/dswload.c
+++ b/drivers/acpi/dispatcher/dswload.c
@@ -776,6 +776,12 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
 		    acpi_ns_lookup(walk_state->scope_info, buffer_ptr,
 				   object_type, ACPI_IMODE_LOAD_PASS2, flags,
 				   walk_state, &node);
+
+		if (ACPI_SUCCESS(status) && (flags & ACPI_NS_TEMPORARY)) {
+			ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
+					  "***New Node [%4.4s] %p is temporary\n",
+					  acpi_ut_get_node_name(node), node));
+		}
 		break;
 	}
 
-- 
1.5.5.29.g7134


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* Re: ACPICA branch - first try Core revision 20080321
  2008-04-12  4:24 ACPICA branch Len Brown
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
@ 2008-04-12  4:41 ` Len Brown
  2008-04-12 20:46   ` Alexey Starikovskiy
  2008-04-29  9:04 ` ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions) Len Brown
  2 siblings, 1 reply; 123+ messages in thread
From: Len Brown @ 2008-04-12  4:41 UTC (permalink / raw)
  To: linux-acpi, Moore, Robert, Alexey Starikovskiy

[-- Attachment #1: Type: text/plain, Size: 8446 bytes --]

The acpica branch is based on 2.6.25-rc9.
Below is a dmesg diff of an HP nx6325 booting that baseline
vs. booting the acpica branch.

Two things jump out:

1. ACPI: Expecting a [Reference] package element, found type 14

2. memory coorruption:

slab error in verify_redzone_free(): cache `size-1024': memory outside object was overwritten

-Len


1c1
< Linux version 2.6.25-rc9 (lenb@t61) (gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)) #50 SMP Fri Apr 11 22:46:39 EDT 2008
---
> Linux version 2.6.25-rc9-00073-g8b56e6a (lenb@t61) (gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)) #33 SMP Sat Apr 12 00:07:51 EDT 2008
40c40
< early res: 2 [200000-8d9707] TEXT DATA BSS
---
> early res: 2 [200000-8d9747] TEXT DATA BSS
95a96
> spurious 8259A interrupt: IRQ7.
102c103
< Memory: 442500k/458560k available (3629k kernel code, 15672k reserved, 2023k data, 364k init)
---
> Memory: 442500k/458560k available (3632k kernel code, 15672k reserved, 2020k data, 364k init)
104c105
< Calibrating delay using timer specific routine.. 3194.17 BogoMIPS (lpj=1597086)
---
> Calibrating delay using timer specific routine.. 3194.25 BogoMIPS (lpj=1597129)
113c114
< ACPI: Core revision 20070126
---
> ACPI: Core revision 20080321
126c127
< Calibrating delay using timer specific routine.. 3191.63 BogoMIPS (lpj=1595818)
---
> Calibrating delay using timer specific routine.. 3191.59 BogoMIPS (lpj=1595798)
154,155c155,156
< Completing Region/Field/Buffer/Package initialization:................................................................................................................................................................
< Initialized 29/33 Regions 0/0 Fields 63/64 Buffers 68/78 Packages (1172 nodes)
---
> Completing Region/Field/Buffer/Package initialization:...............................................................................................................................................................
> Initialized 29/33 Regions 0/0 Fields 63/64 Buffers 67/78 Packages (1172 nodes)
160a162,168
> ACPI: Expecting a [Reference] package element, found type 14
> ACPI: Expecting a [Reference] package element, found type 14
> ACPI: Expecting a [Reference] package element, found type 14
> ACPI: Expecting a [Reference] package element, found type 14
> ACPI: Expecting a [Reference] package element, found type 14
> ACPI: Expecting a [Reference] package element, found type 14
> ACPI: Expecting a [Reference] package element, found type 14
228d235
< PCI: Bridge: 0000:00:05.0
232a240
> PCI: Bridge: 0000:00:05.0
381c389
< usb usb1: Manufacturer: Linux 2.6.25-rc9 ehci_hcd
---
> usb usb1: Manufacturer: Linux 2.6.25-rc9-00073-g8b56e6a ehci_hcd
394c402
< usb usb2: Manufacturer: Linux 2.6.25-rc9 ohci_hcd
---
> usb usb2: Manufacturer: Linux 2.6.25-rc9-00073-g8b56e6a ohci_hcd
406c414
< usb usb3: Manufacturer: Linux 2.6.25-rc9 ohci_hcd
---
> usb usb3: Manufacturer: Linux 2.6.25-rc9-00073-g8b56e6a ohci_hcd
448a457,463
> ACPI: Expecting a [Reference] package element, found type 14
> ACPI: Expecting a [Reference] package element, found type 14
> ACPI: LNXTHERM:01 is registered as thermal_zone0
> ACPI: Thermal Zone [TZ1] (67 C)
> ACPI: Expecting a [Reference] package element, found type 14
> ACPI: LNXTHERM:02 is registered as thermal_zone1
> ACPI: Thermal Zone [TZ2] (54 C)
452d466
< ACPI: AC Adapter [C1BD] (on-line)
459a474,477
> ACPI: AC Adapter [C1BD] (on-line)
> ACPI: Expecting a [Reference] package element, found type 14
> ACPI: LNXTHERM:03 is registered as thermal_zone2
> ACPI: Thermal Zone [TZ3] (29 C)
461a480,487
> ACPI: PNP0C0B:00 is registered as cooling_device2
> ACPI: Fan [C34F] (off)
> ACPI: PNP0C0B:01 is registered as cooling_device3
> ACPI: Fan [C350] (off)
> ACPI: PNP0C0B:02 is registered as cooling_device4
> ACPI: Fan [C351] (off)
> ACPI: PNP0C0B:03 is registered as cooling_device5
> ACPI: Fan [C352] (off)
471a498
> ACPI: WMI: Mapper loaded
481c508
< power_supply C1BF: prop VOLTAGE_NOW=12617000
---
> power_supply C1BF: prop VOLTAGE_NOW=12616000
490,507d516
< ACPI: WMI: Mapper loaded
< ACPI: LNXTHERM:01 is registered as thermal_zone0
< ACPI: Thermal Zone [TZ1] (54 C)
< ACPI: LNXTHERM:02 is registered as thermal_zone1
< ACPI: Thermal Zone [TZ2] (46 C)
< ACPI: LNXTHERM:03 is registered as thermal_zone2
< ACPI: Thermal Zone [TZ3] (28 C)
< ACPI: Transitioning device [C34F] to D3
< ACPI: PNP0C0B:00 is registered as cooling_device2
< ACPI: Fan [C34F] (off)
< ACPI: Transitioning device [C350] to D3
< ACPI: PNP0C0B:01 is registered as cooling_device3
< ACPI: Fan [C350] (off)
< ACPI: Transitioning device [C351] to D3
< ACPI: PNP0C0B:02 is registered as cooling_device4
< ACPI: Fan [C351] (off)
< ACPI: PNP0C0B:03 is registered as cooling_device5
< ACPI: Fan [C352] (on)
524c533
< Clocksource tsc unstable (delta = -245722066 ns)
---
> Clocksource tsc unstable (delta = -249928054 ns)
527a537,600
> ACPI: PCI Interrupt 0000:01:05.0[A] -> GSI 17 (level, low) -> IRQ 17
> slab error in verify_redzone_free(): cache `size-1024': memory outside object was overwritten
> Pid: 96, comm: kacpi_notify Not tainted 2.6.25-rc9-00073-g8b56e6a #33
> 
> Call Trace:
>  [<ffffffff8027f57b>] __slab_error+0x24/0x26
>  [<ffffffff8027fb72>] cache_free_debugcheck+0x136/0x207
>  [<ffffffff8037f2bc>] ? acpi_ev_asynch_enable_gpe+0x2b/0x2f
>  [<ffffffff80281afb>] kfree+0x9c/0x216
>  [<ffffffff80375e86>] ? acpi_os_execute_deferred+0x0/0x39
>  [<ffffffff8037f2bc>] acpi_ev_asynch_enable_gpe+0x2b/0x2f
>  [<ffffffff80375eb2>] acpi_os_execute_deferred+0x2c/0x39
>  [<ffffffff8023f480>] run_workqueue+0x7d/0x106
>  [<ffffffff8023fe41>] worker_thread+0xd8/0xe5
>  [<ffffffff80242913>] ? autoremove_wake_function+0x0/0x38
>  [<ffffffff8023fd69>] ? worker_thread+0x0/0xe5
>  [<ffffffff802427d4>] kthread+0x49/0x79
>  [<ffffffff8020bef8>] child_rip+0xa/0x12
>  [<ffffffff8024278b>] ? kthread+0x0/0x79
>  [<ffffffff8020beee>] ? child_rip+0x0/0x12
> 
> ffff81001b028e70: redzone 1:0x800, redzone 2:0x5a5a5a5a5a5a5a5a.
> ------------[ cut here ]------------
> kernel BUG at mm/slab.c:2906!
> invalid opcode: 0000 [1] SMP 
> CPU 0 
> Modules linked in: powernow_k8 pcmcia snd_hda_intel snd_seq_device snd_pcm_oss snd_mixer_oss snd_pcm snd_timer yenta_socket rsrc_nonstatic snd_page_alloc wmi battery fan video backlight ac thermal
> Pid: 96, comm: kacpi_notify Not tainted 2.6.25-rc9-00073-g8b56e6a #33
> RIP: 0010:[<ffffffff8027fc0c>]  [<ffffffff8027fc0c>] cache_free_debugcheck+0x1d0/0x207
> RSP: 0018:ffff81001b037df0  EFLAGS: 00010016
> RAX: ffff81001b028d98 RBX: ffff81001b804ac0 RCX: ffff81001b028150
> RDX: 0000000000000003 RSI: ffff81001b028e70 RDI: ffff81001b804ac0
> RBP: ffff81001b037e20 R08: 09f911029d74e35b R09: 00000000ffffff20
> R10: 0000000000000010 R11: 0000000000000000 R12: 0000000000000800
> R13: ffff81001b028e70 R14: 5a5a5a5a5a5a5a5a R15: ffff81001b028100
> FS:  00000000409b4950(0000) GS:ffffffff80786000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
> CR2: 00000030ed8c6d80 CR3: 0000000019c38000 CR4: 00000000000006e0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> Process kacpi_notify (pid: 96, threadinfo ffff81001b036000, task ffff81001bb06740)
> Stack:  ffffffff8037f2bc ffff81001b80b5e8 ffff81001b804ac0 ffff81001b028e78
>  ffffffff807f3bc0 0000000000000282 ffff81001b037e70 ffffffff80281afb
>  ffffffff807f3bc0 0000000000008025 ffff81001b028e78 ffff81001b028e78
> Call Trace:
>  [<ffffffff8037f2bc>] ? acpi_ev_asynch_enable_gpe+0x2b/0x2f
>  [<ffffffff80281afb>] kfree+0x9c/0x216
>  [<ffffffff80375e86>] ? acpi_os_execute_deferred+0x0/0x39
>  [<ffffffff8037f2bc>] acpi_ev_asynch_enable_gpe+0x2b/0x2f
>  [<ffffffff80375eb2>] acpi_os_execute_deferred+0x2c/0x39
>  [<ffffffff8023f480>] run_workqueue+0x7d/0x106
>  [<ffffffff8023fe41>] worker_thread+0xd8/0xe5
>  [<ffffffff80242913>] ? autoremove_wake_function+0x0/0x38
>  [<ffffffff8023fd69>] ? worker_thread+0x0/0xe5
>  [<ffffffff802427d4>] kthread+0x49/0x79
>  [<ffffffff8020bef8>] child_rip+0xa/0x12
>  [<ffffffff8024278b>] ? kthread+0x0/0x79
>  [<ffffffff8020beee>] ? child_rip+0x0/0x12
> 
> 
> Code: 29 c8 48 0f af c2 48 89 c2 48 c1 ea 20 3b 93 18 01 00 00 72 04 0f 0b eb fe 89 d0 0f af 83 0c 01 00 00 48 8d 04 01 49 39 c5 74 04 <0f> 0b eb fe 89 d0 41 c7 44 87 30 fe ff ff ff f6 83 15 01 00 00 
> RIP  [<ffffffff8027fc0c>] cache_free_debugcheck+0x1d0/0x207
>  RSP <ffff81001b037df0>
> ---[ end trace b34da6ee0b4cc39e ]---

[-- Attachment #2: dmesg-2.6.25-rc9-00073-g8b56e6a --]
[-- Type: text/plain, Size: 29060 bytes --]

Linux version 2.6.25-rc9-00073-g8b56e6a (lenb@t61) (gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)) #33 SMP Sat Apr 12 00:07:51 EDT 2008
Command line: root=/dev/sda3 debug
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000001bfd0000 (usable)
 BIOS-e820: 000000001bfd0000 - 000000001bfe5600 (reserved)
 BIOS-e820: 000000001bfe5600 - 000000001bff8000 (ACPI NVS)
 BIOS-e820: 000000001bff8000 - 0000000020000000 (reserved)
 BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
 BIOS-e820: 00000000fec00000 - 00000000fec02000 (reserved)
 BIOS-e820: 00000000ffbc0000 - 00000000ffcc0000 (reserved)
 BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
Entering add_active_range(0, 0, 159) 0 entries of 3200 used
Entering add_active_range(0, 256, 114640) 1 entries of 3200 used
end_pfn_map = 1048576
DMI 2.4 present.
ACPI: RSDP 000F7D30, 0024 (r2 HP    )
ACPI: XSDT 1BFE57B4, 0054 (r1 HP     0944      6070620 HP          1)
ACPI: FACP 1BFE5684, 00F4 (r4 HP     0944            3 HP          1)
ACPI: DSDT 1BFE58DC, EE7A (r1 HP        SB400    10000 MSFT  100000E)
ACPI: FACS 1BFF7E80, 0040
ACPI: APIC 1BFE5808, 0062 (r1 HP     0944            1 HP          1)
ACPI: MCFG 1BFE586C, 003C (r1 HP     0944            1 HP          1)
ACPI: TCPA 1BFE58A8, 0032 (r2 HP     0944            1 HP          1)
ACPI: SSDT 1BFF4756, 0059 (r1 HP       HPQNLP        1 MSFT  100000E)
ACPI: SSDT 1BFF47AF, 0182 (r1 HP     PSSTBLID        1 HP          1)
ACPI: DMI detected: Hewlett-Packard
Scanning NUMA topology in Northbridge 24
No NUMA configuration found
Faking a node at 0000000000000000-000000001bfd0000
Entering add_active_range(0, 0, 159) 0 entries of 3200 used
Entering add_active_range(0, 256, 114640) 1 entries of 3200 used
Bootmem setup node 0 0000000000000000-000000001bfd0000
  NODE_DATA [000000000000b000 - 0000000000011fff]
  bootmap [0000000000012000 -  00000000000157ff] pages 4
early res: 0 [0-fff] BIOS data page
early res: 1 [6000-7fff] SMP_TRAMPOLINE
early res: 2 [200000-8d9747] TEXT DATA BSS
early res: 3 [9fc00-a0bff] EBDA
early res: 4 [8000-afff] PGTABLE
No mptable found.
 [ffffe20000000000-ffffe200001fffff] PMD ->ffff810001200000 on node 0
 [ffffe20000200000-ffffe200003fffff] PMD ->ffff810001600000 on node 0
 [ffffe20000400000-ffffe200005fffff] PMD ->ffff810001a00000 on node 0
 [ffffe20000600000-ffffe200007fffff] PMD ->ffff810001e00000 on node 0
Zone PFN ranges:
  DMA             0 ->     4096
  DMA32        4096 ->  1048576
  Normal    1048576 ->  1048576
Movable zone start PFN for each node
early_node_map[2] active PFN ranges
    0:        0 ->      159
    0:      256 ->   114640
On node 0 totalpages: 114543
  DMA zone: 56 pages used for memmap
  DMA zone: 1760 pages reserved
  DMA zone: 2183 pages, LIFO batch:0
  DMA32 zone: 1511 pages used for memmap
  DMA32 zone: 109033 pages, LIFO batch:31
  Normal zone: 0 pages used for memmap
  Movable zone: 0 pages used for memmap
ATI board detected. Disabling timer routing over 8254.
Detected use of extended apic ids on hypertransport bus
ACPI: PM-Timer IO Port: 0x8008
ACPI: Local APIC address 0xfee00000
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
Processor #0 (Bootup-CPU)
ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
Processor #1
ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 2, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 21 low level)
ACPI: IRQ0 used by override.
ACPI: IRQ2 used by override.
Setting APIC routing to flat
Using ACPI (MADT) for SMP configuration information
PM: Registered nosave memory: 000000000009f000 - 00000000000a0000
PM: Registered nosave memory: 00000000000a0000 - 00000000000e0000
PM: Registered nosave memory: 00000000000e0000 - 0000000000100000
Allocating PCI resources starting at 30000000 (gap: 20000000:c0000000)
SMP: Allowing 2 CPUs, 0 hotplug CPUs
PERCPU: Allocating 35648 bytes of per cpu data
Built 1 zonelists in Node order, mobility grouping on.  Total pages: 111216
Policy zone: DMA32
Kernel command line: root=/dev/sda3 debug
Initializing CPU#0
PID hash table entries: 2048 (order: 11, 16384 bytes)
Extended CMOS year: 2000
TSC calibrated against PM_TIMER
Marking TSC unstable due to TSCs unsynchronized
time.c: Detected 1595.999 MHz processor.
spurious 8259A interrupt: IRQ7.
Console: colour VGA+ 80x25
console [tty0] enabled
Checking aperture...
Node 0: aperture @ 9494000000 size 32 MB
Aperture beyond 4GB. Ignoring.
No AGP bridge found
Memory: 442500k/458560k available (3632k kernel code, 15672k reserved, 2020k data, 364k init)
CPA: page pool initialized 1 of 1 pages preallocated
Calibrating delay using timer specific routine.. 3194.25 BogoMIPS (lpj=1597129)
Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
Mount-cache hash table entries: 256
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 256K (64 bytes/line)
CPU 0/0 -> Node 0
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
ACPI: Core revision 20080321
Parsing all Control Methods:
Table [DSDT](id 0001) - 1153 Objects with 113 Devices 337 Methods 33 Regions
Parsing all Control Methods:
Table [SSDT](id 0002) - 2 Objects with 0 Devices 2 Methods 0 Regions
Parsing all Control Methods:
Table [SSDT](id 0003) - 8 Objects with 0 Devices 0 Methods 0 Regions
 tbxface-0598 [00] tb_load_namespace     : ACPI Tables successfully acquired
evxfevnt-0091 [00] enable                : Transition to ACPI mode successful
..MP-BIOS bug: 8254 timer not connected to IO-APIC
Disabling APIC timer
Booting processor 1/2 APIC 0x1
Initializing CPU#1
Calibrating delay using timer specific routine.. 3191.59 BogoMIPS (lpj=1595798)
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 256K (64 bytes/line)
CPU 1/1 -> Node 0
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 1
AMD Turion(tm) 64 X2 Mobile Technology TL-50 stepping 02
Brought up 2 CPUs
CPU0 attaching sched-domain:
 domain 0: span 00000003
  groups: 00000001 00000002
  domain 1: span 00000003
   groups: 00000003
CPU1 attaching sched-domain:
 domain 0: span 00000003
  groups: 00000002 00000001
  domain 1: span 00000003
   groups: 00000003
net_namespace: 296 bytes
NET: Registered protocol family 16
No dock devices found.
ACPI: bus type pci registered
PCI: Using MMCONFIG at e0000000 - efffffff
PCI: Using configuration type 1
evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE] 4 regs on int 0x15
evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 3 Wake, Enabled 11 Runtime GPEs in this block
ACPI: EC: Look up EC in DSDT
ACPI: EC: non-query interrupt received, switching to interrupt mode
Completing Region/Field/Buffer/Package initialization:...............................................................................................................................................................
Initialized 29/33 Regions 0/0 Fields 63/64 Buffers 67/78 Packages (1172 nodes)
Initializing Device/Processor/Thermal objects by executing _INI methods:.......
Executed 7 _INI methods requiring 2 _STA executions (examined 120 objects)
ACPI: Interpreter enabled
ACPI: (supports S0 S3 S4 S5)
ACPI: Using IOAPIC for interrupt routing
ACPI: Expecting a [Reference] package element, found type 14
ACPI: Expecting a [Reference] package element, found type 14
ACPI: Expecting a [Reference] package element, found type 14
ACPI: Expecting a [Reference] package element, found type 14
ACPI: Expecting a [Reference] package element, found type 14
ACPI: Expecting a [Reference] package element, found type 14
ACPI: Expecting a [Reference] package element, found type 14
ACPI: EC: GPE = 0x11, I/O: command/status = 0x66, data = 0x62
ACPI: EC: driver started in interrupt mode
ACPI: PCI Root Bridge [C074] (0000:00)
PCI: Transparent bridge - 0000:00:14.4
ACPI: PCI Interrupt Routing Table [\_SB_.C074._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.C074.C075._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.C074.C0DF._PRT]
ACPI: PCI Interrupt Link [C125] (IRQs 10 11) *0, disabled.
ACPI: PCI Interrupt Link [C126] (IRQs 10 11) *0, disabled.
ACPI: PCI Interrupt Link [C127] (IRQs 10 11) *0, disabled.
ACPI: PCI Interrupt Link [C128] (IRQs 10 11) *0, disabled.
ACPI: PCI Interrupt Link [C129] (IRQs 10 11) *0, disabled.
ACPI: PCI Interrupt Link [C12A] (IRQs 9) *0, disabled.
ACPI: PCI Interrupt Link [C12B] (IRQs 10 11) *0, disabled.
ACPI: PCI Interrupt Link [C12C] (IRQs *10 11)
ACPI: Power Resource [C223] (off)
ACPI: Power Resource [C1FE] (off)
ACPI: Power Resource [C217] (on)
ACPI: Power Resource [C34B] (off)
ACPI: Power Resource [C34C] (off)
ACPI: Power Resource [C34D] (off)
ACPI: Power Resource [C34E] (off)
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
ACPI: bus type pnp registered
pnp: PnP ACPI: found 13 devices
ACPI: ACPI bus type pnp unregistered
SCSI subsystem initialized
libata version 3.00 loaded.
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
PCI: Cannot allocate resource region 0 of device 0000:00:14.2
DMAR:parse DMAR table failure.
system 00:00: iomem range 0x0-0x9ffff could not be reserved
system 00:00: iomem range 0xe0000-0xfffff could not be reserved
system 00:00: iomem range 0x100000-0x1bffffff could not be reserved
system 00:0a: ioport range 0x40b-0x40b has been reserved
system 00:0a: ioport range 0x4d0-0x4d1 has been reserved
system 00:0a: ioport range 0x4d6-0x4d6 has been reserved
system 00:0a: ioport range 0x500-0x51f has been reserved
system 00:0a: ioport range 0xc00-0xc01 has been reserved
system 00:0a: ioport range 0xc14-0xc14 has been reserved
system 00:0a: ioport range 0xc50-0xc51 has been reserved
system 00:0a: ioport range 0xc52-0xc52 has been reserved
system 00:0a: ioport range 0xc6c-0xc6c has been reserved
system 00:0a: ioport range 0xc6f-0xc6f has been reserved
system 00:0a: ioport range 0xcd4-0xcdf has been reserved
system 00:0a: iomem range 0xffb00000-0xffbfffff could not be reserved
system 00:0a: iomem range 0xfff00000-0xffffffff could not be reserved
system 00:0b: ioport range 0x8000-0x802f has been reserved
system 00:0b: ioport range 0x8100-0x811f has been reserved
system 00:0b: iomem range 0xe0000000-0xefffffff could not be reserved
system 00:0b: iomem range 0xfec00000-0xfec00fff could not be reserved
system 00:0c: iomem range 0xcf000-0xcffff has been reserved
system 00:0c: iomem range 0x1c000000-0x1fffffff could not be reserved
system 00:0c: iomem range 0xfee00000-0xfee00fff could not be reserved
PCI: Bridge: 0000:00:01.0
  IO window: 6000-6fff
  MEM window: 0xd0300000-0xd03fffff
  PREFETCH window: 0x00000000c0000000-0x00000000c3ffffff
PCI: Bridge: 0000:00:04.0
  IO window: 4000-5fff
  MEM window: 0xcc000000-0xcfffffff
  PREFETCH window: disabled.
Clockevents: could not switch to one-shot mode: lapic is not functional.
Could not switch to high resolution mode on CPU 0
Clockevents: could not switch to one-shot mode: lapic is not functional.
Could not switch to high resolution mode on CPU 1
PCI: Bridge: 0000:00:05.0
  IO window: 2000-3fff
  MEM window: 0xc8000000-0xcbffffff
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:06.0
  IO window: disabled.
  MEM window: 0xc4000000-0xc40fffff
  PREFETCH window: disabled.
PCI: Bus 3, cardbus bridge: 0000:02:04.0
  IO window: 0x00001000-0x000010ff
  IO window: 0x00001400-0x000014ff
  PREFETCH window: 0x30000000-0x33ffffff
  MEM window: 0x38000000-0x3bffffff
PCI: Bridge: 0000:00:14.4
  IO window: 1000-1fff
  MEM window: 0xd0000000-0xd02fffff
  PREFETCH window: 0x0000000030000000-0x0000000033ffffff
PCI: Setting latency timer of device 0000:00:04.0 to 64
PCI: Setting latency timer of device 0000:00:05.0 to 64
PCI: Setting latency timer of device 0000:00:06.0 to 64
ACPI: PCI Interrupt 0000:02:04.0[A] -> GSI 20 (level, low) -> IRQ 20
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 3, 32768 bytes)
TCP established hash table entries: 16384 (order: 6, 262144 bytes)
TCP bind hash table entries: 16384 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
Total HugeTLB memory allocated, 0
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
pci 0000:00:00.0: MSI quirk detected; MSI disabled
pci 0000:01:05.0: Boot video device
PCI: Setting latency timer of device 0000:00:04.0 to 64
assign_interrupt_mode Found MSI capability
Allocate Port Service[0000:00:04.0:pcie00]
Allocate Port Service[0000:00:04.0:pcie01]
Allocate Port Service[0000:00:04.0:pcie03]
PCI: Setting latency timer of device 0000:00:05.0 to 64
assign_interrupt_mode Found MSI capability
Allocate Port Service[0000:00:05.0:pcie00]
Allocate Port Service[0000:00:05.0:pcie01]
Allocate Port Service[0000:00:05.0:pcie03]
PCI: Setting latency timer of device 0000:00:06.0 to 64
assign_interrupt_mode Found MSI capability
Allocate Port Service[0000:00:06.0:pcie00]
Allocate Port Service[0000:00:06.0:pcie01]
Allocate Port Service[0000:00:06.0:pcie03]
AER service couldn't init device 0000:00:04.0:pcie01 - no _OSC support
AER service couldn't init device 0000:00:05.0:pcie01 - no _OSC support
AER service couldn't init device 0000:00:06.0:pcie01 - no _OSC support
input: Power Button (FF) as /class/input/input0
ACPI: Power Button (FF) [PWRF]
input: Sleep Button (CM) as /class/input/input1
ACPI: Sleep Button (CM) [C25A]
input: Lid Switch as /class/input/input2
ACPI: Lid Switch [C25B]
ACPI: ACPI0007:00 is registered as cooling_device0
ACPI: Processor [C000] (supports 8 throttling states)
ACPI: ACPI0007:01 is registered as cooling_device1
ACPI: Processor [C001] (supports 8 throttling states)
Real Time Clock Driver v1.12ac
Linux agpgart interface v0.103
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
Floppy drive(s): fd0 is 1.44M
Clockevents: could not switch to one-shot mode:<6>Clockevents: could not switch to one-shot mode: lapic is not functional.
Could not switch to high resolution mode on CPU 1
 lapic is not functional.
Could not switch to high resolution mode on CPU 0
floppy0: no floppy controllers found
brd: module loaded
loop: module loaded
Intel(R) PRO/1000 Network Driver - version 7.3.20-k2
Copyright (c) 1999-2006 Intel Corporation.
e100: Intel(R) PRO/100 Network Driver, 3.5.23-k4-NAPI
e100: Copyright(c) 1999-2006 Intel Corporation
tg3.c:v3.89 (April 03, 2008)
ACPI: PCI Interrupt 0000:02:01.0[A] -> GSI 23 (level, low) -> IRQ 23
eth0: Tigon3 [partno(BCM95788A50) rev 3003 PHY(5705)] (PCI:33MHz:32-bit) 10/100/1000Base-T Ethernet 00:17:08:30:e4:ee
eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] WireSpeed[0] TSOcap[1]
eth0: dma_rwctrl[763f0000] dma_mask[32-bit]
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
console [netcon0] enabled
netconsole: network logging started
Uniform Multi-Platform E-IDE driver
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ATIIXP: IDE controller (0x1002:0x4376 rev 0x80) at  PCI slot 0000:00:14.1
ACPI: PCI Interrupt 0000:00:14.1[A] -> GSI 16 (level, low) -> IRQ 16
ATIIXP: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0x7040-0x7047, BIOS settings: hda:DMA, hdb:PIO
ATIIXP: simplex device: DMA disabled
ide1: ATIIXP Bus-Master DMA disabled (BIOS)
Probing IDE interface ide0...
hda: TSSTcorpCDW/DVD TS-L462C, ATAPI CD/DVD-ROM drive
hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
hda: MWDMA2 mode selected
Probing IDE interface ide1...
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hda: ATAPI 24X DVD-ROM CD-R/RW drive, 1536kB Cache
Uniform CD-ROM driver Revision: 3.20
megaraid cmm: 2.20.2.7 (Release Date: Sun Jul 16 00:01:03 EST 2006)
megaraid: 2.20.5.1 (Release Date: Thu Nov 16 15:32:35 EST 2006)
megasas: 00.00.03.16-rc1 Thu. Nov. 07 10:09:32 PDT 2007
Driver 'sd' needs updating - please use bus_type methods
Driver 'sr' needs updating - please use bus_type methods
sata_sil 0000:00:12.0: version 2.3
ACPI: PCI Interrupt 0000:00:12.0[A] -> GSI 16 (level, low) -> IRQ 16
scsi0 : sata_sil
scsi1 : sata_sil
ata1: SATA max UDMA/100 mmio m512@0xd0409000 tf 0xd0409080 irq 16
ata2: SATA max UDMA/100 mmio m512@0xd0409000 tf 0xd04090c0 irq 16
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata1.00: ATA-7: FUJITSU MHT2040BH, 0000104A, max UDMA/100
ata1.00: 78140160 sectors, multi 16: LBA48 NCQ (depth 0/32)
ata1.00: configured for UDMA/100
ata2: SATA link down (SStatus 0 SControl 300)
scsi 0:0:0:0: Direct-Access     ATA      FUJITSU MHT2040B 0000 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 78140160 512-byte hardware sectors (40008 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 0:0:0:0: [sda] 78140160 512-byte hardware sectors (40008 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3
sd 0:0:0:0: [sda] Attached SCSI disk
sd 0:0:0:0: Attached scsi generic sg0 type 0
Fusion MPT base driver 3.04.06
Copyright (c) 1999-2007 LSI Corporation
Fusion MPT SPI Host driver 3.04.06
Fusion MPT SAS Host driver 3.04.06
ACPI: PCI Interrupt 0000:02:04.1[A] -> GSI 20 (level, low) -> IRQ 20
ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[20]  MMIO=[d0011000-d00117ff]  Max Packet=[2048]  IR/IT contexts=[4/8]
ieee1394: raw1394: /dev/raw1394 device initialized
ACPI: PCI Interrupt 0000:00:13.2[A] -> GSI 19 (level, low) -> IRQ 19
ehci_hcd 0000:00:13.2: EHCI Host Controller
ehci_hcd 0000:00:13.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:13.2: irq 19, io mem 0xd0403000
ehci_hcd 0000:00:13.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 8 ports detected
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 2.6.25-rc9-00073-g8b56e6a ehci_hcd
usb usb1: SerialNumber: 0000:00:13.2
ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver
ACPI: PCI Interrupt 0000:00:13.0[A] -> GSI 19 (level, low) -> IRQ 19
ohci_hcd 0000:00:13.0: OHCI Host Controller
ohci_hcd 0000:00:13.0: new USB bus registered, assigned bus number 2
ohci_hcd 0000:00:13.0: irq 19, io mem 0xd0401000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 4 ports detected
usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: OHCI Host Controller
usb usb2: Manufacturer: Linux 2.6.25-rc9-00073-g8b56e6a ohci_hcd
usb usb2: SerialNumber: 0000:00:13.0
ACPI: PCI Interrupt 0000:00:13.1[A] -> GSI 19 (level, low) -> IRQ 19
ohci_hcd 0000:00:13.1: OHCI Host Controller
ohci_hcd 0000:00:13.1: new USB bus registered, assigned bus number 3
ohci_hcd 0000:00:13.1: irq 19, io mem 0xd0402000
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 4 ports detected
usb usb3: New USB device found, idVendor=1d6b, idProduct=0001
usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb3: Product: OHCI Host Controller
usb usb3: Manufacturer: Linux 2.6.25-rc9-00073-g8b56e6a ohci_hcd
usb usb3: SerialNumber: 0000:00:13.1
USB Universal Host Controller Interface driver v3.0
usb 3-1: new full speed USB device using ohci_hcd and address 2
usb 3-1: configuration #1 chosen from 1 choice
usb 3-1: New USB device found, idVendor=08ff, idProduct=2580
usb 3-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 3-1: Product: Fingerprint Sensor
usbcore: registered new interface driver usblp
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
PNP: PS/2 Controller [PNP0303:C214,PNP0f13:C215] at 0x60,0x64 irq 1,12
i8042.c: Detected active multiplexing controller, rev 1.1.
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX0 port at 0x60,0x64 irq 12
serio: i8042 AUX1 port at 0x60,0x64 irq 12
serio: i8042 AUX2 port at 0x60,0x64 irq 12
serio: i8042 AUX3 port at 0x60,0x64 irq 12
mice: PS/2 mouse device common for all mice
input: AT Translated Set 2 keyboard as /class/input/input3
device-mapper: ioctl: 4.13.0-ioctl (2007-10-18) initialised: dm-devel@redhat.com
cpuidle: using governor ladder
cpuidle: using governor menu
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.16rc2 (Thu Jan 31 16:40:16 2008 UTC).
ALSA device list:
  No soundcards found.
oprofile: using NMI interrupt.
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Synaptics Touchpad, model: 1, fw: 6.2, id: 0x25a0b1, caps: 0xa04793/0x300000
serio: Synaptics pass-through port at isa0060/serio4/input0
input: SynPS/2 Synaptics TouchPad as /class/input/input4
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 364k freed
ACPI: Expecting a [Reference] package element, found type 14
ACPI: Expecting a [Reference] package element, found type 14
ACPI: LNXTHERM:01 is registered as thermal_zone0
ACPI: Thermal Zone [TZ1] (67 C)
ACPI: Expecting a [Reference] package element, found type 14
ACPI: LNXTHERM:02 is registered as thermal_zone1
ACPI: Thermal Zone [TZ2] (54 C)
power_supply C1BD: uevent
power_supply C1BD: No power supply yet
power_supply C1BD: power_supply_changed
power_supply C1BD: power_supply_changed_work
power_supply C1BD: power_supply_update_gen_leds 1
power_supply C1BD: uevent
power_supply C1BD: POWER_SUPPLY_NAME=C1BD
power_supply C1BD: Static prop TYPE=Mains
power_supply C1BD: 1 dynamic props
power_supply C1BD: prop ONLINE=1
ACPI: AC Adapter [C1BD] (on-line)
ACPI: Expecting a [Reference] package element, found type 14
ACPI: LNXTHERM:03 is registered as thermal_zone2
ACPI: Thermal Zone [TZ3] (29 C)
input: Video Bus as /class/input/input5
ACPI: Video Device [C076] (multi-head: yes  rom: no  post: no)
ACPI: PNP0C0B:00 is registered as cooling_device2
ACPI: Fan [C34F] (off)
ACPI: PNP0C0B:01 is registered as cooling_device3
ACPI: Fan [C350] (off)
ACPI: PNP0C0B:02 is registered as cooling_device4
ACPI: Fan [C351] (off)
ACPI: PNP0C0B:03 is registered as cooling_device5
ACPI: Fan [C352] (off)
power_supply C1BF: uevent
power_supply C1BF: No power supply yet
power_supply C1BF: power_supply_changed
power_supply C1BF: power_supply_changed_work
Yenta: CardBus bridge found at 0000:02:04.0 [103c:30b0]
Yenta: Enabling burst memory read transactions
Yenta: Using INTVAL to route CSC interrupts to PCI
Yenta: Routing CardBus interrupts to PCI
Yenta TI: socket 0000:02:04.0, mfunc 0x01a11002, devctl 0x64
ACPI: Battery Slot [C1BF] (battery present)
ACPI: WMI: Mapper loaded
power_supply C1BF: power_supply_update_bat_leds 4
power_supply C1BF: uevent
power_supply C1BF: POWER_SUPPLY_NAME=C1BF
power_supply C1BF: Static prop TYPE=Battery
power_supply C1BF: 12 dynamic props
power_supply C1BF: prop STATUS=Full
power_supply C1BF: prop PRESENT=1
power_supply C1BF: prop TECHNOLOGY=Li-ion
power_supply C1BF: prop VOLTAGE_MIN_DESIGN=10800000
power_supply C1BF: prop VOLTAGE_NOW=12616000
power_supply C1BF: prop CURRENT_NOW=0
power_supply C1BF: prop CHARGE_FULL_DESIGN=4679000
power_supply C1BF: prop CHARGE_FULL=4679000
power_supply C1BF: prop CHARGE_NOW=4679000
power_supply C1BF: prop MODEL_NAME=Primary
power_supply C1BF: prop MANUFACTURER=Hewlett-Packard
power_supply C1BF: prop SERIAL_NUMBER=39279 2006/08/07
ACPI: Battery Slot [C1BE] (battery absent)
ACPI: PCI Interrupt 0000:00:14.2[A] -> GSI 16 (level, low) -> IRQ 16
Yenta: ISA IRQ mask 0x0ef8, PCI irq 20
Socket status: 30000006
Yenta: Raising subordinate bus# of parent bus (#02) from #03 to #06
pcmcia: parent PCI bridge I/O window: 0x1000 - 0x1fff
pcmcia: parent PCI bridge Memory window: 0xd0000000 - 0xd02fffff
pcmcia: parent PCI bridge Memory window: 0x30000000 - 0x33ffffff
EXT3 FS on sda3, internal journal
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
Adding 2096472k swap on /dev/sda2.  Priority:-1 extents:1 across:2096472k
warning: process `kudzu' used the deprecated sysctl system call with 1.23.
powernow-k8: Found 1 AMD Turion(tm) 64 X2 Mobile Technology TL-50 processors (2 cpu cores) (version 2.20.00)
powernow-k8:    0 : fid 0x8 (1600 MHz), vid 0x13
powernow-k8:    1 : fid 0x0 (800 MHz), vid 0x1e
Clocksource tsc unstable (delta = -249928054 ns)
tg3: eth1: Link is up at 1000 Mbps, full duplex.
tg3: eth1: Flow control is on for TX and on for RX.
warning: `dbus-daemon' uses 32-bit capabilities (legacy support in use)
ACPI: PCI Interrupt 0000:01:05.0[A] -> GSI 17 (level, low) -> IRQ 17
slab error in verify_redzone_free(): cache `size-1024': memory outside object was overwritten
Pid: 96, comm: kacpi_notify Not tainted 2.6.25-rc9-00073-g8b56e6a #33

Call Trace:
 [<ffffffff8027f57b>] __slab_error+0x24/0x26
 [<ffffffff8027fb72>] cache_free_debugcheck+0x136/0x207
 [<ffffffff8037f2bc>] ? acpi_ev_asynch_enable_gpe+0x2b/0x2f
 [<ffffffff80281afb>] kfree+0x9c/0x216
 [<ffffffff80375e86>] ? acpi_os_execute_deferred+0x0/0x39
 [<ffffffff8037f2bc>] acpi_ev_asynch_enable_gpe+0x2b/0x2f
 [<ffffffff80375eb2>] acpi_os_execute_deferred+0x2c/0x39
 [<ffffffff8023f480>] run_workqueue+0x7d/0x106
 [<ffffffff8023fe41>] worker_thread+0xd8/0xe5
 [<ffffffff80242913>] ? autoremove_wake_function+0x0/0x38
 [<ffffffff8023fd69>] ? worker_thread+0x0/0xe5
 [<ffffffff802427d4>] kthread+0x49/0x79
 [<ffffffff8020bef8>] child_rip+0xa/0x12
 [<ffffffff8024278b>] ? kthread+0x0/0x79
 [<ffffffff8020beee>] ? child_rip+0x0/0x12

ffff81001b028e70: redzone 1:0x800, redzone 2:0x5a5a5a5a5a5a5a5a.
------------[ cut here ]------------
kernel BUG at mm/slab.c:2906!
invalid opcode: 0000 [1] SMP 
CPU 0 
Modules linked in: powernow_k8 pcmcia snd_hda_intel snd_seq_device snd_pcm_oss snd_mixer_oss snd_pcm snd_timer yenta_socket rsrc_nonstatic snd_page_alloc wmi battery fan video backlight ac thermal
Pid: 96, comm: kacpi_notify Not tainted 2.6.25-rc9-00073-g8b56e6a #33
RIP: 0010:[<ffffffff8027fc0c>]  [<ffffffff8027fc0c>] cache_free_debugcheck+0x1d0/0x207
RSP: 0018:ffff81001b037df0  EFLAGS: 00010016
RAX: ffff81001b028d98 RBX: ffff81001b804ac0 RCX: ffff81001b028150
RDX: 0000000000000003 RSI: ffff81001b028e70 RDI: ffff81001b804ac0
RBP: ffff81001b037e20 R08: 09f911029d74e35b R09: 00000000ffffff20
R10: 0000000000000010 R11: 0000000000000000 R12: 0000000000000800
R13: ffff81001b028e70 R14: 5a5a5a5a5a5a5a5a R15: ffff81001b028100
FS:  00000000409b4950(0000) GS:ffffffff80786000(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 00000030ed8c6d80 CR3: 0000000019c38000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process kacpi_notify (pid: 96, threadinfo ffff81001b036000, task ffff81001bb06740)
Stack:  ffffffff8037f2bc ffff81001b80b5e8 ffff81001b804ac0 ffff81001b028e78
 ffffffff807f3bc0 0000000000000282 ffff81001b037e70 ffffffff80281afb
 ffffffff807f3bc0 0000000000008025 ffff81001b028e78 ffff81001b028e78
Call Trace:
 [<ffffffff8037f2bc>] ? acpi_ev_asynch_enable_gpe+0x2b/0x2f
 [<ffffffff80281afb>] kfree+0x9c/0x216
 [<ffffffff80375e86>] ? acpi_os_execute_deferred+0x0/0x39
 [<ffffffff8037f2bc>] acpi_ev_asynch_enable_gpe+0x2b/0x2f
 [<ffffffff80375eb2>] acpi_os_execute_deferred+0x2c/0x39
 [<ffffffff8023f480>] run_workqueue+0x7d/0x106
 [<ffffffff8023fe41>] worker_thread+0xd8/0xe5
 [<ffffffff80242913>] ? autoremove_wake_function+0x0/0x38
 [<ffffffff8023fd69>] ? worker_thread+0x0/0xe5
 [<ffffffff802427d4>] kthread+0x49/0x79
 [<ffffffff8020bef8>] child_rip+0xa/0x12
 [<ffffffff8024278b>] ? kthread+0x0/0x79
 [<ffffffff8020beee>] ? child_rip+0x0/0x12


Code: 29 c8 48 0f af c2 48 89 c2 48 c1 ea 20 3b 93 18 01 00 00 72 04 0f 0b eb fe 89 d0 0f af 83 0c 01 00 00 48 8d 04 01 49 39 c5 74 04 <0f> 0b eb fe 89 d0 41 c7 44 87 30 fe ff ff ff f6 83 15 01 00 00 
RIP  [<ffffffff8027fc0c>] cache_free_debugcheck+0x1d0/0x207
 RSP <ffff81001b037df0>
---[ end trace b34da6ee0b4cc39e ]---

^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: ACPICA branch - first try Core revision 20080321
  2008-04-12  4:41 ` ACPICA branch - first try Core revision 20080321 Len Brown
@ 2008-04-12 20:46   ` Alexey Starikovskiy
  2008-04-15  7:51     ` Len Brown
  0 siblings, 1 reply; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-04-12 20:46 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Moore, Robert, Alexey Starikovskiy

Len Brown wrote:
> The acpica branch is based on 2.6.25-rc9.
> Below is a dmesg diff of an HP nx6325 booting that baseline
> vs. booting the acpica branch.
>
> Two things jump out:
>
> 1. ACPI: Expecting a [Reference] package element, found type 14
>
>   
Add this to #67
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 44ea60c..1009261 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -398,7 +398,7 @@ acpi_evaluate_reference(acpi_handle handle,
 
         element = &(package->package.elements[i]);
 
-        if (element->type != ACPI_TYPE_ANY) {
+        if (element->type != ACPI_TYPE_LOCAL_REFERENCE) {
             status = AE_BAD_DATA;
             printk(KERN_ERR PREFIX
                     "Expecting a [Reference] package element, found 
type %X\n",

> 2. memory coorruption:
>
> slab error in verify_redzone_free(): cache `size-1024': memory outside object was overwritten
>
>   
drop #60
> -Len
>
>   
Regards,
Alex.


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-12  4:25   ` [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages Len Brown
@ 2008-04-15  7:09     ` Len Brown
  2008-04-15  8:36       ` Alexey Starikovskiy
  0 siblings, 1 reply; 123+ messages in thread
From: Len Brown @ 2008-04-15  7:09 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy

From: Len Brown <len.brown@intel.com>

drivers/acpi/dispatcher/dsobject.c:499: warning: format ‘%X’ expects type ‘unsigned int’, but argument 4 has type ‘acpi_native_uint’
drivers/acpi/dispatcher/dsobject.c:507: warning: format ‘%X’ expects type ‘unsigned int’, but argument 7 has type ‘acpi_native_uint’

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/dispatcher/dsobject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
index 5184278..bdef2f0 100644
--- a/drivers/acpi/dispatcher/dsobject.c
+++ b/drivers/acpi/dispatcher/dsobject.c
@@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 	union acpi_parse_object *parent;
 	union acpi_operand_object *obj_desc = NULL;
 	acpi_status status = AE_OK;
-	acpi_native_uint i;
+	u32 i;
 	u16 index;
 	u16 reference_count;
 
-- 
1.5.5.49.gf43e2

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 123+ messages in thread

* Re: ACPICA branch - first try Core revision 20080321
  2008-04-12 20:46   ` Alexey Starikovskiy
@ 2008-04-15  7:51     ` Len Brown
  0 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-15  7:51 UTC (permalink / raw)
  To: Alexey Starikovskiy, Lin, Ming M
  Cc: linux-acpi, Moore, Robert, Alexey Starikovskiy

On Saturday 12 April 2008, Alexey Starikovskiy wrote:
> Len Brown wrote:
> > The acpica branch is based on 2.6.25-rc9.
> > Below is a dmesg diff of an HP nx6325 booting that baseline
> > vs. booting the acpica branch.
> >
> > Two things jump out:
> >
> > 1. ACPI: Expecting a [Reference] package element, found type 14
> >
> >   
> Add this to #67
> diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
> index 44ea60c..1009261 100644
> --- a/drivers/acpi/utils.c
> +++ b/drivers/acpi/utils.c
> @@ -398,7 +398,7 @@ acpi_evaluate_reference(acpi_handle handle,
>  
>          element = &(package->package.elements[i]);
>  
> -        if (element->type != ACPI_TYPE_ANY) {
> +        if (element->type != ACPI_TYPE_LOCAL_REFERENCE) {
>              status = AE_BAD_DATA;
>              printk(KERN_ERR PREFIX
>                      "Expecting a [Reference] package element, found 
> type %X\n",
> 
> > 2. memory coorruption:
> >
> > slab error in verify_redzone_free(): cache `size-1024': memory outside object was overwritten
> >
> >   
> drop #60


done, and the nx6325 now looks happy, so I've updated
the acpica branch and pulled it into the test branch.

but expanding testing to the t61, the latest ACPICA gives me these:


> ACPI Exception (scan-0716): AE_BAD_DATA, Extracting _PRW package [20080321]
> ACPI Exception (scan-0716): AE_BAD_DATA, Extracting _PRW package [20080321]
> ACPI Exception (scan-0716): AE_BAD_DATA, Extracting _PRW package [20080321]
> ACPI Exception (scan-0716): AE_BAD_DATA, Extracting _PRW package [20080321]
> ACPI Exception (scan-0716): AE_BAD_DATA, Extracting _PRW package [20080321]

^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15  7:09     ` Len Brown
@ 2008-04-15  8:36       ` Alexey Starikovskiy
  2008-04-15 18:46         ` Moore, Robert
  2008-04-22 19:23         ` Len Brown
  0 siblings, 2 replies; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-04-15  8:36 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Bob Moore, Alexey Starikovskiy

Len Brown wrote:
> From: Len Brown <len.brown@intel.com>
>
> drivers/acpi/dispatcher/dsobject.c:499: warning: format ‘%X’ expects type ‘unsigned int’, but argument 4 has type ‘acpi_native_uint’
> drivers/acpi/dispatcher/dsobject.c:507: warning: format ‘%X’ expects type ‘unsigned int’, but argument 7 has type ‘acpi_native_uint’
>
> Signed-off-by: Len Brown <len.brown@intel.com>
> ---
>  drivers/acpi/dispatcher/dsobject.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
> index 5184278..bdef2f0 100644
> --- a/drivers/acpi/dispatcher/dsobject.c
> +++ b/drivers/acpi/dispatcher/dsobject.c
> @@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
>  	union acpi_parse_object *parent;
>  	union acpi_operand_object *obj_desc = NULL;
>  	acpi_status status = AE_OK;
> -	acpi_native_uint i;
> +	u32 i;
>   
why not just unsigned ?
>  	u16 index;
>  	u16 reference_count;
>  
>   

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15  8:36       ` Alexey Starikovskiy
@ 2008-04-15 18:46         ` Moore, Robert
  2008-04-15 18:56           ` Alexey Starikovskiy
  2008-04-22 19:23         ` Len Brown
  1 sibling, 1 reply; 123+ messages in thread
From: Moore, Robert @ 2008-04-15 18:46 UTC (permalink / raw)
  To: Alexey Starikovskiy, Len Brown; +Cc: linux-acpi, Alexey Starikovskiy

We use acpi_native_uint for things like array indexes so it goes 32/64
without warnings (lint or otherwise).

However,
typedef UINT32                          ACPI_NATIVE_UINT;

should get converted to 
typedef u32                             acpi_native_uint;

during the linuxiztion, I think

>-----Original Message-----
>From: Alexey Starikovskiy [mailto:aystarik@gmail.com]
>Sent: Tuesday, April 15, 2008 1:36 AM
>To: Len Brown
>Cc: linux-acpi@vger.kernel.org; Moore, Robert; Alexey Starikovskiy
>Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for
>packages
>
>Len Brown wrote:
>> From: Len Brown <len.brown@intel.com>
>>
>> drivers/acpi/dispatcher/dsobject.c:499: warning: format '%X' expects
type
>'unsigned int', but argument 4 has type 'acpi_native_uint'
>> drivers/acpi/dispatcher/dsobject.c:507: warning: format '%X' expects
type
>'unsigned int', but argument 7 has type 'acpi_native_uint'
>>
>> Signed-off-by: Len Brown <len.brown@intel.com>
>> ---
>>  drivers/acpi/dispatcher/dsobject.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/acpi/dispatcher/dsobject.c
>b/drivers/acpi/dispatcher/dsobject.c
>> index 5184278..bdef2f0 100644
>> --- a/drivers/acpi/dispatcher/dsobject.c
>> +++ b/drivers/acpi/dispatcher/dsobject.c
>> @@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct
>acpi_walk_state *walk_state,
>>  	union acpi_parse_object *parent;
>>  	union acpi_operand_object *obj_desc = NULL;
>>  	acpi_status status = AE_OK;
>> -	acpi_native_uint i;
>> +	u32 i;
>>
>why not just unsigned ?
>>  	u16 index;
>>  	u16 reference_count;
>>
>>


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 18:46         ` Moore, Robert
@ 2008-04-15 18:56           ` Alexey Starikovskiy
  2008-04-15 20:19             ` Moore, Robert
  0 siblings, 1 reply; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-04-15 18:56 UTC (permalink / raw)
  To: Moore, Robert; +Cc: Alexey Starikovskiy, Len Brown, linux-acpi

Moore, Robert wrote:
> We use acpi_native_uint for things like array indexes so it goes 32/64
> without warnings (lint or otherwise).
> 
> However,
> typedef UINT32                          ACPI_NATIVE_UINT;
> 
> should get converted to 
> typedef u32                             acpi_native_uint;
Well, "unsigned int" is supposed to be of native length. u32 is not going to be of
native length on 64 bits. 
What kind of warning do you avoid?
I don't know any checker who does not accept int/unsigned int as array index...

Regards,
Alex.


> 
> during the linuxiztion, I think
> 
>> -----Original Message-----
>> From: Alexey Starikovskiy [mailto:aystarik@gmail.com]
>> Sent: Tuesday, April 15, 2008 1:36 AM
>> To: Len Brown
>> Cc: linux-acpi@vger.kernel.org; Moore, Robert; Alexey Starikovskiy
>> Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for
>> packages
>>
>> Len Brown wrote:
>>> From: Len Brown <len.brown@intel.com>
>>>
>>> drivers/acpi/dispatcher/dsobject.c:499: warning: format '%X' expects
> type
>> 'unsigned int', but argument 4 has type 'acpi_native_uint'
>>> drivers/acpi/dispatcher/dsobject.c:507: warning: format '%X' expects
> type
>> 'unsigned int', but argument 7 has type 'acpi_native_uint'
>>> Signed-off-by: Len Brown <len.brown@intel.com>
>>> ---
>>>  drivers/acpi/dispatcher/dsobject.c |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/acpi/dispatcher/dsobject.c
>> b/drivers/acpi/dispatcher/dsobject.c
>>> index 5184278..bdef2f0 100644
>>> --- a/drivers/acpi/dispatcher/dsobject.c
>>> +++ b/drivers/acpi/dispatcher/dsobject.c
>>> @@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct
>> acpi_walk_state *walk_state,
>>>  	union acpi_parse_object *parent;
>>>  	union acpi_operand_object *obj_desc = NULL;
>>>  	acpi_status status = AE_OK;
>>> -	acpi_native_uint i;
>>> +	u32 i;
>>>
>> why not just unsigned ?
>>>  	u16 index;
>>>  	u16 reference_count;
>>>
>>>
> 


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 18:56           ` Alexey Starikovskiy
@ 2008-04-15 20:19             ` Moore, Robert
  2008-04-15 20:39               ` Alexey Starikovskiy
  0 siblings, 1 reply; 123+ messages in thread
From: Moore, Robert @ 2008-04-15 20:19 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: Alexey Starikovskiy, Len Brown, linux-acpi

I think one of the reasons we introduced ACPI_NATIVE_UINT is that "int"
is in fact not "native" under all compilation models.

Here is the table from actypes.h

 * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
 * char      8    8     8     8     8    8
 * short     16   16    16    16    16   16
 * _int32         32
 * int       32   64    32    32    16   16
 * long      64   64    32    32    32   32
 * long long            64    64
 * pointer   64   64    64    32    32   32




>-----Original Message-----
>From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
>Sent: Tuesday, April 15, 2008 11:57 AM
>To: Moore, Robert
>Cc: Alexey Starikovskiy; Len Brown; linux-acpi@vger.kernel.org
>Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for
>packages
>
>Moore, Robert wrote:
>> We use acpi_native_uint for things like array indexes so it goes
32/64
>> without warnings (lint or otherwise).
>>
>> However,
>> typedef UINT32                          ACPI_NATIVE_UINT;
>>
>> should get converted to
>> typedef u32                             acpi_native_uint;
>Well, "unsigned int" is supposed to be of native length. u32 is not
going
>to be of
>native length on 64 bits.
>What kind of warning do you avoid?
>I don't know any checker who does not accept int/unsigned int as array
>index...
>
>Regards,
>Alex.
>
>
>>
>> during the linuxiztion, I think
>>
>>> -----Original Message-----
>>> From: Alexey Starikovskiy [mailto:aystarik@gmail.com]
>>> Sent: Tuesday, April 15, 2008 1:36 AM
>>> To: Len Brown
>>> Cc: linux-acpi@vger.kernel.org; Moore, Robert; Alexey Starikovskiy
>>> Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message
for
>>> packages
>>>
>>> Len Brown wrote:
>>>> From: Len Brown <len.brown@intel.com>
>>>>
>>>> drivers/acpi/dispatcher/dsobject.c:499: warning: format '%X'
expects
>> type
>>> 'unsigned int', but argument 4 has type 'acpi_native_uint'
>>>> drivers/acpi/dispatcher/dsobject.c:507: warning: format '%X'
expects
>> type
>>> 'unsigned int', but argument 7 has type 'acpi_native_uint'
>>>> Signed-off-by: Len Brown <len.brown@intel.com>
>>>> ---
>>>>  drivers/acpi/dispatcher/dsobject.c |    2 +-
>>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/drivers/acpi/dispatcher/dsobject.c
>>> b/drivers/acpi/dispatcher/dsobject.c
>>>> index 5184278..bdef2f0 100644
>>>> --- a/drivers/acpi/dispatcher/dsobject.c
>>>> +++ b/drivers/acpi/dispatcher/dsobject.c
>>>> @@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct
>>> acpi_walk_state *walk_state,
>>>>  	union acpi_parse_object *parent;
>>>>  	union acpi_operand_object *obj_desc = NULL;
>>>>  	acpi_status status = AE_OK;
>>>> -	acpi_native_uint i;
>>>> +	u32 i;
>>>>
>>> why not just unsigned ?
>>>>  	u16 index;
>>>>  	u16 reference_count;
>>>>
>>>>
>>


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 20:19             ` Moore, Robert
@ 2008-04-15 20:39               ` Alexey Starikovskiy
  2008-04-15 21:01                 ` Moore, Robert
  2008-04-15 21:56                 ` Tomas Carnecky
  0 siblings, 2 replies; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-04-15 20:39 UTC (permalink / raw)
  To: Moore, Robert; +Cc: Alexey Starikovskiy, Len Brown, linux-acpi

Moore, Robert wrote:
> I think one of the reasons we introduced ACPI_NATIVE_UINT is that "int"
> is in fact not "native" under all compilation models.
>
> Here is the table from actypes.h
>
>  * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
>  * char      8    8     8     8     8    8
>  * short     16   16    16    16    16   16
>  * _int32         32
>  * int       32   64    32    32    16   16
>  * long      64   64    32    32    32   32
>  * long long            64    64
>  * pointer   64   64    64    32    32   32
>
>   
Sorry, what do you mean by "not native" ?
sizeof(int) != sizeof(void *)  or something else?
How does it change applicability as array index?


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 20:39               ` Alexey Starikovskiy
@ 2008-04-15 21:01                 ` Moore, Robert
  2008-04-15 21:12                   ` Alexey Starikovskiy
  2008-04-15 21:56                 ` Tomas Carnecky
  1 sibling, 1 reply; 123+ messages in thread
From: Moore, Robert @ 2008-04-15 21:01 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: Alexey Starikovskiy, Len Brown, linux-acpi

Native word size of the machine.

As I remember, lint especially really likes array indexes that use the
word size of the machine, and of course it is the most efficient
usually. However, there is no C data type that represents the native
word size across all compilation models.


>-----Original Message-----
>From: Alexey Starikovskiy [mailto:aystarik@gmail.com]
>Sent: Tuesday, April 15, 2008 1:40 PM
>To: Moore, Robert
>Cc: Alexey Starikovskiy; Len Brown; linux-acpi@vger.kernel.org
>Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for
>packages
>
>Moore, Robert wrote:
>> I think one of the reasons we introduced ACPI_NATIVE_UINT is that
"int"
>> is in fact not "native" under all compilation models.
>>
>> Here is the table from actypes.h
>>
>>  * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
>>  * char      8    8     8     8     8    8
>>  * short     16   16    16    16    16   16
>>  * _int32         32
>>  * int       32   64    32    32    16   16
>>  * long      64   64    32    32    32   32
>>  * long long            64    64
>>  * pointer   64   64    64    32    32   32
>>
>>
>Sorry, what do you mean by "not native" ?
>sizeof(int) != sizeof(void *)  or something else?
>How does it change applicability as array index?


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 21:01                 ` Moore, Robert
@ 2008-04-15 21:12                   ` Alexey Starikovskiy
  2008-04-15 21:29                     ` Moore, Robert
  0 siblings, 1 reply; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-04-15 21:12 UTC (permalink / raw)
  To: Moore, Robert; +Cc: Alexey Starikovskiy, Len Brown, linux-acpi

Moore, Robert wrote:
> Native word size of the machine.
> 
> As I remember, lint especially really likes array indexes that use the
> word size of the machine, and of course it is the most efficient
> usually. However, there is no C data type that represents the native
> word size across all compilation models.
and native word size being sizeof(void *)?

Let's look on that from the other perspective. int is intended by C authors
as least expensive to use integer type. long is intended to be least expensive
integer type of maximum capacity. Both types play nice with printf() and Co.

Now we introduce new typedef to annoy printf(), C, and Linux bosses only to
please lint?

Regards,
Alex.
> 
> 
>> -----Original Message-----
>> From: Alexey Starikovskiy [mailto:aystarik@gmail.com]
>> Sent: Tuesday, April 15, 2008 1:40 PM
>> To: Moore, Robert
>> Cc: Alexey Starikovskiy; Len Brown; linux-acpi@vger.kernel.org
>> Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for
>> packages
>>
>> Moore, Robert wrote:
>>> I think one of the reasons we introduced ACPI_NATIVE_UINT is that
> "int"
>>> is in fact not "native" under all compilation models.
>>>
>>> Here is the table from actypes.h
>>>
>>>  * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
>>>  * char      8    8     8     8     8    8
>>>  * short     16   16    16    16    16   16
>>>  * _int32         32
>>>  * int       32   64    32    32    16   16
>>>  * long      64   64    32    32    32   32
>>>  * long long            64    64
>>>  * pointer   64   64    64    32    32   32
>>>
>>>
>> Sorry, what do you mean by "not native" ?
>> sizeof(int) != sizeof(void *)  or something else?
>> How does it change applicability as array index?
> 


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 21:12                   ` Alexey Starikovskiy
@ 2008-04-15 21:29                     ` Moore, Robert
  2008-04-15 21:51                       ` Alexey Starikovskiy
  2008-04-15 22:02                       ` Tomas Carnecky
  0 siblings, 2 replies; 123+ messages in thread
From: Moore, Robert @ 2008-04-15 21:29 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: Alexey Starikovskiy, Len Brown, linux-acpi

Well, yes native word size being the pointer size, now that the 16-bit
model is out of the picture.

We defined ACPI_NATIVE_UINT in order to have an integer data type that
is 32 bits in 32-bit mode, and 64 bits in 64-bit mode (and originally,
16 bits in 16-bit mode). There is no corresponding C type that can
accomplish this across all compilation models.

Yes, ACPI_NATIVE_UINT has issues with printf because there is
unfortunately no printf formatting operator other than %p that goes 32
bits in 32-bit mode and 64 bits in 64-bit mode. I think there may be
cases in ACPICA where we just cast an ACPI_NATIVE_UINT to a pointer to
use it with printf.


>-----Original Message-----
>From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
>Sent: Tuesday, April 15, 2008 2:12 PM
>To: Moore, Robert
>Cc: Alexey Starikovskiy; Len Brown; linux-acpi@vger.kernel.org
>Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for
>packages
>
>Moore, Robert wrote:
>> Native word size of the machine.
>>
>> As I remember, lint especially really likes array indexes that use
the
>> word size of the machine, and of course it is the most efficient
>> usually. However, there is no C data type that represents the native
>> word size across all compilation models.
>and native word size being sizeof(void *)?
>
>Let's look on that from the other perspective. int is intended by C
authors
>as least expensive to use integer type. long is intended to be least
>expensive
>integer type of maximum capacity. Both types play nice with printf()
and
>Co.
>
>Now we introduce new typedef to annoy printf(), C, and Linux bosses
only to
>please lint?
>
>Regards,
>Alex.
>>
>>
>>> -----Original Message-----
>>> From: Alexey Starikovskiy [mailto:aystarik@gmail.com]
>>> Sent: Tuesday, April 15, 2008 1:40 PM
>>> To: Moore, Robert
>>> Cc: Alexey Starikovskiy; Len Brown; linux-acpi@vger.kernel.org
>>> Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message
for
>>> packages
>>>
>>> Moore, Robert wrote:
>>>> I think one of the reasons we introduced ACPI_NATIVE_UINT is that
>> "int"
>>>> is in fact not "native" under all compilation models.
>>>>
>>>> Here is the table from actypes.h
>>>>
>>>>  * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
>>>>  * char      8    8     8     8     8    8
>>>>  * short     16   16    16    16    16   16
>>>>  * _int32         32
>>>>  * int       32   64    32    32    16   16
>>>>  * long      64   64    32    32    32   32
>>>>  * long long            64    64
>>>>  * pointer   64   64    64    32    32   32
>>>>
>>>>
>>> Sorry, what do you mean by "not native" ?
>>> sizeof(int) != sizeof(void *)  or something else?
>>> How does it change applicability as array index?
>>


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 21:29                     ` Moore, Robert
@ 2008-04-15 21:51                       ` Alexey Starikovskiy
  2008-04-15 22:27                         ` Moore, Robert
  2008-04-15 22:02                       ` Tomas Carnecky
  1 sibling, 1 reply; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-04-15 21:51 UTC (permalink / raw)
  To: Moore, Robert; +Cc: Alexey Starikovskiy, Len Brown, linux-acpi

Moore, Robert wrote:
> Well, yes native word size being the pointer size, now that the 16-bit
> model is out of the picture.
> 
> We defined ACPI_NATIVE_UINT in order to have an integer data type that
> is 32 bits in 32-bit mode, and 64 bits in 64-bit mode (and originally,
> 16 bits in 16-bit mode). There is no corresponding C type that can
> accomplish this across all compilation models.
> 
> Yes, ACPI_NATIVE_UINT has issues with printf because there is
> unfortunately no printf formatting operator other than %p that goes 32
> bits in 32-bit mode and 64 bits in 64-bit mode. I think there may be
> cases in ACPICA where we just cast an ACPI_NATIVE_UINT to a pointer to
> use it with printf.
Ok, let it be obscure type with such properties.
Now back to original patch, where we change from "acpi_native_uint i;" to
"uint32 i;" Both types are not supported by printf(), while the reason of 
the patch to gain such support. There is no expectation that i will need to
be 32 bits long to not roll over, let along 64 bit.
So, once again, why we used acpi_native_uint there and why we changed that 
to uint32 and not unsigned?

Regards,
Alex.


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 21:56                 ` Tomas Carnecky
@ 2008-04-15 21:55                   ` Alexey Starikovskiy
  0 siblings, 0 replies; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-04-15 21:55 UTC (permalink / raw)
  To: Tomas Carnecky; +Cc: Alexey Starikovskiy, Moore, Robert, Len Brown, linux-acpi

Tomas Carnecky wrote:
> Alexey Starikovskiy wrote:
>> Moore, Robert wrote:
>>> I think one of the reasons we introduced ACPI_NATIVE_UINT is that "int"
>>> is in fact not "native" under all compilation models.
>>>
>>> Here is the table from actypes.h
>>>
>>>  * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
>>>  * char      8    8     8     8     8    8
>>>  * short     16   16    16    16    16   16
>>>  * _int32         32
>>>  * int       32   64    32    32    16   16
>>>  * long      64   64    32    32    32   32
>>>  * long long            64    64
>>>  * pointer   64   64    64    32    32   32
>>>
>>>   
>> Sorry, what do you mean by "not native" ?
>> sizeof(int) != sizeof(void *)  or something else?
> 
> On Linux that is not true!
What is not true? Meaning of "native" in our not-so-private discussion?
> From wikipedia on '64-bit':
> Many 64-bit compilers today use the LP64 model (including Solaris, AIX, 
> HP, Linux, Mac OS X, and IBM z/OS native compilers). Microsoft's VC++ 
> compiler uses the LLP64 model.
> 
> So on Linux: sizeof(long) == sizeof(void *), that's why the kernel uses 
> 'long' all over the place instead of 'int'.
These are well known facts, we were struggling through term definitions.

Regards,
Alex.

^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 20:39               ` Alexey Starikovskiy
  2008-04-15 21:01                 ` Moore, Robert
@ 2008-04-15 21:56                 ` Tomas Carnecky
  2008-04-15 21:55                   ` Alexey Starikovskiy
  1 sibling, 1 reply; 123+ messages in thread
From: Tomas Carnecky @ 2008-04-15 21:56 UTC (permalink / raw)
  To: Alexey Starikovskiy
  Cc: Moore, Robert, Alexey Starikovskiy, Len Brown, linux-acpi

Alexey Starikovskiy wrote:
> Moore, Robert wrote:
>> I think one of the reasons we introduced ACPI_NATIVE_UINT is that "int"
>> is in fact not "native" under all compilation models.
>>
>> Here is the table from actypes.h
>>
>>  * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
>>  * char      8    8     8     8     8    8
>>  * short     16   16    16    16    16   16
>>  * _int32         32
>>  * int       32   64    32    32    16   16
>>  * long      64   64    32    32    32   32
>>  * long long            64    64
>>  * pointer   64   64    64    32    32   32
>>
>>   
> Sorry, what do you mean by "not native" ?
> sizeof(int) != sizeof(void *)  or something else?

On Linux that is not true! From wikipedia on '64-bit':
Many 64-bit compilers today use the LP64 model (including Solaris, AIX, 
HP, Linux, Mac OS X, and IBM z/OS native compilers). Microsoft's VC++ 
compiler uses the LLP64 model.

So on Linux: sizeof(long) == sizeof(void *), that's why the kernel uses 
'long' all over the place instead of 'int'.

tom


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 22:02                       ` Tomas Carnecky
@ 2008-04-15 21:57                         ` Alexey Starikovskiy
  2008-04-15 22:20                           ` Moore, Robert
  0 siblings, 1 reply; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-04-15 21:57 UTC (permalink / raw)
  To: Tomas Carnecky; +Cc: Moore, Robert, Alexey Starikovskiy, Len Brown, linux-acpi

Tomas Carnecky wrote:
> Moore, Robert wrote:
>> Yes, ACPI_NATIVE_UINT has issues with printf because there is
>> unfortunately no printf formatting operator other than %p that goes 32
>> bits in 32-bit mode and 64 bits in 64-bit mode. I think there may be
>> cases in ACPICA where we just cast an ACPI_NATIVE_UINT to a pointer to
>> use it with printf.
> 
> What's wrong with '%l'? The kernel printf seems to support it, and the 
> printf manpage says:
> 
> A following integer conversion corresponds to a long int or unsigned 
> long int argument.
> 
> And since long is 32bit on 32bit platforms and 64bit on 64bit platforms, 
> it should work out fine. Or did I miss something?
Yes. You missed the fact that long is not 64 bit on Windows 64, and ACPICA appears to
care about that.

Regards,
Alex.

^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 21:29                     ` Moore, Robert
  2008-04-15 21:51                       ` Alexey Starikovskiy
@ 2008-04-15 22:02                       ` Tomas Carnecky
  2008-04-15 21:57                         ` Alexey Starikovskiy
  1 sibling, 1 reply; 123+ messages in thread
From: Tomas Carnecky @ 2008-04-15 22:02 UTC (permalink / raw)
  To: Moore, Robert
  Cc: Alexey Starikovskiy, Alexey Starikovskiy, Len Brown, linux-acpi

Moore, Robert wrote:
> Yes, ACPI_NATIVE_UINT has issues with printf because there is
> unfortunately no printf formatting operator other than %p that goes 32
> bits in 32-bit mode and 64 bits in 64-bit mode. I think there may be
> cases in ACPICA where we just cast an ACPI_NATIVE_UINT to a pointer to
> use it with printf.

What's wrong with '%l'? The kernel printf seems to support it, and the 
printf manpage says:

A following integer conversion corresponds to a long int or unsigned 
long int argument.

And since long is 32bit on 32bit platforms and 64bit on 64bit platforms, 
it should work out fine. Or did I miss something?

tom

^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 21:57                         ` Alexey Starikovskiy
@ 2008-04-15 22:20                           ` Moore, Robert
  0 siblings, 0 replies; 123+ messages in thread
From: Moore, Robert @ 2008-04-15 22:20 UTC (permalink / raw)
  To: Alexey Starikovskiy, Tomas Carnecky
  Cc: Alexey Starikovskiy, Len Brown, linux-acpi

We probably need to differentiate between "ACPICA" and "ACPICA on Linux"

ACPICA needs to be highly portable, across different C compilers,
machine architectures, and operating systems.

To the matter at hand, it is of course nice to have an integer data type
that is the same as the native bit width of the machine/mode. This is
the same definition as the "size_t" type, is it not?

"long" is not 64-bit under LLP64, which ACPICA claims to support.

>-----Original Message-----
>From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
>Sent: Tuesday, April 15, 2008 2:57 PM
>To: Tomas Carnecky
>Cc: Moore, Robert; Alexey Starikovskiy; Len Brown; linux-
>acpi@vger.kernel.org
>Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for
>packages
>
>Tomas Carnecky wrote:
>> Moore, Robert wrote:
>>> Yes, ACPI_NATIVE_UINT has issues with printf because there is
>>> unfortunately no printf formatting operator other than %p that goes
32
>>> bits in 32-bit mode and 64 bits in 64-bit mode. I think there may be
>>> cases in ACPICA where we just cast an ACPI_NATIVE_UINT to a pointer
to
>>> use it with printf.
>>
>> What's wrong with '%l'? The kernel printf seems to support it, and
the
>> printf manpage says:
>>
>> A following integer conversion corresponds to a long int or unsigned
>> long int argument.
>>
>> And since long is 32bit on 32bit platforms and 64bit on 64bit
platforms,
>> it should work out fine. Or did I miss something?
>Yes. You missed the fact that long is not 64 bit on Windows 64, and
ACPICA
>appears to
>care about that.
>
>Regards,
>Alex.

^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15 21:51                       ` Alexey Starikovskiy
@ 2008-04-15 22:27                         ` Moore, Robert
  0 siblings, 0 replies; 123+ messages in thread
From: Moore, Robert @ 2008-04-15 22:27 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: Alexey Starikovskiy, Len Brown, linux-acpi

>So, once again, why we used acpi_native_uint there and why we changed
that
>to uint32 and not unsigned?

I think the use of ACPI_NATIVE_UINT was already there. The printf
statement is new, that's why the problem shows up now.

>-----Original Message-----
>From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
>Sent: Tuesday, April 15, 2008 2:51 PM
>To: Moore, Robert
>Cc: Alexey Starikovskiy; Len Brown; linux-acpi@vger.kernel.org
>Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for
>packages
>
>Moore, Robert wrote:
>> Well, yes native word size being the pointer size, now that the
16-bit
>> model is out of the picture.
>>
>> We defined ACPI_NATIVE_UINT in order to have an integer data type
that
>> is 32 bits in 32-bit mode, and 64 bits in 64-bit mode (and
originally,
>> 16 bits in 16-bit mode). There is no corresponding C type that can
>> accomplish this across all compilation models.
>>
>> Yes, ACPI_NATIVE_UINT has issues with printf because there is
>> unfortunately no printf formatting operator other than %p that goes
32
>> bits in 32-bit mode and 64 bits in 64-bit mode. I think there may be
>> cases in ACPICA where we just cast an ACPI_NATIVE_UINT to a pointer
to
>> use it with printf.
>Ok, let it be obscure type with such properties.
>Now back to original patch, where we change from "acpi_native_uint i;"
to
>"uint32 i;" Both types are not supported by printf(), while the reason
of
>the patch to gain such support. There is no expectation that i will
need to
>be 32 bits long to not roll over, let along 64 bit.
>So, once again, why we used acpi_native_uint there and why we changed
that
>to uint32 and not unsigned?
>
>Regards,
>Alex.


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 46/73] ACPICA: Fixed a couple memory leaks associated with "implicit return" objects when the AML Interpreter slack mode is enabled
  2008-04-12  4:25   ` [PATCH 46/73] ACPICA: Fixed a couple memory leaks associated with "implicit return" objects when the AML Interpreter slack mode is enabled Len Brown
@ 2008-04-22 18:24     ` Len Brown
  0 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-22 18:24 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy

Bob reports that this one breaks implicit return,
so I'm dropping it.

thanks,
-Len

On Saturday 12 April 2008, Len Brown wrote:
> From: Bob Moore <robert.moore@intel.com>
> 
> Lin Ming BZ 349
> 
> Signed-off-by: Bob Moore <robert.moore@intel.com>
> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> Signed-off-by: Len Brown <len.brown@intel.com>
> ---
>  drivers/acpi/dispatcher/dsmethod.c |    3 +++
>  drivers/acpi/dispatcher/dsmthdat.c |    2 ++
>  2 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
> index 7a99740..9e24641 100644
> --- a/drivers/acpi/dispatcher/dsmethod.c
> +++ b/drivers/acpi/dispatcher/dsmethod.c
> @@ -103,6 +103,9 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
>  						    NULL);
>  		acpi_ex_enter_interpreter();
>  	}
> +
> +	acpi_ds_clear_implicit_return(walk_state);
> +
>  #ifdef ACPI_DISASSEMBLER
>  	if (ACPI_FAILURE(status)) {
>  
> diff --git a/drivers/acpi/dispatcher/dsmthdat.c b/drivers/acpi/dispatcher/dsmthdat.c
> index ba4626e..38510d1 100644
> --- a/drivers/acpi/dispatcher/dsmthdat.c
> +++ b/drivers/acpi/dispatcher/dsmthdat.c
> @@ -172,6 +172,8 @@ void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state)
>  		}
>  	}
>  
> +	acpi_ds_clear_implicit_return(walk_state);
> +
>  	return_VOID;
>  }
>  



^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-15  8:36       ` Alexey Starikovskiy
  2008-04-15 18:46         ` Moore, Robert
@ 2008-04-22 19:23         ` Len Brown
  2008-04-22 22:21           ` Moore, Robert
  1 sibling, 1 reply; 123+ messages in thread
From: Len Brown @ 2008-04-22 19:23 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: linux-acpi, Bob Moore, Alexey Starikovskiy

On Tuesday 15 April 2008, Alexey Starikovskiy wrote:
> Len Brown wrote:
> > From: Len Brown <len.brown@intel.com>
> >
> > drivers/acpi/dispatcher/dsobject.c:499: warning: format ‘%X’ expects type ‘unsigned int’, but argument 4 has type ‘acpi_native_uint’
> > drivers/acpi/dispatcher/dsobject.c:507: warning: format ‘%X’ expects type ‘unsigned int’, but argument 7 has type ‘acpi_native_uint’
> >
> > Signed-off-by: Len Brown <len.brown@intel.com>
> > ---
> >  drivers/acpi/dispatcher/dsobject.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c
> > index 5184278..bdef2f0 100644
> > --- a/drivers/acpi/dispatcher/dsobject.c
> > +++ b/drivers/acpi/dispatcher/dsobject.c
> > @@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
> >  	union acpi_parse_object *parent;
> >  	union acpi_operand_object *obj_desc = NULL;
> >  	acpi_status status = AE_OK;
> > -	acpi_native_uint i;
> > +	u32 i;
> >   
> why not just unsigned ?

> >  	u16 index;
> >  	u16 reference_count;

No particular reason, u32 and unsigned are synonyms on the architectures we care about.
Now that you point it out, i prefer unsigned, and will go with that.

This is used as an index into the arrary of elements in a package, so 8-bits
would probably work just as well.  Certainly acpi_native_uint was overkill.

-Len
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-22 19:23         ` Len Brown
@ 2008-04-22 22:21           ` Moore, Robert
  2008-04-22 23:22             ` Len Brown
  0 siblings, 1 reply; 123+ messages in thread
From: Moore, Robert @ 2008-04-22 22:21 UTC (permalink / raw)
  To: Len Brown, Alexey Starikovskiy; +Cc: linux-acpi, Alexey Starikovskiy

>would probably work just as well.  Certainly acpi_native_uint was
overkill.

I disagree. Often more efficient to use machine native word rather than
fooling around with a byte load/clear and store


>-----Original Message-----
>From: Len Brown [mailto:lenb@kernel.org]
>Sent: Tuesday, April 22, 2008 12:23 PM
>To: Alexey Starikovskiy
>Cc: linux-acpi@vger.kernel.org; Moore, Robert; Alexey Starikovskiy
>Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for
>packages
>
>On Tuesday 15 April 2008, Alexey Starikovskiy wrote:
>> Len Brown wrote:
>> > From: Len Brown <len.brown@intel.com>
>> >
>> > drivers/acpi/dispatcher/dsobject.c:499: warning: format '%X'
expects
>type 'unsigned int', but argument 4 has type 'acpi_native_uint'
>> > drivers/acpi/dispatcher/dsobject.c:507: warning: format '%X'
expects
>type 'unsigned int', but argument 7 has type 'acpi_native_uint'
>> >
>> > Signed-off-by: Len Brown <len.brown@intel.com>
>> > ---
>> >  drivers/acpi/dispatcher/dsobject.c |    2 +-
>> >  1 files changed, 1 insertions(+), 1 deletions(-)
>> >
>> > diff --git a/drivers/acpi/dispatcher/dsobject.c
>b/drivers/acpi/dispatcher/dsobject.c
>> > index 5184278..bdef2f0 100644
>> > --- a/drivers/acpi/dispatcher/dsobject.c
>> > +++ b/drivers/acpi/dispatcher/dsobject.c
>> > @@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct
>acpi_walk_state *walk_state,
>> >  	union acpi_parse_object *parent;
>> >  	union acpi_operand_object *obj_desc = NULL;
>> >  	acpi_status status = AE_OK;
>> > -	acpi_native_uint i;
>> > +	u32 i;
>> >
>> why not just unsigned ?
>
>> >  	u16 index;
>> >  	u16 reference_count;
>
>No particular reason, u32 and unsigned are synonyms on the
architectures we
>care about.
>Now that you point it out, i prefer unsigned, and will go with that.
>
>This is used as an index into the arrary of elements in a package, so
8-
>bits
>would probably work just as well.  Certainly acpi_native_uint was
overkill.
>
>-Len

^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 67/73] ACPICA: Fixes for external Reference Objects
  2008-04-12  4:25   ` [PATCH 67/73] ACPICA: Fixes for external Reference Objects Len Brown
@ 2008-04-22 23:15     ` Len Brown
  0 siblings, 0 replies; 123+ messages in thread
From: Len Brown @ 2008-04-22 23:15 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Lin Ming

commit cd0b2248241f4146152fb04a6bf4bccb6ce0478a
Author: Bob Moore <robert.moore@intel.com>
Date:   Thu Apr 10 19:06:43 2008 +0400

ACPICA: Fixes for external Reference Objects
    
All Reference Objects returned via the AcpiEvaluteObject interface
are now marked as type "REFERENCE" instead of "ANY". The type ANY
is now reservered for NULL objects - either NULL package elements
or unresolved named references.
    
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

---
updated patch:
utils.c update from Alexey Starikovskiy
scan.c update from Lin Ming:

 scan.c             |    3 +--
 utilities/utcopy.c |   32 ++++++++++++++++++++++++--------
 utils.c            |    2 +-
 3 files changed, 26 insertions(+), 11 deletions(-)


diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index e6ce262..464ee6e 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -677,9 +677,8 @@ acpi_bus_extract_wakeup_device_power_package(struct acpi_device *device,
 	device->wakeup.resources.count = package->package.count - 2;
 	for (i = 0; i < device->wakeup.resources.count; i++) {
 		element = &(package->package.elements[i + 2]);
-		if (element->type != ACPI_TYPE_ANY) {
+		if (element->type != ACPI_TYPE_LOCAL_REFERENCE)
 			return AE_BAD_DATA;
-		}
 
 		device->wakeup.resources.handles[i] = element->reference.handle;
 	}
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 4e9a62b..2a57c2c 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -43,6 +43,8 @@
 
 #include <acpi/acpi.h>
 #include <acpi/amlcode.h>
+#include <acpi/acnamesp.h>
+
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utcopy")
@@ -172,22 +174,21 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object,
 
 	case ACPI_TYPE_LOCAL_REFERENCE:
 
-		/*
-		 * This is an object reference.  Attempt to dereference it.
-		 */
+		/* This is an object reference. */
+
 		switch (internal_object->reference.opcode) {
 		case AML_INT_NAMEPATH_OP:
 
 			/* For namepath, return the object handle ("reference") */
 
 		default:
-			/*
-			 * Use the object type of "Any" to indicate a reference
-			 * to object containing a handle to an ACPI named object.
-			 */
-			external_object->type = ACPI_TYPE_ANY;
+
+			/* We are referring to the namespace node */
+
 			external_object->reference.handle =
 			    internal_object->reference.node;
+			external_object->reference.actual_type =
+			    acpi_ns_get_type(internal_object->reference.node);
 			break;
 		}
 		break;
@@ -460,6 +461,7 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
 	case ACPI_TYPE_STRING:
 	case ACPI_TYPE_BUFFER:
 	case ACPI_TYPE_INTEGER:
+	case ACPI_TYPE_LOCAL_REFERENCE:
 
 		internal_object = acpi_ut_create_internal_object((u8)
 								 external_object->
@@ -469,6 +471,11 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
 		}
 		break;
 
+	case ACPI_TYPE_ANY:	/* This is the case for a NULL object */
+
+		*ret_internal_object = NULL;
+		return_ACPI_STATUS(AE_OK);
+
 	default:
 		/* All other types are not supported */
 
@@ -522,6 +529,15 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
 		internal_object->integer.value = external_object->integer.value;
 		break;
 
+	case ACPI_TYPE_LOCAL_REFERENCE:
+
+		/* TBD: should validate incoming handle */
+
+		internal_object->reference.opcode = AML_INT_NAMEPATH_OP;
+		internal_object->reference.node =
+		    external_object->reference.handle;
+		break;
+
 	default:
 		/* Other types can't get here */
 		break;
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 44ea60c..1009261 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -398,7 +398,7 @@ acpi_evaluate_reference(acpi_handle handle,
 
 		element = &(package->package.elements[i]);
 
-		if (element->type != ACPI_TYPE_ANY) {
+		if (element->type != ACPI_TYPE_LOCAL_REFERENCE) {
 			status = AE_BAD_DATA;
 			printk(KERN_ERR PREFIX
 				    "Expecting a [Reference] package element, found type %X\n",

^ permalink raw reply related	[flat|nested] 123+ messages in thread

* Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-22 22:21           ` Moore, Robert
@ 2008-04-22 23:22             ` Len Brown
  2008-04-23  1:00               ` Moore, Robert
  0 siblings, 1 reply; 123+ messages in thread
From: Len Brown @ 2008-04-22 23:22 UTC (permalink / raw)
  To: Moore, Robert; +Cc: Alexey Starikovskiy, linux-acpi

On Tuesday 22 April 2008, Moore, Robert wrote:
> >would probably work just as well.  Certainly acpi_native_uint was
> overkill.
> 
> I disagree. Often more efficient to use machine native word rather than
> fooling around with a byte load/clear and store

perhaps you mis-read my message.
I went with "unsigned", which is 32-bits on both 32 and 64 bit x86.

I shouldn't have mentioned that a byte was sufficient --
my point was simply that it is darn unlikely that we'd overflow
a capacity of 2^8.  There is zero chance we'd overflow 2^32;
and thus no practical utility for 2^64 index capacitiy.

I don't think that using a 32-bit index is a performance penalty
on the hardware we care about.  I also don't think that performance
is important here.

-Len


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages
  2008-04-22 23:22             ` Len Brown
@ 2008-04-23  1:00               ` Moore, Robert
  0 siblings, 0 replies; 123+ messages in thread
From: Moore, Robert @ 2008-04-23  1:00 UTC (permalink / raw)
  To: Len Brown; +Cc: Alexey Starikovskiy, linux-acpi

Right, there is no concern about overflow.

I believe that using a native word is usually more efficient in terms of
both performance and code size. As long as the variable is on the stack,
it is using up a machine-word-sized stack slot anyway.


-----Original Message-----
From: Len Brown [mailto:lenb@kernel.org] 
Sent: Tuesday, April 22, 2008 4:23 PM
To: Moore, Robert
Cc: Alexey Starikovskiy; linux-acpi@vger.kernel.org
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for
packages

On Tuesday 22 April 2008, Moore, Robert wrote:
> >would probably work just as well.  Certainly acpi_native_uint was
> overkill.
> 
> I disagree. Often more efficient to use machine native word rather
than
> fooling around with a byte load/clear and store

perhaps you mis-read my message.
I went with "unsigned", which is 32-bits on both 32 and 64 bit x86.

I shouldn't have mentioned that a byte was sufficient --
my point was simply that it is darn unlikely that we'd overflow
a capacity of 2^8.  There is zero chance we'd overflow 2^32;
and thus no practical utility for 2^64 index capacitiy.

I don't think that using a 32-bit index is a performance penalty
on the hardware we care about.  I also don't think that performance
is important here.

-Len


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-12  4:25   ` [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs Len Brown
@ 2008-04-23  2:57     ` Len Brown
  2008-04-23  5:28       ` Alexey Starikovskiy
  0 siblings, 1 reply; 123+ messages in thread
From: Len Brown @ 2008-04-23  2:57 UTC (permalink / raw)
  To: linux-acpi; +Cc: Bob Moore, Alexey Starikovskiy, Zhang Rui

On Saturday 12 April 2008, Len Brown wrote:
> From: Bob Moore <robert.moore@intel.com>
> 
> Implemented another change to eliminate/suppress spurious or
> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
> that are neither enabled nor disabled -- meaning that the GPE is
> unknown to the system. This will prevent future interrupts from
> that GPE. (Zhang Rui) BZ 6217
> 
> Signed-off-by: Bob Moore <robert.moore@intel.com>
> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> Signed-off-by: Len Brown <len.brown@intel.com>
> ---
>  drivers/acpi/events/evgpe.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
> index 897baed..6940f5d 100644
> --- a/drivers/acpi/events/evgpe.c
> +++ b/drivers/acpi/events/evgpe.c
> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
>  
>  	ACPI_FUNCTION_TRACE(ev_disable_gpe);
>  
> -	if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
> +	/*
> +	 * Ignore this if the GPE is valid and not enabled.
> +	 *
> +	 * Flags is only zero if GPE is neither enabled or disabled -- it may
> +	 * be a spurious or stray GPE -- disable it in the default case below.
> +	 */
> +	if (gpe_event_info->flags &&
> +	    (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
>  		return_ACPI_STATUS(AE_OK);
>  	}
>  


When applied to 2.6.25, the patch above causes ACPI Error messages below on my T61.
Certainly this is a case of the EC getting an interrupt (GPE x02) before it has initialized.

Perhaps it breaks the call of acpi_install_gpe_handler() to acpi_ev_disable_gpe()?

-Len


 PCI: Using MMCONFIG at f0000000 - f3ffffff
 PCI: Using configuration type 1
 evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE] 4 regs on int 0x9
+ACPI Error (evregion-0316): No handler for Region [ECOR] (ffff81007d35dda0) [EmbeddedControl] [20070126]
+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no handler [20070126]
+ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0), AE_NOT_EXIST
+ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48), AE_NOT_EXIST
+ACPI Error (psparse-0537): Method parse/execution failed [\_GPE._L02] (Node ffff81007d376420), AE_NOT_EXIST
+ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE method [_L02] [20070126]
 evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled 3 Runtime GPEs in this block
 ACPI: EC: EC description table is found, configuring boot EC
-ACPI: EC: non-query interrupt received, switching to interrupt mode
-Completing Region/Field/Buffer/Package initialization:........................................................................................................................
......................................................................................................................................................................
-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72 Packages (1888 nodes)
+Completing Region/Field/Buffer/Package initialization:........................................................................................................................
.......................................................................................................................................................................
+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72 Packages (1888 nodes)
 Initializing Device/Processor/Thermal objects by executing _INI methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
+ACPI: EC: non-query interrupt received, switching to interrupt mode
 .......
 Executed 8 _INI methods requiring 2 _STA executions (examined 88 objects)
 ACPI: Interpreter enabled

^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-23  2:57     ` Len Brown
@ 2008-04-23  5:28       ` Alexey Starikovskiy
  2008-04-23 20:35         ` Moore, Robert
  0 siblings, 1 reply; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-04-23  5:28 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Bob Moore, Zhang Rui

Len Brown wrote:
> On Saturday 12 April 2008, Len Brown wrote:
>> From: Bob Moore <robert.moore@intel.com>
>>
>> Implemented another change to eliminate/suppress spurious or
>> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
>> that are neither enabled nor disabled -- meaning that the GPE is
>> unknown to the system. This will prevent future interrupts from
>> that GPE. (Zhang Rui) BZ 6217
>>
>> Signed-off-by: Bob Moore <robert.moore@intel.com>
>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
>> Signed-off-by: Len Brown <len.brown@intel.com>
>> ---
>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
>>  1 files changed, 8 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
>> index 897baed..6940f5d 100644
>> --- a/drivers/acpi/events/evgpe.c
>> +++ b/drivers/acpi/events/evgpe.c
>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
>>  
>>  	ACPI_FUNCTION_TRACE(ev_disable_gpe);
>>  
>> -	if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
>> +	/*
>> +	 * Ignore this if the GPE is valid and not enabled.
>> +	 *
>> +	 * Flags is only zero if GPE is neither enabled or disabled -- it may
>> +	 * be a spurious or stray GPE -- disable it in the default case below.
>> +	 */
>> +	if (gpe_event_info->flags &&
>> +	    (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
>>  		return_ACPI_STATUS(AE_OK);
>>  	}
>>  
> 
> 
> When applied to 2.6.25, the patch above causes ACPI Error messages below on my T61.
> Certainly this is a case of the EC getting an interrupt (GPE x02) before it has initialized.
> 
> Perhaps it breaks the call of acpi_install_gpe_handler() to acpi_ev_disable_gpe()?
Congratulations, now you too hit this one, patch is already there...
It is wroong to enable GPE before handler for it is installed...
http://bugzilla.kernel.org/show_bug.cgi?id=9916

> 
> -Len
> 
> 
>  PCI: Using MMCONFIG at f0000000 - f3ffffff
>  PCI: Using configuration type 1
>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE] 4 regs on int 0x9
> +ACPI Error (evregion-0316): No handler for Region [ECOR] (ffff81007d35dda0) [EmbeddedControl] [20070126]
> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no handler [20070126]
> +ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0), AE_NOT_EXIST
> +ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48), AE_NOT_EXIST
> +ACPI Error (psparse-0537): Method parse/execution failed [\_GPE._L02] (Node ffff81007d376420), AE_NOT_EXIST
> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE method [_L02] [20070126]
>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled 3 Runtime GPEs in this block
>  ACPI: EC: EC description table is found, configuring boot EC
> -ACPI: EC: non-query interrupt received, switching to interrupt mode
> -Completing Region/Field/Buffer/Package initialization:........................................................................................................................
> ......................................................................................................................................................................
> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72 Packages (1888 nodes)
> +Completing Region/Field/Buffer/Package initialization:........................................................................................................................
> .......................................................................................................................................................................
> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72 Packages (1888 nodes)
>  Initializing Device/Processor/Thermal objects by executing _INI methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
> +ACPI: EC: non-query interrupt received, switching to interrupt mode
>  .......
>  Executed 8 _INI methods requiring 2 _STA executions (examined 88 objects)
>  ACPI: Interpreter enabled


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-23  5:28       ` Alexey Starikovskiy
@ 2008-04-23 20:35         ` Moore, Robert
  2008-04-25  1:40           ` Len Brown
  0 siblings, 1 reply; 123+ messages in thread
From: Moore, Robert @ 2008-04-23 20:35 UTC (permalink / raw)
  To: Alexey Starikovskiy, Len Brown; +Cc: linux-acpi, Zhang, Rui

Alexey,

I remember there was some discussion on this, but I'm still not sure why
the patch for 6217 (Ignore GPE if valid and not enabled) makes the other
problem (too early enabling of GPEs) apparent. Please explain.

Thanks,
Bob


>-----Original Message-----
>From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
>Sent: Tuesday, April 22, 2008 10:29 PM
>To: Len Brown
>Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
>Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
>
>Len Brown wrote:
>> On Saturday 12 April 2008, Len Brown wrote:
>>> From: Bob Moore <robert.moore@intel.com>
>>>
>>> Implemented another change to eliminate/suppress spurious or
>>> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
>>> that are neither enabled nor disabled -- meaning that the GPE is
>>> unknown to the system. This will prevent future interrupts from
>>> that GPE. (Zhang Rui) BZ 6217
>>>
>>> Signed-off-by: Bob Moore <robert.moore@intel.com>
>>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
>>> Signed-off-by: Len Brown <len.brown@intel.com>
>>> ---
>>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
>>>  1 files changed, 8 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/acpi/events/evgpe.c
b/drivers/acpi/events/evgpe.c
>>> index 897baed..6940f5d 100644
>>> --- a/drivers/acpi/events/evgpe.c
>>> +++ b/drivers/acpi/events/evgpe.c
>>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
>acpi_gpe_event_info *gpe_event_info)
>>>
>>>  	ACPI_FUNCTION_TRACE(ev_disable_gpe);
>>>
>>> -	if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
>>> +	/*
>>> +	 * Ignore this if the GPE is valid and not enabled.
>>> +	 *
>>> +	 * Flags is only zero if GPE is neither enabled or disabled --
it may
>>> +	 * be a spurious or stray GPE -- disable it in the default case
>below.
>>> +	 */
>>> +	if (gpe_event_info->flags &&
>>> +	    (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
>>>  		return_ACPI_STATUS(AE_OK);
>>>  	}
>>>
>>
>>
>> When applied to 2.6.25, the patch above causes ACPI Error messages
below
>on my T61.
>> Certainly this is a case of the EC getting an interrupt (GPE x02)
before
>it has initialized.
>>
>> Perhaps it breaks the call of acpi_install_gpe_handler() to
>acpi_ev_disable_gpe()?
>Congratulations, now you too hit this one, patch is already there...
>It is wroong to enable GPE before handler for it is installed...
>http://bugzilla.kernel.org/show_bug.cgi?id=9916
>
>>
>> -Len
>>
>>
>>  PCI: Using MMCONFIG at f0000000 - f3ffffff
>>  PCI: Using configuration type 1
>>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE] 4
regs on
>int 0x9
>> +ACPI Error (evregion-0316): No handler for Region [ECOR]
>(ffff81007d35dda0) [EmbeddedControl] [20070126]
>> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no handler
>[20070126]
>> +ACPI Error (psparse-0537): Method parse/execution failed
>[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0), AE_NOT_EXIST
>> +ACPI Error (psparse-0537): Method parse/execution failed
>[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48), AE_NOT_EXIST
>> +ACPI Error (psparse-0537): Method parse/execution failed
[\_GPE._L02]
>(Node ffff81007d376420), AE_NOT_EXIST
>> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE
method
>[_L02] [20070126]
>>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled 3
>Runtime GPEs in this block
>>  ACPI: EC: EC description table is found, configuring boot EC
>> -ACPI: EC: non-query interrupt received, switching to interrupt mode
>> -Completing Region/Field/Buffer/Package
>initialization:........................................................
....
>............................................................
>>
>.......................................................................
....
>.......................................................................
....
>................
>> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
>(1888 nodes)
>> +Completing Region/Field/Buffer/Package
>initialization:........................................................
....
>............................................................
>>
>.......................................................................
....
>.......................................................................
....
>.................
>> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
Packages
>(1888 nodes)
>>  Initializing Device/Processor/Thermal objects by executing _INI
>methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
>> +ACPI: EC: non-query interrupt received, switching to interrupt mode
>>  .......
>>  Executed 8 _INI methods requiring 2 _STA executions (examined 88
>objects)
>>  ACPI: Interpreter enabled


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-23 20:35         ` Moore, Robert
@ 2008-04-25  1:40           ` Len Brown
  2008-04-25  1:53             ` Zhang Rui
  0 siblings, 1 reply; 123+ messages in thread
From: Len Brown @ 2008-04-25  1:40 UTC (permalink / raw)
  To: Moore, Robert; +Cc: Alexey Starikovskiy, linux-acpi, Zhang, Rui

oh goody, i thought this one rang a bell...

I'll apply 6217 on top of 9916 (which was already in the test tree,
but not on the acpica branch)

the error goes away with both applied.

thanks,
-Len

On Wednesday 23 April 2008, Moore, Robert wrote:
> Alexey,
> 
> I remember there was some discussion on this, but I'm still not sure why
> the patch for 6217 (Ignore GPE if valid and not enabled) makes the other
> problem (too early enabling of GPEs) apparent. Please explain.
> 
> Thanks,
> Bob
> 
> 
> >-----Original Message-----
> >From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
> >Sent: Tuesday, April 22, 2008 10:29 PM
> >To: Len Brown
> >Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
> >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
> >
> >Len Brown wrote:
> >> On Saturday 12 April 2008, Len Brown wrote:
> >>> From: Bob Moore <robert.moore@intel.com>
> >>>
> >>> Implemented another change to eliminate/suppress spurious or
> >>> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
> >>> that are neither enabled nor disabled -- meaning that the GPE is
> >>> unknown to the system. This will prevent future interrupts from
> >>> that GPE. (Zhang Rui) BZ 6217
> >>>
> >>> Signed-off-by: Bob Moore <robert.moore@intel.com>
> >>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> >>> Signed-off-by: Len Brown <len.brown@intel.com>
> >>> ---
> >>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
> >>>  1 files changed, 8 insertions(+), 1 deletions(-)
> >>>
> >>> diff --git a/drivers/acpi/events/evgpe.c
> b/drivers/acpi/events/evgpe.c
> >>> index 897baed..6940f5d 100644
> >>> --- a/drivers/acpi/events/evgpe.c
> >>> +++ b/drivers/acpi/events/evgpe.c
> >>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
> >acpi_gpe_event_info *gpe_event_info)
> >>>
> >>>  	ACPI_FUNCTION_TRACE(ev_disable_gpe);
> >>>
> >>> -	if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
> >>> +	/*
> >>> +	 * Ignore this if the GPE is valid and not enabled.
> >>> +	 *
> >>> +	 * Flags is only zero if GPE is neither enabled or disabled --
> it may
> >>> +	 * be a spurious or stray GPE -- disable it in the default case
> >below.
> >>> +	 */
> >>> +	if (gpe_event_info->flags &&
> >>> +	    (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
> >>>  		return_ACPI_STATUS(AE_OK);
> >>>  	}
> >>>
> >>
> >>
> >> When applied to 2.6.25, the patch above causes ACPI Error messages
> below
> >on my T61.
> >> Certainly this is a case of the EC getting an interrupt (GPE x02)
> before
> >it has initialized.
> >>
> >> Perhaps it breaks the call of acpi_install_gpe_handler() to
> >acpi_ev_disable_gpe()?
> >Congratulations, now you too hit this one, patch is already there...
> >It is wroong to enable GPE before handler for it is installed...
> >http://bugzilla.kernel.org/show_bug.cgi?id=9916
> >
> >>
> >> -Len
> >>
> >>
> >>  PCI: Using MMCONFIG at f0000000 - f3ffffff
> >>  PCI: Using configuration type 1
> >>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE] 4
> regs on
> >int 0x9
> >> +ACPI Error (evregion-0316): No handler for Region [ECOR]
> >(ffff81007d35dda0) [EmbeddedControl] [20070126]
> >> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no handler
> >[20070126]
> >> +ACPI Error (psparse-0537): Method parse/execution failed
> >[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0), AE_NOT_EXIST
> >> +ACPI Error (psparse-0537): Method parse/execution failed
> >[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48), AE_NOT_EXIST
> >> +ACPI Error (psparse-0537): Method parse/execution failed
> [\_GPE._L02]
> >(Node ffff81007d376420), AE_NOT_EXIST
> >> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE
> method
> >[_L02] [20070126]
> >>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled 3
> >Runtime GPEs in this block
> >>  ACPI: EC: EC description table is found, configuring boot EC
> >> -ACPI: EC: non-query interrupt received, switching to interrupt mode
> >> -Completing Region/Field/Buffer/Package
> >initialization:........................................................
> ....
> >............................................................
> >>
> >.......................................................................
> ....
> >.......................................................................
> ....
> >................
> >> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
> Packages
> >(1888 nodes)
> >> +Completing Region/Field/Buffer/Package
> >initialization:........................................................
> ....
> >............................................................
> >>
> >.......................................................................
> ....
> >.......................................................................
> ....
> >.................
> >> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
> Packages
> >(1888 nodes)
> >>  Initializing Device/Processor/Thermal objects by executing _INI
> >methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
> >> +ACPI: EC: non-query interrupt received, switching to interrupt mode
> >>  .......
> >>  Executed 8 _INI methods requiring 2 _STA executions (examined 88
> >objects)
> >>  ACPI: Interpreter enabled
> 
> 



^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-25  1:40           ` Len Brown
@ 2008-04-25  1:53             ` Zhang Rui
  2008-04-25  1:57               ` Moore, Robert
  0 siblings, 1 reply; 123+ messages in thread
From: Zhang Rui @ 2008-04-25  1:53 UTC (permalink / raw)
  To: Len Brown; +Cc: Moore, Robert, Alexey Starikovskiy, linux-acpi


On Fri, 2008-04-25 at 09:40 +0800, Len Brown wrote:
> oh goody, i thought this one rang a bell...
> 
> I'll apply 6217 on top of 9916 (which was already in the test tree,
> but not on the acpica branch)
> 
> the error goes away with both applied.

I still don't see why the error messages pop up if 6217 is applied.
IMO, 6217 won't enable the EC GPE. :(

thanks,
rui

> On Wednesday 23 April 2008, Moore, Robert wrote:
> > Alexey,
> >
> > I remember there was some discussion on this, but I'm still not sure
> why
> > the patch for 6217 (Ignore GPE if valid and not enabled) makes the
> other
> > problem (too early enabling of GPEs) apparent. Please explain.
> >
> > Thanks,
> > Bob
> >
> >
> > >-----Original Message-----
> > >From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
> > >Sent: Tuesday, April 22, 2008 10:29 PM
> > >To: Len Brown
> > >Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
> > >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
> GPEs
> > >
> > >Len Brown wrote:
> > >> On Saturday 12 April 2008, Len Brown wrote:
> > >>> From: Bob Moore <robert.moore@intel.com>
> > >>>
> > >>> Implemented another change to eliminate/suppress spurious or
> > >>> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
> > >>> that are neither enabled nor disabled -- meaning that the GPE is
> > >>> unknown to the system. This will prevent future interrupts from
> > >>> that GPE. (Zhang Rui) BZ 6217
> > >>>
> > >>> Signed-off-by: Bob Moore <robert.moore@intel.com>
> > >>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> > >>> Signed-off-by: Len Brown <len.brown@intel.com>
> > >>> ---
> > >>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
> > >>>  1 files changed, 8 insertions(+), 1 deletions(-)
> > >>>
> > >>> diff --git a/drivers/acpi/events/evgpe.c
> > b/drivers/acpi/events/evgpe.c
> > >>> index 897baed..6940f5d 100644
> > >>> --- a/drivers/acpi/events/evgpe.c
> > >>> +++ b/drivers/acpi/events/evgpe.c
> > >>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
> > >acpi_gpe_event_info *gpe_event_info)
> > >>>
> > >>>   ACPI_FUNCTION_TRACE(ev_disable_gpe);
> > >>>
> > >>> - if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
> > >>> + /*
> > >>> +  * Ignore this if the GPE is valid and not enabled.
> > >>> +  *
> > >>> +  * Flags is only zero if GPE is neither enabled or disabled --
> > it may
> > >>> +  * be a spurious or stray GPE -- disable it in the default
> case
> > >below.
> > >>> +  */
> > >>> + if (gpe_event_info->flags &&
> > >>> +     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
> > >>>           return_ACPI_STATUS(AE_OK);
> > >>>   }
> > >>>
> > >>
> > >>
> > >> When applied to 2.6.25, the patch above causes ACPI Error
> messages
> > below
> > >on my T61.
> > >> Certainly this is a case of the EC getting an interrupt (GPE x02)
> > before
> > >it has initialized.
> > >>
> > >> Perhaps it breaks the call of acpi_install_gpe_handler() to
> > >acpi_ev_disable_gpe()?
> > >Congratulations, now you too hit this one, patch is already
> there...
> > >It is wroong to enable GPE before handler for it is installed...
> > >http://bugzilla.kernel.org/show_bug.cgi?id=9916
> > >
> > >>
> > >> -Len
> > >>
> > >>
> > >>  PCI: Using MMCONFIG at f0000000 - f3ffffff
> > >>  PCI: Using configuration type 1
> > >>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE] 4
> > regs on
> > >int 0x9
> > >> +ACPI Error (evregion-0316): No handler for Region [ECOR]
> > >(ffff81007d35dda0) [EmbeddedControl] [20070126]
> > >> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
> handler
> > >[20070126]
> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> > >[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),
> AE_NOT_EXIST
> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> > >[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),
> AE_NOT_EXIST
> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> > [\_GPE._L02]
> > >(Node ffff81007d376420), AE_NOT_EXIST
> > >> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE
> > method
> > >[_L02] [20070126]
> > >>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled
> 3
> > >Runtime GPEs in this block
> > >>  ACPI: EC: EC description table is found, configuring boot EC
> > >> -ACPI: EC: non-query interrupt received, switching to interrupt
> mode
> > >> -Completing Region/Field/Buffer/Package
> >
> >initialization:........................................................
> > ....
> > >............................................................
> > >>
> >
> >.......................................................................
> > ....
> >
> >.......................................................................
> > ....
> > >................
> > >> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
> > Packages
> > >(1888 nodes)
> > >> +Completing Region/Field/Buffer/Package
> >
> >initialization:........................................................
> > ....
> > >............................................................
> > >>
> >
> >.......................................................................
> > ....
> >
> >.......................................................................
> > ....
> > >.................
> > >> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
> > Packages
> > >(1888 nodes)
> > >>  Initializing Device/Processor/Thermal objects by executing _INI
> > >methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
> > >> +ACPI: EC: non-query interrupt received, switching to interrupt
> mode
> > >>  .......
> > >>  Executed 8 _INI methods requiring 2 _STA executions (examined 88
> > >objects)
> > >>  ACPI: Interpreter enabled
> >
> >
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-25  1:53             ` Zhang Rui
@ 2008-04-25  1:57               ` Moore, Robert
  2008-04-25  2:10                 ` Alexey Starikovskiy
  2008-05-21  8:28                 ` Zhang, Rui
  0 siblings, 2 replies; 123+ messages in thread
From: Moore, Robert @ 2008-04-25  1:57 UTC (permalink / raw)
  To: Zhang, Rui, Len Brown; +Cc: Alexey Starikovskiy, linux-acpi

Yes, this is my question also.

I hope Alexey can help with this. I'm very nervous about any code that
works or does not work for reasons unknown. When this happens in the GPE
code, I get more than nervous.

Bob


-----Original Message-----
From: Zhang, Rui 
Sent: Thursday, April 24, 2008 6:53 PM
To: Len Brown
Cc: Moore, Robert; Alexey Starikovskiy; linux-acpi@vger.kernel.org
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs


On Fri, 2008-04-25 at 09:40 +0800, Len Brown wrote:
> oh goody, i thought this one rang a bell...
> 
> I'll apply 6217 on top of 9916 (which was already in the test tree,
> but not on the acpica branch)
> 
> the error goes away with both applied.

I still don't see why the error messages pop up if 6217 is applied.
IMO, 6217 won't enable the EC GPE. :(

thanks,
rui

> On Wednesday 23 April 2008, Moore, Robert wrote:
> > Alexey,
> >
> > I remember there was some discussion on this, but I'm still not sure
> why
> > the patch for 6217 (Ignore GPE if valid and not enabled) makes the
> other
> > problem (too early enabling of GPEs) apparent. Please explain.
> >
> > Thanks,
> > Bob
> >
> >
> > >-----Original Message-----
> > >From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
> > >Sent: Tuesday, April 22, 2008 10:29 PM
> > >To: Len Brown
> > >Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
> > >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
> GPEs
> > >
> > >Len Brown wrote:
> > >> On Saturday 12 April 2008, Len Brown wrote:
> > >>> From: Bob Moore <robert.moore@intel.com>
> > >>>
> > >>> Implemented another change to eliminate/suppress spurious or
> > >>> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
> > >>> that are neither enabled nor disabled -- meaning that the GPE is
> > >>> unknown to the system. This will prevent future interrupts from
> > >>> that GPE. (Zhang Rui) BZ 6217
> > >>>
> > >>> Signed-off-by: Bob Moore <robert.moore@intel.com>
> > >>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> > >>> Signed-off-by: Len Brown <len.brown@intel.com>
> > >>> ---
> > >>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
> > >>>  1 files changed, 8 insertions(+), 1 deletions(-)
> > >>>
> > >>> diff --git a/drivers/acpi/events/evgpe.c
> > b/drivers/acpi/events/evgpe.c
> > >>> index 897baed..6940f5d 100644
> > >>> --- a/drivers/acpi/events/evgpe.c
> > >>> +++ b/drivers/acpi/events/evgpe.c
> > >>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
> > >acpi_gpe_event_info *gpe_event_info)
> > >>>
> > >>>   ACPI_FUNCTION_TRACE(ev_disable_gpe);
> > >>>
> > >>> - if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
> > >>> + /*
> > >>> +  * Ignore this if the GPE is valid and not enabled.
> > >>> +  *
> > >>> +  * Flags is only zero if GPE is neither enabled or disabled --
> > it may
> > >>> +  * be a spurious or stray GPE -- disable it in the default
> case
> > >below.
> > >>> +  */
> > >>> + if (gpe_event_info->flags &&
> > >>> +     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
> > >>>           return_ACPI_STATUS(AE_OK);
> > >>>   }
> > >>>
> > >>
> > >>
> > >> When applied to 2.6.25, the patch above causes ACPI Error
> messages
> > below
> > >on my T61.
> > >> Certainly this is a case of the EC getting an interrupt (GPE x02)
> > before
> > >it has initialized.
> > >>
> > >> Perhaps it breaks the call of acpi_install_gpe_handler() to
> > >acpi_ev_disable_gpe()?
> > >Congratulations, now you too hit this one, patch is already
> there...
> > >It is wroong to enable GPE before handler for it is installed...
> > >http://bugzilla.kernel.org/show_bug.cgi?id=9916
> > >
> > >>
> > >> -Len
> > >>
> > >>
> > >>  PCI: Using MMCONFIG at f0000000 - f3ffffff
> > >>  PCI: Using configuration type 1
> > >>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE] 4
> > regs on
> > >int 0x9
> > >> +ACPI Error (evregion-0316): No handler for Region [ECOR]
> > >(ffff81007d35dda0) [EmbeddedControl] [20070126]
> > >> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
> handler
> > >[20070126]
> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> > >[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),
> AE_NOT_EXIST
> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> > >[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),
> AE_NOT_EXIST
> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> > [\_GPE._L02]
> > >(Node ffff81007d376420), AE_NOT_EXIST
> > >> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE
> > method
> > >[_L02] [20070126]
> > >>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled
> 3
> > >Runtime GPEs in this block
> > >>  ACPI: EC: EC description table is found, configuring boot EC
> > >> -ACPI: EC: non-query interrupt received, switching to interrupt
> mode
> > >> -Completing Region/Field/Buffer/Package
> >
>
>initialization:........................................................
> > ....
> > >............................................................
> > >>
> >
>
>.......................................................................
> > ....
> >
>
>.......................................................................
> > ....
> > >................
> > >> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
> > Packages
> > >(1888 nodes)
> > >> +Completing Region/Field/Buffer/Package
> >
>
>initialization:........................................................
> > ....
> > >............................................................
> > >>
> >
>
>.......................................................................
> > ....
> >
>
>.......................................................................
> > ....
> > >.................
> > >> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
> > Packages
> > >(1888 nodes)
> > >>  Initializing Device/Processor/Thermal objects by executing _INI
> > >methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
> > >> +ACPI: EC: non-query interrupt received, switching to interrupt
> mode
> > >>  .......
> > >>  Executed 8 _INI methods requiring 2 _STA executions (examined 88
> > >objects)
> > >>  ACPI: Interpreter enabled
> >
> >
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-25  1:57               ` Moore, Robert
@ 2008-04-25  2:10                 ` Alexey Starikovskiy
  2008-04-25  2:28                   ` Zhang Rui
  2008-05-21  8:28                 ` Zhang, Rui
  1 sibling, 1 reply; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-04-25  2:10 UTC (permalink / raw)
  To: Moore, Robert; +Cc: Zhang, Rui, Len Brown, linux-acpi

Actually, I too don't know why _disabling_ some GPE could trigger EC one...
May be Len could try to debug this issue, as he is the only one with hardware...
One thought is that EC GPE is not present in GPE scope, thus it will be not configured by the 
time 6217' code is executed. So, in theory, 6217 could try to disable EC GPE.

Regards,
Alex.


Moore, Robert wrote:
> Yes, this is my question also.
> 
> I hope Alexey can help with this. I'm very nervous about any code that
> works or does not work for reasons unknown. When this happens in the GPE
> code, I get more than nervous.
> 
> Bob
> 
> 
> -----Original Message-----
> From: Zhang, Rui 
> Sent: Thursday, April 24, 2008 6:53 PM
> To: Len Brown
> Cc: Moore, Robert; Alexey Starikovskiy; linux-acpi@vger.kernel.org
> Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
> 
> 
> On Fri, 2008-04-25 at 09:40 +0800, Len Brown wrote:
>> oh goody, i thought this one rang a bell...
>>
>> I'll apply 6217 on top of 9916 (which was already in the test tree,
>> but not on the acpica branch)
>>
>> the error goes away with both applied.
> 
> I still don't see why the error messages pop up if 6217 is applied.
> IMO, 6217 won't enable the EC GPE. :(
> 
> thanks,
> rui
> 
>> On Wednesday 23 April 2008, Moore, Robert wrote:
>>> Alexey,
>>>
>>> I remember there was some discussion on this, but I'm still not sure
>> why
>>> the patch for 6217 (Ignore GPE if valid and not enabled) makes the
>> other
>>> problem (too early enabling of GPEs) apparent. Please explain.
>>>
>>> Thanks,
>>> Bob
>>>
>>>
>>>> -----Original Message-----
>>>> From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
>>>> Sent: Tuesday, April 22, 2008 10:29 PM
>>>> To: Len Brown
>>>> Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
>>>> Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
>> GPEs
>>>> Len Brown wrote:
>>>>> On Saturday 12 April 2008, Len Brown wrote:
>>>>>> From: Bob Moore <robert.moore@intel.com>
>>>>>>
>>>>>> Implemented another change to eliminate/suppress spurious or
>>>>>> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
>>>>>> that are neither enabled nor disabled -- meaning that the GPE is
>>>>>> unknown to the system. This will prevent future interrupts from
>>>>>> that GPE. (Zhang Rui) BZ 6217
>>>>>>
>>>>>> Signed-off-by: Bob Moore <robert.moore@intel.com>
>>>>>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
>>>>>> Signed-off-by: Len Brown <len.brown@intel.com>
>>>>>> ---
>>>>>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
>>>>>>  1 files changed, 8 insertions(+), 1 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/acpi/events/evgpe.c
>>> b/drivers/acpi/events/evgpe.c
>>>>>> index 897baed..6940f5d 100644
>>>>>> --- a/drivers/acpi/events/evgpe.c
>>>>>> +++ b/drivers/acpi/events/evgpe.c
>>>>>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
>>>> acpi_gpe_event_info *gpe_event_info)
>>>>>>   ACPI_FUNCTION_TRACE(ev_disable_gpe);
>>>>>>
>>>>>> - if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
>>>>>> + /*
>>>>>> +  * Ignore this if the GPE is valid and not enabled.
>>>>>> +  *
>>>>>> +  * Flags is only zero if GPE is neither enabled or disabled --
>>> it may
>>>>>> +  * be a spurious or stray GPE -- disable it in the default
>> case
>>>> below.
>>>>>> +  */
>>>>>> + if (gpe_event_info->flags &&
>>>>>> +     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
>>>>>>           return_ACPI_STATUS(AE_OK);
>>>>>>   }
>>>>>>
>>>>>
>>>>> When applied to 2.6.25, the patch above causes ACPI Error
>> messages
>>> below
>>>> on my T61.
>>>>> Certainly this is a case of the EC getting an interrupt (GPE x02)
>>> before
>>>> it has initialized.
>>>>> Perhaps it breaks the call of acpi_install_gpe_handler() to
>>>> acpi_ev_disable_gpe()?
>>>> Congratulations, now you too hit this one, patch is already
>> there...
>>>> It is wroong to enable GPE before handler for it is installed...
>>>> http://bugzilla.kernel.org/show_bug.cgi?id=9916
>>>>
>>>>> -Len
>>>>>
>>>>>
>>>>>  PCI: Using MMCONFIG at f0000000 - f3ffffff
>>>>>  PCI: Using configuration type 1
>>>>>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE] 4
>>> regs on
>>>> int 0x9
>>>>> +ACPI Error (evregion-0316): No handler for Region [ECOR]
>>>> (ffff81007d35dda0) [EmbeddedControl] [20070126]
>>>>> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
>> handler
>>>> [20070126]
>>>>> +ACPI Error (psparse-0537): Method parse/execution failed
>>>> [\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),
>> AE_NOT_EXIST
>>>>> +ACPI Error (psparse-0537): Method parse/execution failed
>>>> [\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),
>> AE_NOT_EXIST
>>>>> +ACPI Error (psparse-0537): Method parse/execution failed
>>> [\_GPE._L02]
>>>> (Node ffff81007d376420), AE_NOT_EXIST
>>>>> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE
>>> method
>>>> [_L02] [20070126]
>>>>>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled
>> 3
>>>> Runtime GPEs in this block
>>>>>  ACPI: EC: EC description table is found, configuring boot EC
>>>>> -ACPI: EC: non-query interrupt received, switching to interrupt
>> mode
>>>>> -Completing Region/Field/Buffer/Package
>> initialization:........................................................
>>> ....
>>>> ............................................................
>> .......................................................................
>>> ....
>>>
>> .......................................................................
>>> ....
>>>> ................
>>>>> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
>>> Packages
>>>> (1888 nodes)
>>>>> +Completing Region/Field/Buffer/Package
>> initialization:........................................................
>>> ....
>>>> ............................................................
>> .......................................................................
>>> ....
>>>
>> .......................................................................
>>> ....
>>>> .................
>>>>> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
>>> Packages
>>>> (1888 nodes)
>>>>>  Initializing Device/Processor/Thermal objects by executing _INI
>>>> methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
>>>>> +ACPI: EC: non-query interrupt received, switching to interrupt
>> mode
>>>>>  .......
>>>>>  Executed 8 _INI methods requiring 2 _STA executions (examined 88
>>>> objects)
>>>>>  ACPI: Interpreter enabled
>>>
>>
>>
>>
> 


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-25  2:10                 ` Alexey Starikovskiy
@ 2008-04-25  2:28                   ` Zhang Rui
  2008-04-25  2:39                     ` Alexey Starikovskiy
  0 siblings, 1 reply; 123+ messages in thread
From: Zhang Rui @ 2008-04-25  2:28 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: Moore, Robert, Len Brown, linux-acpi


On Fri, 2008-04-25 at 10:10 +0800, Alexey Starikovskiy wrote:
> Actually, I too don't know why _disabling_ some GPE could trigger EC
> one...
> May be Len could try to debug this issue, as he is the only one with
> hardware...
> One thought is that EC GPE is not present in GPE scope, thus it will
> be not configured by the
> time 6217' code is executed. So, in theory, 6217 could try to disable
> EC GPE.
In acpi_install_gpe_handler, Linux always disables the GPE before
installing a GPE handler.
After 6217 is applied, when installing EC GPE handler, Linux will invoke
acpi_hw_write_gpe_enable_reg to try to disable EC GPE which is not done
before. Don't know if this is related.

thanks,
rui

> Moore, Robert wrote:
> > Yes, this is my question also.
> >
> > I hope Alexey can help with this. I'm very nervous about any code
> that
> > works or does not work for reasons unknown. When this happens in the
> GPE
> > code, I get more than nervous.
> >
> > Bob
> >
> >
> > -----Original Message-----
> > From: Zhang, Rui
> > Sent: Thursday, April 24, 2008 6:53 PM
> > To: Len Brown
> > Cc: Moore, Robert; Alexey Starikovskiy; linux-acpi@vger.kernel.org
> > Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
> GPEs
> >
> >
> > On Fri, 2008-04-25 at 09:40 +0800, Len Brown wrote:
> >> oh goody, i thought this one rang a bell...
> >>
> >> I'll apply 6217 on top of 9916 (which was already in the test tree,
> >> but not on the acpica branch)
> >>
> >> the error goes away with both applied.
> >
> > I still don't see why the error messages pop up if 6217 is applied.
> > IMO, 6217 won't enable the EC GPE. :(
> >
> > thanks,
> > rui
> >
> >> On Wednesday 23 April 2008, Moore, Robert wrote:
> >>> Alexey,
> >>>
> >>> I remember there was some discussion on this, but I'm still not
> sure
> >> why
> >>> the patch for 6217 (Ignore GPE if valid and not enabled) makes the
> >> other
> >>> problem (too early enabling of GPEs) apparent. Please explain.
> >>>
> >>> Thanks,
> >>> Bob
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
> >>>> Sent: Tuesday, April 22, 2008 10:29 PM
> >>>> To: Len Brown
> >>>> Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
> >>>> Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown
> spurious
> >> GPEs
> >>>> Len Brown wrote:
> >>>>> On Saturday 12 April 2008, Len Brown wrote:
> >>>>>> From: Bob Moore <robert.moore@intel.com>
> >>>>>>
> >>>>>> Implemented another change to eliminate/suppress spurious or
> >>>>>> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
> >>>>>> that are neither enabled nor disabled -- meaning that the GPE
> is
> >>>>>> unknown to the system. This will prevent future interrupts from
> >>>>>> that GPE. (Zhang Rui) BZ 6217
> >>>>>>
> >>>>>> Signed-off-by: Bob Moore <robert.moore@intel.com>
> >>>>>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> >>>>>> Signed-off-by: Len Brown <len.brown@intel.com>
> >>>>>> ---
> >>>>>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
> >>>>>>  1 files changed, 8 insertions(+), 1 deletions(-)
> >>>>>>
> >>>>>> diff --git a/drivers/acpi/events/evgpe.c
> >>> b/drivers/acpi/events/evgpe.c
> >>>>>> index 897baed..6940f5d 100644
> >>>>>> --- a/drivers/acpi/events/evgpe.c
> >>>>>> +++ b/drivers/acpi/events/evgpe.c
> >>>>>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
> >>>> acpi_gpe_event_info *gpe_event_info)
> >>>>>>   ACPI_FUNCTION_TRACE(ev_disable_gpe);
> >>>>>>
> >>>>>> - if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
> >>>>>> + /*
> >>>>>> +  * Ignore this if the GPE is valid and not enabled.
> >>>>>> +  *
> >>>>>> +  * Flags is only zero if GPE is neither enabled or disabled
> --
> >>> it may
> >>>>>> +  * be a spurious or stray GPE -- disable it in the default
> >> case
> >>>> below.
> >>>>>> +  */
> >>>>>> + if (gpe_event_info->flags &&
> >>>>>> +     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
> >>>>>>           return_ACPI_STATUS(AE_OK);
> >>>>>>   }
> >>>>>>
> >>>>>
> >>>>> When applied to 2.6.25, the patch above causes ACPI Error
> >> messages
> >>> below
> >>>> on my T61.
> >>>>> Certainly this is a case of the EC getting an interrupt (GPE
> x02)
> >>> before
> >>>> it has initialized.
> >>>>> Perhaps it breaks the call of acpi_install_gpe_handler() to
> >>>> acpi_ev_disable_gpe()?
> >>>> Congratulations, now you too hit this one, patch is already
> >> there...
> >>>> It is wroong to enable GPE before handler for it is installed...
> >>>> http://bugzilla.kernel.org/show_bug.cgi?id=9916
> >>>>
> >>>>> -Len
> >>>>>
> >>>>>
> >>>>>  PCI: Using MMCONFIG at f0000000 - f3ffffff
> >>>>>  PCI: Using configuration type 1
> >>>>>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE]
> 4
> >>> regs on
> >>>> int 0x9
> >>>>> +ACPI Error (evregion-0316): No handler for Region [ECOR]
> >>>> (ffff81007d35dda0) [EmbeddedControl] [20070126]
> >>>>> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
> >> handler
> >>>> [20070126]
> >>>>> +ACPI Error (psparse-0537): Method parse/execution failed
> >>>> [\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),
> >> AE_NOT_EXIST
> >>>>> +ACPI Error (psparse-0537): Method parse/execution failed
> >>>> [\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),
> >> AE_NOT_EXIST
> >>>>> +ACPI Error (psparse-0537): Method parse/execution failed
> >>> [\_GPE._L02]
> >>>> (Node ffff81007d376420), AE_NOT_EXIST
> >>>>> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE
> >>> method
> >>>> [_L02] [20070126]
> >>>>>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake,
> Enabled
> >> 3
> >>>> Runtime GPEs in this block
> >>>>>  ACPI: EC: EC description table is found, configuring boot EC
> >>>>> -ACPI: EC: non-query interrupt received, switching to interrupt
> >> mode
> >>>>> -Completing Region/Field/Buffer/Package
> >>
> initialization:........................................................
> >>> ....
> >>>> ............................................................
> >> .......................................................................
> >>> ....
> >>>
> >> .......................................................................
> >>> ....
> >>>> ................
> >>>>> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
> >>> Packages
> >>>> (1888 nodes)
> >>>>> +Completing Region/Field/Buffer/Package
> >>
> initialization:........................................................
> >>> ....
> >>>> ............................................................
> >> .......................................................................
> >>> ....
> >>>
> >> .......................................................................
> >>> ....
> >>>> .................
> >>>>> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
> >>> Packages
> >>>> (1888 nodes)
> >>>>>  Initializing Device/Processor/Thermal objects by executing _INI
> >>>> methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
> >>>>> +ACPI: EC: non-query interrupt received, switching to interrupt
> >> mode
> >>>>>  .......
> >>>>>  Executed 8 _INI methods requiring 2 _STA executions (examined
> 88
> >>>> objects)
> >>>>>  ACPI: Interpreter enabled
> >>>
> >>
> >>
> >>
> >
> 
> 
> 


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-25  2:28                   ` Zhang Rui
@ 2008-04-25  2:39                     ` Alexey Starikovskiy
  2008-04-25  4:18                       ` Moore, Robert
  0 siblings, 1 reply; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-04-25  2:39 UTC (permalink / raw)
  To: Zhang Rui; +Cc: Moore, Robert, Len Brown, linux-acpi

Zhang Rui wrote:
> On Fri, 2008-04-25 at 10:10 +0800, Alexey Starikovskiy wrote:
>> Actually, I too don't know why _disabling_ some GPE could trigger EC
>> one...
>> May be Len could try to debug this issue, as he is the only one with
>> hardware...
>> One thought is that EC GPE is not present in GPE scope, thus it will
>> be not configured by the
>> time 6217' code is executed. So, in theory, 6217 could try to disable
>> EC GPE.
> In acpi_install_gpe_handler, Linux always disables the GPE before
> installing a GPE handler.
> After 6217 is applied, when installing EC GPE handler, Linux will invoke
> acpi_hw_write_gpe_enable_reg to try to disable EC GPE which is not done
> before. Don't know if this is related.
No, EC GPE handler is installed later. Thus the error is triggered 
during execution of 6217 code...

^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-25  2:39                     ` Alexey Starikovskiy
@ 2008-04-25  4:18                       ` Moore, Robert
  0 siblings, 0 replies; 123+ messages in thread
From: Moore, Robert @ 2008-04-25  4:18 UTC (permalink / raw)
  To: Alexey Starikovskiy, Zhang, Rui; +Cc: Len Brown, linux-acpi

>> After 6217 is applied, when installing EC GPE handler, Linux will
invoke
>> acpi_hw_write_gpe_enable_reg to try to disable EC GPE which is not
done
>> before. Don't know if this is related.
>No, EC GPE handler is installed later. Thus the error is triggered
>during execution of 6217 code...

Attempt to disable EC GPE causes a GPE? I still do not understand.


>-----Original Message-----
>From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
>Sent: Thursday, April 24, 2008 7:40 PM
>To: Zhang, Rui
>Cc: Moore, Robert; Len Brown; linux-acpi@vger.kernel.org
>Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
>
>Zhang Rui wrote:
>> On Fri, 2008-04-25 at 10:10 +0800, Alexey Starikovskiy wrote:
>>> Actually, I too don't know why _disabling_ some GPE could trigger EC
>>> one...
>>> May be Len could try to debug this issue, as he is the only one with
>>> hardware...
>>> One thought is that EC GPE is not present in GPE scope, thus it will
>>> be not configured by the
>>> time 6217' code is executed. So, in theory, 6217 could try to
disable
>>> EC GPE.
>> In acpi_install_gpe_handler, Linux always disables the GPE before
>> installing a GPE handler.
>> After 6217 is applied, when installing EC GPE handler, Linux will
invoke
>> acpi_hw_write_gpe_enable_reg to try to disable EC GPE which is not
done
>> before. Don't know if this is related.
>No, EC GPE handler is installed later. Thus the error is triggered
>during execution of 6217 code...

^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)
  2008-04-12  4:24 ACPICA branch Len Brown
  2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
  2008-04-12  4:41 ` ACPICA branch - first try Core revision 20080321 Len Brown
@ 2008-04-29  9:04 ` Len Brown
  2008-04-29 16:09   ` Moore, Robert
  2 siblings, 1 reply; 123+ messages in thread
From: Len Brown @ 2008-04-29  9:04 UTC (permalink / raw)
  To: linux-acpi, Moore, Robert, Lin Ming

Hmm, i just noticed something strange on the T61

Linus' tree prints these messages:

[lenb@t61 sut]$ grep -i ssdt 2.6.25-06058-ga01e035/dmesg
ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT  3000000)
ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL 20050513)
ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL 20050513)
ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL 20050513)
ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL 20050513)
Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0 Regions
Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0 Regions
Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0 Regions
ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
Table [SSDT](id 003A) - 6 Objects with 0 Devices 4 Methods 0 Regions
ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
Table [SSDT](id 003B) - 16 Objects with 0 Devices 1 Methods 0 Regions
ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
Table [SSDT](id 0046) - 4 Objects with 0 Devices 4 Methods 0 Regions
ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
Table [SSDT](id 0047) - 1 Objects with 0 Devices 1 Methods 0 Regions


The acpi test tree prints these messages:

[lenb@t61 sut]$ grep -i ssdt 2.6.25-06238-gf4e0ea3/dmesg
ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT  3000000)
ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL 20050513)
ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL 20050513)
ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL 20050513)
ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL 20050513)
Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0 Regions
Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0 Regions
Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0 Regions
ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
Table [SSDT](id 0051) - 0 Objects with 0 Devices 0 Methods 0 Regions

ie.  "0 Objects with 0 Devices 0 Methods 0 Regions"

dunno if this is just cosmetic -- the p-states that are advertised in
the SSDT's seem to be working normally, and C-states do too.

-Len

^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)
  2008-04-29  9:04 ` ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions) Len Brown
@ 2008-04-29 16:09   ` Moore, Robert
  2008-04-30 11:03     ` Lin Ming
  2008-05-06  6:20     ` Lin Ming
  0 siblings, 2 replies; 123+ messages in thread
From: Moore, Robert @ 2008-04-29 16:09 UTC (permalink / raw)
  To: Len Brown, linux-acpi, Lin, Ming M


It looks like the tables in question are dynamically loaded:

>ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
>Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
>ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
>Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
>ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
>Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
>ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
>Table [SSDT](id 0051) - 0 Objects with 0 Devices 0 Methods 0 Regions

What the zeroes mean is that a WalkNamespace after the table load did
not find any such objects created by the table.

Something does look wrong, it may not affect your machine, but has the
potential to cause problems on other machines.

The difference in owner IDs between the two traces might mean that there
is some mismatch somewhere. I would debug and determine 1) The actual
owner id created for the newly loaded table, and 2) what owner id is
passed to AcpiDsInitializeObjects after the table is loaded.

Bob



>-----Original Message-----
>From: Len Brown [mailto:lenb@kernel.org]
>Sent: Tuesday, April 29, 2008 2:05 AM
>To: linux-acpi@vger.kernel.org; Moore, Robert; Lin, Ming M
>Subject: Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0
Regions)
>
>Hmm, i just noticed something strange on the T61
>
>Linus' tree prints these messages:
>
>[lenb@t61 sut]$ grep -i ssdt 2.6.25-06058-ga01e035/dmesg
>ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT  3000000)
>ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL 20050513)
>ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL 20050513)
>ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL 20050513)
>ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL 20050513)
>Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0 Regions
>Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
>Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
>Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0 Regions
>Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0 Regions
>ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
>Table [SSDT](id 003A) - 6 Objects with 0 Devices 4 Methods 0 Regions
>ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
>Table [SSDT](id 003B) - 16 Objects with 0 Devices 1 Methods 0 Regions
>ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
>Table [SSDT](id 0046) - 4 Objects with 0 Devices 4 Methods 0 Regions
>ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
>Table [SSDT](id 0047) - 1 Objects with 0 Devices 1 Methods 0 Regions
>
>
>The acpi test tree prints these messages:
>
>[lenb@t61 sut]$ grep -i ssdt 2.6.25-06238-gf4e0ea3/dmesg
>ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT  3000000)
>ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL 20050513)
>ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL 20050513)
>ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL 20050513)
>ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL 20050513)
>Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0 Regions
>Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
>Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
>Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0 Regions
>Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0 Regions
>ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
>Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
>ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
>Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
>ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
>Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
>ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
>Table [SSDT](id 0051) - 0 Objects with 0 Devices 0 Methods 0 Regions
>
>ie.  "0 Objects with 0 Devices 0 Methods 0 Regions"
>
>dunno if this is just cosmetic -- the p-states that are advertised in
>the SSDT's seem to be working normally, and C-states do too.
>
>-Len

^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)
  2008-04-29 16:09   ` Moore, Robert
@ 2008-04-30 11:03     ` Lin Ming
  2008-05-06  6:20     ` Lin Ming
  1 sibling, 0 replies; 123+ messages in thread
From: Lin Ming @ 2008-04-30 11:03 UTC (permalink / raw)
  To: Moore, Robert; +Cc: Len Brown, linux-acpi

 nsalloc-0226 [00] ns_install_node       : _PPC (Untyped) [Node f7836450
Owner A1] added to CPU0 (Processor) [Node f78164f8]
 nsalloc-0226 [00] ns_install_node       : _PCT (Method) [Node f7836360
Owner A1] added to CPU0 (Processor) [Node f78164f8]
 nsalloc-0226 [00] ns_install_node       : XPSS (Method) [Node f7836378
Owner A1] added to CPU0 (Processor) [Node f78164f8]
 nsalloc-0226 [00] ns_install_node       : SPSS (Untyped) [Node f7836390
Owner A1] added to CPU0 (Processor) [Node f78164f8]
 nsalloc-0226 [00] ns_install_node       : _PSS (Untyped) [Node f78363a8
Owner A1] added to CPU0 (Processor) [Node f78164f8]
 nsalloc-0226 [00] ns_install_node       : _PSD (Method) [Node f78363c0
Owner A1] added to CPU0 (Processor) [Node f78164f8]
Table [SSDT](id 00A1) - 0 Objects with 0 Devices 0 Methods 0 Regions

Above dmesg comes from a HP machine.

Table OwnerId is 0xA1, and there're nodes with this OwnerId.
Strange that it prints "0 Objects".


On Wed, 2008-04-30 at 00:09 +0800, Moore, Robert wrote:
> It looks like the tables in question are dynamically loaded:
> 
> >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
> >Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
> >Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
> >Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
> >Table [SSDT](id 0051) - 0 Objects with 0 Devices 0 Methods 0 Regions
> 
> What the zeroes mean is that a WalkNamespace after the table load did
> not find any such objects created by the table.
> 
> Something does look wrong, it may not affect your machine, but has the
> potential to cause problems on other machines.
> 
> The difference in owner IDs between the two traces might mean that there
> is some mismatch somewhere. I would debug and determine 1) The actual
> owner id created for the newly loaded table, and 2) what owner id is
> passed to AcpiDsInitializeObjects after the table is loaded.
> 
> Bob
> 
> 
> 
> >-----Original Message-----
> >From: Len Brown [mailto:lenb@kernel.org]
> >Sent: Tuesday, April 29, 2008 2:05 AM
> >To: linux-acpi@vger.kernel.org; Moore, Robert; Lin, Ming M
> >Subject: Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0
> Regions)
> >
> >Hmm, i just noticed something strange on the T61
> >
> >Linus' tree prints these messages:
> >
> >[lenb@t61 sut]$ grep -i ssdt 2.6.25-06058-ga01e035/dmesg
> >ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT  3000000)
> >ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0 Regions
> >Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
> >Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
> >Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0 Regions
> >Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0 Regions
> >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
> >Table [SSDT](id 003A) - 6 Objects with 0 Devices 4 Methods 0 Regions
> >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
> >Table [SSDT](id 003B) - 16 Objects with 0 Devices 1 Methods 0 Regions
> >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
> >Table [SSDT](id 0046) - 4 Objects with 0 Devices 4 Methods 0 Regions
> >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
> >Table [SSDT](id 0047) - 1 Objects with 0 Devices 1 Methods 0 Regions
> >
> >
> >The acpi test tree prints these messages:
> >
> >[lenb@t61 sut]$ grep -i ssdt 2.6.25-06238-gf4e0ea3/dmesg
> >ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT  3000000)
> >ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0 Regions
> >Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
> >Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
> >Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0 Regions
> >Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0 Regions
> >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
> >Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
> >Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
> >Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
> >Table [SSDT](id 0051) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >
> >ie.  "0 Objects with 0 Devices 0 Methods 0 Regions"
> >
> >dunno if this is just cosmetic -- the p-states that are advertised in
> >the SSDT's seem to be working normally, and C-states do too.
> >
> >-Len


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)
  2008-04-29 16:09   ` Moore, Robert
  2008-04-30 11:03     ` Lin Ming
@ 2008-05-06  6:20     ` Lin Ming
  2008-05-06 17:07       ` Moore, Robert
  2008-05-13  5:45       ` Lin Ming
  1 sibling, 2 replies; 123+ messages in thread
From: Lin Ming @ 2008-05-06  6:20 UTC (permalink / raw)
  To: Moore, Robert; +Cc: Len Brown, linux-acpi

Hi, all

The root cause found, it's caused by a patch 
which introduced in ACPICA version 20071019

commit 7f4ac9f91383a0707de559dc8fbca986fc2d302f
Author: Bob Moore <robert.moore@intel.com>
Date:   Thu Apr 10 19:06:39 2008 +0400

    ACPICA: Fix for Load/LoadTable to specify load location
    
    Fixed a problem with the Load and LoadTable operators where
    the table location within the namespace was ignored. Instead,
    the table was always loaded into the root or current scope.
    
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
    Signed-off-by: Len Brown <len.brown@intel.com>


For example, 
SSDT:
Name(\tmp0, 0)

DSDT:
Method(m000)
{
	<Load the SSDT above>
}

Namespace walking will start at node m000, so \tmp0 will never appear at
the namespace walking.

It seems that we should again force the table always loaded into the
root.
Load statement is always inside a method.
It makes no sense to install some nodes inside a method since the nodes
in method should all be temporary nodes that will be deleted when method
exit.

Lin Ming
---
diff --git a/drivers/acpi/executer/exconfig.c
b/drivers/acpi/executer/exconfig.c
index 24da921..508bb0e 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -376,7 +376,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
        }
 
        status =
-           acpi_ex_add_table(table_index,
walk_state->scope_info->scope.node,
+           acpi_ex_add_table(table_index, acpi_gbl_root_node,
                              &ddb_handle);
        if (ACPI_FAILURE(status)) {

On Wed, 2008-04-30 at 00:09 +0800, Moore, Robert wrote:
> It looks like the tables in question are dynamically loaded:
> 
> >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
> >Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
> >Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
> >Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
> >Table [SSDT](id 0051) - 0 Objects with 0 Devices 0 Methods 0 Regions
> 
> What the zeroes mean is that a WalkNamespace after the table load did
> not find any such objects created by the table.
> 
> Something does look wrong, it may not affect your machine, but has the
> potential to cause problems on other machines.
> 
> The difference in owner IDs between the two traces might mean that there
> is some mismatch somewhere. I would debug and determine 1) The actual
> owner id created for the newly loaded table, and 2) what owner id is
> passed to AcpiDsInitializeObjects after the table is loaded.
> 
> Bob
> 
> 
> 
> >-----Original Message-----
> >From: Len Brown [mailto:lenb@kernel.org]
> >Sent: Tuesday, April 29, 2008 2:05 AM
> >To: linux-acpi@vger.kernel.org; Moore, Robert; Lin, Ming M
> >Subject: Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0
> Regions)
> >
> >Hmm, i just noticed something strange on the T61
> >
> >Linus' tree prints these messages:
> >
> >[lenb@t61 sut]$ grep -i ssdt 2.6.25-06058-ga01e035/dmesg
> >ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT  3000000)
> >ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0 Regions
> >Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
> >Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
> >Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0 Regions
> >Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0 Regions
> >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
> >Table [SSDT](id 003A) - 6 Objects with 0 Devices 4 Methods 0 Regions
> >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
> >Table [SSDT](id 003B) - 16 Objects with 0 Devices 1 Methods 0 Regions
> >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
> >Table [SSDT](id 0046) - 4 Objects with 0 Devices 4 Methods 0 Regions
> >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
> >Table [SSDT](id 0047) - 1 Objects with 0 Devices 1 Methods 0 Regions
> >
> >
> >The acpi test tree prints these messages:
> >
> >[lenb@t61 sut]$ grep -i ssdt 2.6.25-06238-gf4e0ea3/dmesg
> >ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT  3000000)
> >ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL 20050513)
> >Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0 Regions
> >Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
> >Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
> >Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0 Regions
> >Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0 Regions
> >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
> >Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
> >Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
> >Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
> >Table [SSDT](id 0051) - 0 Objects with 0 Devices 0 Methods 0 Regions
> >
> >ie.  "0 Objects with 0 Devices 0 Methods 0 Regions"
> >
> >dunno if this is just cosmetic -- the p-states that are advertised in
> >the SSDT's seem to be working normally, and C-states do too.
> >
> >-Len


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)
  2008-05-06  6:20     ` Lin Ming
@ 2008-05-06 17:07       ` Moore, Robert
  2008-05-13  5:45       ` Lin Ming
  1 sibling, 0 replies; 123+ messages in thread
From: Moore, Robert @ 2008-05-06 17:07 UTC (permalink / raw)
  To: Lin, Ming M; +Cc: Len Brown, linux-acpi

We should find out how windows handles table loading.
Bob


>-----Original Message-----
>From: Lin, Ming M
>Sent: Monday, May 05, 2008 11:21 PM
>To: Moore, Robert
>Cc: Len Brown; linux-acpi@vger.kernel.org
>Subject: RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0
Regions)
>
>Hi, all
>
>The root cause found, it's caused by a patch
>which introduced in ACPICA version 20071019
>
>commit 7f4ac9f91383a0707de559dc8fbca986fc2d302f
>Author: Bob Moore <robert.moore@intel.com>
>Date:   Thu Apr 10 19:06:39 2008 +0400
>
>    ACPICA: Fix for Load/LoadTable to specify load location
>
>    Fixed a problem with the Load and LoadTable operators where
>    the table location within the namespace was ignored. Instead,
>    the table was always loaded into the root or current scope.
>
>    Signed-off-by: Bob Moore <robert.moore@intel.com>
>    Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
>    Signed-off-by: Len Brown <len.brown@intel.com>
>
>
>For example,
>SSDT:
>Name(\tmp0, 0)
>
>DSDT:
>Method(m000)
>{
>	<Load the SSDT above>
>}
>
>Namespace walking will start at node m000, so \tmp0 will never appear
at
>the namespace walking.
>
>It seems that we should again force the table always loaded into the
>root.
>Load statement is always inside a method.
>It makes no sense to install some nodes inside a method since the nodes
>in method should all be temporary nodes that will be deleted when
method
>exit.
>
>Lin Ming
>---
>diff --git a/drivers/acpi/executer/exconfig.c
>b/drivers/acpi/executer/exconfig.c
>index 24da921..508bb0e 100644
>--- a/drivers/acpi/executer/exconfig.c
>+++ b/drivers/acpi/executer/exconfig.c
>@@ -376,7 +376,7 @@ acpi_ex_load_op(union acpi_operand_object
*obj_desc,
>        }
>
>        status =
>-           acpi_ex_add_table(table_index,
>walk_state->scope_info->scope.node,
>+           acpi_ex_add_table(table_index, acpi_gbl_root_node,
>                              &ddb_handle);
>        if (ACPI_FAILURE(status)) {
>
>On Wed, 2008-04-30 at 00:09 +0800, Moore, Robert wrote:
>> It looks like the tables in question are dynamically loaded:
>>
>> >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL
20050513)
>> >Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
>> >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL
20050513)
>> >Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
>> >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL
20050513)
>> >Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
>> >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL
20050513)
>> >Table [SSDT](id 0051) - 0 Objects with 0 Devices 0 Methods 0 Regions
>>
>> What the zeroes mean is that a WalkNamespace after the table load did
>> not find any such objects created by the table.
>>
>> Something does look wrong, it may not affect your machine, but has
the
>> potential to cause problems on other machines.
>>
>> The difference in owner IDs between the two traces might mean that
there
>> is some mismatch somewhere. I would debug and determine 1) The actual
>> owner id created for the newly loaded table, and 2) what owner id is
>> passed to AcpiDsInitializeObjects after the table is loaded.
>>
>> Bob
>>
>>
>>
>> >-----Original Message-----
>> >From: Len Brown [mailto:lenb@kernel.org]
>> >Sent: Tuesday, April 29, 2008 2:05 AM
>> >To: linux-acpi@vger.kernel.org; Moore, Robert; Lin, Ming M
>> >Subject: Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0
>> Regions)
>> >
>> >Hmm, i just noticed something strange on the T61
>> >
>> >Linus' tree prints these messages:
>> >
>> >[lenb@t61 sut]$ grep -i ssdt 2.6.25-06058-ga01e035/dmesg
>> >ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT
3000000)
>> >ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL
20050513)
>> >ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL
20050513)
>> >ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL
20050513)
>> >ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL
20050513)
>> >Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0
Regions
>> >Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
>> >Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
>> >Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0
Regions
>> >Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0
Regions
>> >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL
20050513)
>> >Table [SSDT](id 003A) - 6 Objects with 0 Devices 4 Methods 0 Regions
>> >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL
20050513)
>> >Table [SSDT](id 003B) - 16 Objects with 0 Devices 1 Methods 0
Regions
>> >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL
20050513)
>> >Table [SSDT](id 0046) - 4 Objects with 0 Devices 4 Methods 0 Regions
>> >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL
20050513)
>> >Table [SSDT](id 0047) - 1 Objects with 0 Devices 1 Methods 0 Regions
>> >
>> >
>> >The acpi test tree prints these messages:
>> >
>> >[lenb@t61 sut]$ grep -i ssdt 2.6.25-06238-gf4e0ea3/dmesg
>> >ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT
3000000)
>> >ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL
20050513)
>> >ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL
20050513)
>> >ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL
20050513)
>> >ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL
20050513)
>> >Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0
Regions
>> >Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
>> >Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
>> >Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0
Regions
>> >Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0
Regions
>> >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL
20050513)
>> >Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
>> >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL
20050513)
>> >Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
>> >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL
20050513)
>> >Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
>> >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL
20050513)
>> >Table [SSDT](id 0051) - 0 Objects with 0 Devices 0 Methods 0 Regions
>> >
>> >ie.  "0 Objects with 0 Devices 0 Methods 0 Regions"
>> >
>> >dunno if this is just cosmetic -- the p-states that are advertised
in
>> >the SSDT's seem to be working normally, and C-states do too.
>> >
>> >-Len


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)
  2008-05-06  6:20     ` Lin Ming
  2008-05-06 17:07       ` Moore, Robert
@ 2008-05-13  5:45       ` Lin Ming
  1 sibling, 0 replies; 123+ messages in thread
From: Lin Ming @ 2008-05-13  5:45 UTC (permalink / raw)
  To: Len Brown; +Cc: Moore, Robert, linux-acpi

Hi, Len

Please apply this patch.
Load the dynamic table under root node.

Lin Ming

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---
diff --git a/drivers/acpi/executer/exconfig.c
b/drivers/acpi/executer/exconfig.c
index 24da921..508bb0e 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -376,7 +376,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
        }
 
        status =
-           acpi_ex_add_table(table_index,
walk_state->scope_info->scope.node,
+           acpi_ex_add_table(table_index, acpi_gbl_root_node,
                              &ddb_handle);
        if (ACPI_FAILURE(status)) {



On Tue, 2008-05-06 at 14:20 +0800, Lin Ming wrote:
> Hi, all
> 
> The root cause found, it's caused by a patch 
> which introduced in ACPICA version 20071019
> 
> commit 7f4ac9f91383a0707de559dc8fbca986fc2d302f
> Author: Bob Moore <robert.moore@intel.com>
> Date:   Thu Apr 10 19:06:39 2008 +0400
> 
>     ACPICA: Fix for Load/LoadTable to specify load location
>     
>     Fixed a problem with the Load and LoadTable operators where
>     the table location within the namespace was ignored. Instead,
>     the table was always loaded into the root or current scope.
>     
>     Signed-off-by: Bob Moore <robert.moore@intel.com>
>     Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
>     Signed-off-by: Len Brown <len.brown@intel.com>
> 
> 
> For example, 
> SSDT:
> Name(\tmp0, 0)
> 
> DSDT:
> Method(m000)
> {
> 	<Load the SSDT above>
> }
> 
> Namespace walking will start at node m000, so \tmp0 will never appear at
> the namespace walking.
> 
> It seems that we should again force the table always loaded into the
> root.
> Load statement is always inside a method.
> It makes no sense to install some nodes inside a method since the nodes
> in method should all be temporary nodes that will be deleted when method
> exit.
> 
> Lin Ming
> ---
> diff --git a/drivers/acpi/executer/exconfig.c
> b/drivers/acpi/executer/exconfig.c
> index 24da921..508bb0e 100644
> --- a/drivers/acpi/executer/exconfig.c
> +++ b/drivers/acpi/executer/exconfig.c
> @@ -376,7 +376,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
>         }
>  
>         status =
> -           acpi_ex_add_table(table_index,
> walk_state->scope_info->scope.node,
> +           acpi_ex_add_table(table_index, acpi_gbl_root_node,
>                               &ddb_handle);
>         if (ACPI_FAILURE(status)) {
> 
> On Wed, 2008-04-30 at 00:09 +0800, Moore, Robert wrote:
> > It looks like the tables in question are dynamically loaded:
> > 
> > >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
> > >Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
> > >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
> > >Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
> > >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
> > >Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
> > >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
> > >Table [SSDT](id 0051) - 0 Objects with 0 Devices 0 Methods 0 Regions
> > 
> > What the zeroes mean is that a WalkNamespace after the table load did
> > not find any such objects created by the table.
> > 
> > Something does look wrong, it may not affect your machine, but has the
> > potential to cause problems on other machines.
> > 
> > The difference in owner IDs between the two traces might mean that there
> > is some mismatch somewhere. I would debug and determine 1) The actual
> > owner id created for the newly loaded table, and 2) what owner id is
> > passed to AcpiDsInitializeObjects after the table is loaded.
> > 
> > Bob
> > 
> > 
> > 
> > >-----Original Message-----
> > >From: Len Brown [mailto:lenb@kernel.org]
> > >Sent: Tuesday, April 29, 2008 2:05 AM
> > >To: linux-acpi@vger.kernel.org; Moore, Robert; Lin, Ming M
> > >Subject: Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0
> > Regions)
> > >
> > >Hmm, i just noticed something strange on the T61
> > >
> > >Linus' tree prints these messages:
> > >
> > >[lenb@t61 sut]$ grep -i ssdt 2.6.25-06058-ga01e035/dmesg
> > >ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT  3000000)
> > >ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL 20050513)
> > >ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL 20050513)
> > >ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL 20050513)
> > >ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL 20050513)
> > >Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0 Regions
> > >Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
> > >Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
> > >Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0 Regions
> > >Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0 Regions
> > >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
> > >Table [SSDT](id 003A) - 6 Objects with 0 Devices 4 Methods 0 Regions
> > >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
> > >Table [SSDT](id 003B) - 16 Objects with 0 Devices 1 Methods 0 Regions
> > >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
> > >Table [SSDT](id 0046) - 4 Objects with 0 Devices 4 Methods 0 Regions
> > >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
> > >Table [SSDT](id 0047) - 1 Objects with 0 Devices 1 Methods 0 Regions
> > >
> > >
> > >The acpi test tree prints these messages:
> > >
> > >[lenb@t61 sut]$ grep -i ssdt 2.6.25-06238-gf4e0ea3/dmesg
> > >ACPI: SSDT 7D6BB9B4, 0269 (r1 LENOVO TP-7L        2100 MSFT  3000000)
> > >ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L        2100 INTL 20050513)
> > >ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L        2100 INTL 20050513)
> > >ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L        2100 INTL 20050513)
> > >ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L        2100 INTL 20050513)
> > >Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0 Regions
> > >Table [SSDT](id 0003) - 7 Objects with 0 Devices 3 Methods 0 Regions
> > >Table [SSDT](id 0004) - 4 Objects with 0 Devices 3 Methods 0 Regions
> > >Table [SSDT](id 0005) - 14 Objects with 0 Devices 5 Methods 0 Regions
> > >Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0 Regions
> > >ACPI: SSDT 7D6E1B32, 02C4 (r1  PmRef  Cpu0Ist      100 INTL 20050513)
> > >Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
> > >ACPI: SSDT 7D6E1E7B, 085E (r1  PmRef  Cpu0Cst      100 INTL 20050513)
> > >Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
> > >ACPI: SSDT 7D6E1A6A, 00C8 (r1  PmRef  Cpu1Ist      100 INTL 20050513)
> > >Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
> > >ACPI: SSDT 7D6E1DF6, 0085 (r1  PmRef  Cpu1Cst      100 INTL 20050513)
> > >Table [SSDT](id 0051) - 0 Objects with 0 Devices 0 Methods 0 Regions
> > >
> > >ie.  "0 Objects with 0 Devices 0 Methods 0 Regions"
> > >
> > >dunno if this is just cosmetic -- the p-states that are advertised in
> > >the SSDT's seem to be working normally, and C-states do too.
> > >
> > >-Len


^ permalink raw reply related	[flat|nested] 123+ messages in thread

* RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-04-25  1:57               ` Moore, Robert
  2008-04-25  2:10                 ` Alexey Starikovskiy
@ 2008-05-21  8:28                 ` Zhang, Rui
  2008-05-21 16:56                   ` Zhang Rui
  2008-05-22  1:08                   ` Zhao Yakui
  1 sibling, 2 replies; 123+ messages in thread
From: Zhang, Rui @ 2008-05-21  8:28 UTC (permalink / raw)
  To: Moore, Robert, Len Brown; +Cc: Alexey Starikovskiy, linux-acpi, Zhao, Yakui

Hi, all,

With Yakui's help, we've root caused this problem.

For the GPEs with _Lxx/_Exx methods, Linux updates the enable mask but
doesn't enable them in HW in acpi_ev_gpe_initialize.
And in acpi_ev_install_fadt_gpes, the GPEs that are shown in _PRW
methods but don't have _Lxx/_Exx methods are disabled in
acpi_ev_set_type, before 6217 is applied, the acpi_ev_disable_gpe won't
write the GPE enable register and everything goes well.
But with 6217 applied, acpi_ev_disable_gpe will write the GPE enable
register and enable all the _Lxx/_Exx GPEs as a side effect.

And the error message is printed out if a _Lxx/_Exx GPE is fired and try
to access EC address space.

Of cource this can be solved by Alexey's patch which installs the EC
address space handler before any GPE is enabled in HW.

But there is still one problem with both 6217 and 9916 applied which
I'll talk about in the next email. :)

Thanks,
Rui

>-----Original Message-----
>From: Moore, Robert
>Sent: Friday, April 25, 2008 9:57 AM
>To: Zhang, Rui; Len Brown
>Cc: Alexey Starikovskiy; linux-acpi@vger.kernel.org
>Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
>
>Yes, this is my question also.
>
>I hope Alexey can help with this. I'm very nervous about any code that
works
>or does not work for reasons unknown. When this happens in the GPE
code, I get
>more than nervous.
>
>Bob
>
>
>-----Original Message-----
>From: Zhang, Rui
>Sent: Thursday, April 24, 2008 6:53 PM
>To: Len Brown
>Cc: Moore, Robert; Alexey Starikovskiy; linux-acpi@vger.kernel.org
>Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
>
>
>On Fri, 2008-04-25 at 09:40 +0800, Len Brown wrote:
>> oh goody, i thought this one rang a bell...
>>
>> I'll apply 6217 on top of 9916 (which was already in the test tree,
>> but not on the acpica branch)
>>
>> the error goes away with both applied.
>
>I still don't see why the error messages pop up if 6217 is applied.
>IMO, 6217 won't enable the EC GPE. :(
>
>thanks,
>rui
>
>> On Wednesday 23 April 2008, Moore, Robert wrote:
>> > Alexey,
>> >
>> > I remember there was some discussion on this, but I'm still not
sure
>> why
>> > the patch for 6217 (Ignore GPE if valid and not enabled) makes the
>> other
>> > problem (too early enabling of GPEs) apparent. Please explain.
>> >
>> > Thanks,
>> > Bob
>> >
>> >
>> > >-----Original Message-----
>> > >From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
>> > >Sent: Tuesday, April 22, 2008 10:29 PM
>> > >To: Len Brown
>> > >Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
>> > >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
>> GPEs
>> > >
>> > >Len Brown wrote:
>> > >> On Saturday 12 April 2008, Len Brown wrote:
>> > >>> From: Bob Moore <robert.moore@intel.com>
>> > >>>
>> > >>> Implemented another change to eliminate/suppress spurious or
>> > >>> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
>> > >>> that are neither enabled nor disabled -- meaning that the GPE
is
>> > >>> unknown to the system. This will prevent future interrupts from
>> > >>> that GPE. (Zhang Rui) BZ 6217
>> > >>>
>> > >>> Signed-off-by: Bob Moore <robert.moore@intel.com>
>> > >>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
>> > >>> Signed-off-by: Len Brown <len.brown@intel.com>
>> > >>> ---
>> > >>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
>> > >>>  1 files changed, 8 insertions(+), 1 deletions(-)
>> > >>>
>> > >>> diff --git a/drivers/acpi/events/evgpe.c
>> > b/drivers/acpi/events/evgpe.c
>> > >>> index 897baed..6940f5d 100644
>> > >>> --- a/drivers/acpi/events/evgpe.c
>> > >>> +++ b/drivers/acpi/events/evgpe.c
>> > >>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
>> > >acpi_gpe_event_info *gpe_event_info)
>> > >>>
>> > >>>   ACPI_FUNCTION_TRACE(ev_disable_gpe);
>> > >>>
>> > >>> - if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
>> > >>> + /*
>> > >>> +  * Ignore this if the GPE is valid and not enabled.
>> > >>> +  *
>> > >>> +  * Flags is only zero if GPE is neither enabled or disabled
--
>> > it may
>> > >>> +  * be a spurious or stray GPE -- disable it in the default
>> case
>> > >below.
>> > >>> +  */
>> > >>> + if (gpe_event_info->flags &&
>> > >>> +     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
>> > >>>           return_ACPI_STATUS(AE_OK);
>> > >>>   }
>> > >>>
>> > >>
>> > >>
>> > >> When applied to 2.6.25, the patch above causes ACPI Error
>> messages
>> > below
>> > >on my T61.
>> > >> Certainly this is a case of the EC getting an interrupt (GPE
x02)
>> > before
>> > >it has initialized.
>> > >>
>> > >> Perhaps it breaks the call of acpi_install_gpe_handler() to
>> > >acpi_ev_disable_gpe()?
>> > >Congratulations, now you too hit this one, patch is already
>> there...
>> > >It is wroong to enable GPE before handler for it is installed...
>> > >http://bugzilla.kernel.org/show_bug.cgi?id=9916
>> > >
>> > >>
>> > >> -Len
>> > >>
>> > >>
>> > >>  PCI: Using MMCONFIG at f0000000 - f3ffffff
>> > >>  PCI: Using configuration type 1
>> > >>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE]
4
>> > regs on
>> > >int 0x9
>> > >> +ACPI Error (evregion-0316): No handler for Region [ECOR]
>> > >(ffff81007d35dda0) [EmbeddedControl] [20070126]
>> > >> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
>> handler
>> > >[20070126]
>> > >> +ACPI Error (psparse-0537): Method parse/execution failed
>> > >[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),
>> AE_NOT_EXIST
>> > >> +ACPI Error (psparse-0537): Method parse/execution failed
>> > >[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),
>> AE_NOT_EXIST
>> > >> +ACPI Error (psparse-0537): Method parse/execution failed
>> > [\_GPE._L02]
>> > >(Node ffff81007d376420), AE_NOT_EXIST
>> > >> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE
>> > method
>> > >[_L02] [20070126]
>> > >>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake,
Enabled
>> 3
>> > >Runtime GPEs in this block
>> > >>  ACPI: EC: EC description table is found, configuring boot EC
>> > >> -ACPI: EC: non-query interrupt received, switching to interrupt
>> mode
>> > >> -Completing Region/Field/Buffer/Package
>> >
>>
>initialization:........................................................
>> > ....
>> > >............................................................
>> > >>
>> >
>>
>.......................................................................
>> > ....
>> >
>>
>.......................................................................
>> > ....
>> > >................
>> > >> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
>> > Packages
>> > >(1888 nodes)
>> > >> +Completing Region/Field/Buffer/Package
>> >
>>
>initialization:........................................................
>> > ....
>> > >............................................................
>> > >>
>> >
>>
>.......................................................................
>> > ....
>> >
>>
>.......................................................................
>> > ....
>> > >.................
>> > >> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
>> > Packages
>> > >(1888 nodes)
>> > >>  Initializing Device/Processor/Thermal objects by executing _INI
>> > >methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
>> > >> +ACPI: EC: non-query interrupt received, switching to interrupt
>> mode
>> > >>  .......
>> > >>  Executed 8 _INI methods requiring 2 _STA executions (examined
88
>> > >objects)
>> > >>  ACPI: Interpreter enabled
>> >
>> >
>>
>>
>>
>>


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-05-21  8:28                 ` Zhang, Rui
@ 2008-05-21 16:56                   ` Zhang Rui
  2008-05-22  1:35                     ` Zhao Yakui
                                       ` (2 more replies)
  2008-05-22  1:08                   ` Zhao Yakui
  1 sibling, 3 replies; 123+ messages in thread
From: Zhang Rui @ 2008-05-21 16:56 UTC (permalink / raw)
  To: Moore, Robert; +Cc: Len Brown, Alexey Starikovskiy, linux-acpi, Zhao, Yakui


On Wed, 2008-05-21 at 16:28 +0800, Zhang, Rui wrote:
> Hi, all,
> 
> With Yakui's help, we've root caused this problem.
> 
> For the GPEs with _Lxx/_Exx methods, Linux updates the enable mask but
> doesn't enable them in HW in acpi_ev_gpe_initialize.
> And in acpi_ev_install_fadt_gpes, the GPEs that are shown in _PRW
> methods but don't have _Lxx/_Exx methods are disabled in
> acpi_ev_set_type, before 6217 is applied, the acpi_ev_disable_gpe won't
> write the GPE enable register and everything goes well.
> But with 6217 applied, acpi_ev_disable_gpe will write the GPE enable
> register and enable all the _Lxx/_Exx GPEs as a side effect.
> 
> And the error message is printed out if a _Lxx/_Exx GPE is fired and try
> to access EC address space.
> 
> Of cource this can be solved by Alexey's patch which installs the EC
> address space handler before any GPE is enabled in HW.
> 
> But there is still one problem with both 6217 and 9916 applied which
> I'll talk about in the next email. :)
Please refer to bug 9781 and 10224, where a GPE is used as a wake GPE
and a RUN_WAKE GPE at the same time,

Before 6217 and 9916 are applied, Linux disable the wake GPEs in
acpi_ev_install_fadt_gpes, call _PSW to disable the device's wakeup
ability in acpi_scan_init, and re-enable the GPE as a RUN_WAKE GPE in
acpi_button_add.

But with both 6217 and 9916 applied, Linux enable all the _Lxx/_Exx GPEs
in acpi_ec_ecdt_probe, and won't disable it until
acpi_ev_install_fadt_gpes. And this may bring an interrupt storm because
the _PSW is not called and the wakeup GPE keeps on firing.

IMO, we should revert the 9916 patch because Yakui reproduced the
problem on T61 and confirm it's fixed by a BIOS update, maybe we should
ask the bug reporter to test the new BIOS as well. :)

For bug 6217, we should do the following for stray GPEs:
1. get the current value of GPE_ENABLE register
2. clear the stray GPE bit of GPE_ENABLE register
3. write the value back

Any comments on this?

thanks,
rui

> 
> Thanks,
> Rui
> 
> >-----Original Message-----
> >From: Moore, Robert
> >Sent: Friday, April 25, 2008 9:57 AM
> >To: Zhang, Rui; Len Brown
> >Cc: Alexey Starikovskiy; linux-acpi@vger.kernel.org
> >Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
> >
> >Yes, this is my question also.
> >
> >I hope Alexey can help with this. I'm very nervous about any code that
> works
> >or does not work for reasons unknown. When this happens in the GPE
> code, I get
> >more than nervous.
> >
> >Bob
> >
> >
> >-----Original Message-----
> >From: Zhang, Rui
> >Sent: Thursday, April 24, 2008 6:53 PM
> >To: Len Brown
> >Cc: Moore, Robert; Alexey Starikovskiy; linux-acpi@vger.kernel.org
> >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
> >
> >
> >On Fri, 2008-04-25 at 09:40 +0800, Len Brown wrote:
> >> oh goody, i thought this one rang a bell...
> >>
> >> I'll apply 6217 on top of 9916 (which was already in the test tree,
> >> but not on the acpica branch)
> >>
> >> the error goes away with both applied.
> >
> >I still don't see why the error messages pop up if 6217 is applied.
> >IMO, 6217 won't enable the EC GPE. :(
> >
> >thanks,
> >rui
> >
> >> On Wednesday 23 April 2008, Moore, Robert wrote:
> >> > Alexey,
> >> >
> >> > I remember there was some discussion on this, but I'm still not
> sure
> >> why
> >> > the patch for 6217 (Ignore GPE if valid and not enabled) makes the
> >> other
> >> > problem (too early enabling of GPEs) apparent. Please explain.
> >> >
> >> > Thanks,
> >> > Bob
> >> >
> >> >
> >> > >-----Original Message-----
> >> > >From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
> >> > >Sent: Tuesday, April 22, 2008 10:29 PM
> >> > >To: Len Brown
> >> > >Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
> >> > >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
> >> GPEs
> >> > >
> >> > >Len Brown wrote:
> >> > >> On Saturday 12 April 2008, Len Brown wrote:
> >> > >>> From: Bob Moore <robert.moore@intel.com>
> >> > >>>
> >> > >>> Implemented another change to eliminate/suppress spurious or
> >> > >>> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
> >> > >>> that are neither enabled nor disabled -- meaning that the GPE
> is
> >> > >>> unknown to the system. This will prevent future interrupts from
> >> > >>> that GPE. (Zhang Rui) BZ 6217
> >> > >>>
> >> > >>> Signed-off-by: Bob Moore <robert.moore@intel.com>
> >> > >>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> >> > >>> Signed-off-by: Len Brown <len.brown@intel.com>
> >> > >>> ---
> >> > >>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
> >> > >>>  1 files changed, 8 insertions(+), 1 deletions(-)
> >> > >>>
> >> > >>> diff --git a/drivers/acpi/events/evgpe.c
> >> > b/drivers/acpi/events/evgpe.c
> >> > >>> index 897baed..6940f5d 100644
> >> > >>> --- a/drivers/acpi/events/evgpe.c
> >> > >>> +++ b/drivers/acpi/events/evgpe.c
> >> > >>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
> >> > >acpi_gpe_event_info *gpe_event_info)
> >> > >>>
> >> > >>>   ACPI_FUNCTION_TRACE(ev_disable_gpe);
> >> > >>>
> >> > >>> - if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
> >> > >>> + /*
> >> > >>> +  * Ignore this if the GPE is valid and not enabled.
> >> > >>> +  *
> >> > >>> +  * Flags is only zero if GPE is neither enabled or disabled
> --
> >> > it may
> >> > >>> +  * be a spurious or stray GPE -- disable it in the default
> >> case
> >> > >below.
> >> > >>> +  */
> >> > >>> + if (gpe_event_info->flags &&
> >> > >>> +     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
> >> > >>>           return_ACPI_STATUS(AE_OK);
> >> > >>>   }
> >> > >>>
> >> > >>
> >> > >>
> >> > >> When applied to 2.6.25, the patch above causes ACPI Error
> >> messages
> >> > below
> >> > >on my T61.
> >> > >> Certainly this is a case of the EC getting an interrupt (GPE
> x02)
> >> > before
> >> > >it has initialized.
> >> > >>
> >> > >> Perhaps it breaks the call of acpi_install_gpe_handler() to
> >> > >acpi_ev_disable_gpe()?
> >> > >Congratulations, now you too hit this one, patch is already
> >> there...
> >> > >It is wroong to enable GPE before handler for it is installed...
> >> > >http://bugzilla.kernel.org/show_bug.cgi?id=9916
> >> > >
> >> > >>
> >> > >> -Len
> >> > >>
> >> > >>
> >> > >>  PCI: Using MMCONFIG at f0000000 - f3ffffff
> >> > >>  PCI: Using configuration type 1
> >> > >>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE]
> 4
> >> > regs on
> >> > >int 0x9
> >> > >> +ACPI Error (evregion-0316): No handler for Region [ECOR]
> >> > >(ffff81007d35dda0) [EmbeddedControl] [20070126]
> >> > >> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
> >> handler
> >> > >[20070126]
> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> >> > >[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),
> >> AE_NOT_EXIST
> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> >> > >[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),
> >> AE_NOT_EXIST
> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> >> > [\_GPE._L02]
> >> > >(Node ffff81007d376420), AE_NOT_EXIST
> >> > >> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE
> >> > method
> >> > >[_L02] [20070126]
> >> > >>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake,
> Enabled
> >> 3
> >> > >Runtime GPEs in this block
> >> > >>  ACPI: EC: EC description table is found, configuring boot EC
> >> > >> -ACPI: EC: non-query interrupt received, switching to interrupt
> >> mode
> >> > >> -Completing Region/Field/Buffer/Package
> >> >
> >>
> >initialization:........................................................
> >> > ....
> >> > >............................................................
> >> > >>
> >> >
> >>
> >.......................................................................
> >> > ....
> >> >
> >>
> >.......................................................................
> >> > ....
> >> > >................
> >> > >> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
> >> > Packages
> >> > >(1888 nodes)
> >> > >> +Completing Region/Field/Buffer/Package
> >> >
> >>
> >initialization:........................................................
> >> > ....
> >> > >............................................................
> >> > >>
> >> >
> >>
> >.......................................................................
> >> > ....
> >> >
> >>
> >.......................................................................
> >> > ....
> >> > >.................
> >> > >> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
> >> > Packages
> >> > >(1888 nodes)
> >> > >>  Initializing Device/Processor/Thermal objects by executing _INI
> >> > >methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
> >> > >> +ACPI: EC: non-query interrupt received, switching to interrupt
> >> mode
> >> > >>  .......
> >> > >>  Executed 8 _INI methods requiring 2 _STA executions (examined
> 88
> >> > >objects)
> >> > >>  ACPI: Interpreter enabled
> >> >
> >> >
> >>
> >>
> >>
> >>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-05-21  8:28                 ` Zhang, Rui
  2008-05-21 16:56                   ` Zhang Rui
@ 2008-05-22  1:08                   ` Zhao Yakui
  1 sibling, 0 replies; 123+ messages in thread
From: Zhao Yakui @ 2008-05-22  1:08 UTC (permalink / raw)
  To: Zhang, Rui; +Cc: Moore, Robert, Len Brown, Alexey Starikovskiy, linux-acpi

On Wed, 2008-05-21 at 16:28 +0800, Zhang, Rui wrote:
> Hi, all,
> 
> With Yakui's help, we've root caused this problem.
> 
> For the GPEs with _Lxx/_Exx methods, Linux updates the enable mask but
> doesn't enable them in HW in acpi_ev_gpe_initialize.
> And in acpi_ev_install_fadt_gpes, the GPEs that are shown in _PRW
> methods but don't have _Lxx/_Exx methods are disabled in
> acpi_ev_set_type, before 6217 is applied, the acpi_ev_disable_gpe won't
> write the GPE enable register and everything goes well.
Agree. For the _PRW GPE ,the GPE will be firstly disabled when the GPE
type is switched from TYPE_RUN to TYPE_WAKE. Before the patch in bug
6217 is applied, acpi_ev_disable_gpe only updates the mask bit and won't
access the GPE enable register. After the patch is applied, the _PRW GPE
without _LXX/_EXX method will be treated as the stray GPE. The GPE
enable register will be accessed and the side effect is that some GPEs
with _LXX/EXX are also enabled. In fact this is not what we expected.
Maybe it is reasonable that OS clears the responding GPE bit in the GPE
enable register when disabling the stray GPE. 

> But with 6217 applied, acpi_ev_disable_gpe will write the GPE enable
> register and enable all the _Lxx/_Exx GPEs as a side effect.
> 
> And the error message is printed out if a _Lxx/_Exx GPE is fired and try
> to access EC address space.
> 
> Of cource this can be solved by Alexey's patch which installs the EC
> address space handler before any GPE is enabled in HW.
> 
> But there is still one problem with both 6217 and 9916 applied which
> I'll talk about in the next email. :)
> 
> Thanks,
> Rui
> 
> >-----Original Message-----
> >From: Moore, Robert
> >Sent: Friday, April 25, 2008 9:57 AM
> >To: Zhang, Rui; Len Brown
> >Cc: Alexey Starikovskiy; linux-acpi@vger.kernel.org
> >Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
> >
> >Yes, this is my question also.
> >
> >I hope Alexey can help with this. I'm very nervous about any code that
> works
> >or does not work for reasons unknown. When this happens in the GPE
> code, I get
> >more than nervous.
> >
> >Bob
> >
> >
> >-----Original Message-----
> >From: Zhang, Rui
> >Sent: Thursday, April 24, 2008 6:53 PM
> >To: Len Brown
> >Cc: Moore, Robert; Alexey Starikovskiy; linux-acpi@vger.kernel.org
> >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
> >
> >
> >On Fri, 2008-04-25 at 09:40 +0800, Len Brown wrote:
> >> oh goody, i thought this one rang a bell...
> >>
> >> I'll apply 6217 on top of 9916 (which was already in the test tree,
> >> but not on the acpica branch)
> >>
> >> the error goes away with both applied.
> >
> >I still don't see why the error messages pop up if 6217 is applied.
> >IMO, 6217 won't enable the EC GPE. :(
> >
> >thanks,
> >rui
> >
> >> On Wednesday 23 April 2008, Moore, Robert wrote:
> >> > Alexey,
> >> >
> >> > I remember there was some discussion on this, but I'm still not
> sure
> >> why
> >> > the patch for 6217 (Ignore GPE if valid and not enabled) makes the
> >> other
> >> > problem (too early enabling of GPEs) apparent. Please explain.
> >> >
> >> > Thanks,
> >> > Bob
> >> >
> >> >
> >> > >-----Original Message-----
> >> > >From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
> >> > >Sent: Tuesday, April 22, 2008 10:29 PM
> >> > >To: Len Brown
> >> > >Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
> >> > >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
> >> GPEs
> >> > >
> >> > >Len Brown wrote:
> >> > >> On Saturday 12 April 2008, Len Brown wrote:
> >> > >>> From: Bob Moore <robert.moore@intel.com>
> >> > >>>
> >> > >>> Implemented another change to eliminate/suppress spurious or
> >> > >>> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
> >> > >>> that are neither enabled nor disabled -- meaning that the GPE
> is
> >> > >>> unknown to the system. This will prevent future interrupts from
> >> > >>> that GPE. (Zhang Rui) BZ 6217
> >> > >>>
> >> > >>> Signed-off-by: Bob Moore <robert.moore@intel.com>
> >> > >>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> >> > >>> Signed-off-by: Len Brown <len.brown@intel.com>
> >> > >>> ---
> >> > >>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
> >> > >>>  1 files changed, 8 insertions(+), 1 deletions(-)
> >> > >>>
> >> > >>> diff --git a/drivers/acpi/events/evgpe.c
> >> > b/drivers/acpi/events/evgpe.c
> >> > >>> index 897baed..6940f5d 100644
> >> > >>> --- a/drivers/acpi/events/evgpe.c
> >> > >>> +++ b/drivers/acpi/events/evgpe.c
> >> > >>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
> >> > >acpi_gpe_event_info *gpe_event_info)
> >> > >>>
> >> > >>>   ACPI_FUNCTION_TRACE(ev_disable_gpe);
> >> > >>>
> >> > >>> - if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
> >> > >>> + /*
> >> > >>> +  * Ignore this if the GPE is valid and not enabled.
> >> > >>> +  *
> >> > >>> +  * Flags is only zero if GPE is neither enabled or disabled
> --
> >> > it may
> >> > >>> +  * be a spurious or stray GPE -- disable it in the default
> >> case
> >> > >below.
> >> > >>> +  */
> >> > >>> + if (gpe_event_info->flags &&
> >> > >>> +     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
> >> > >>>           return_ACPI_STATUS(AE_OK);
> >> > >>>   }
> >> > >>>
> >> > >>
> >> > >>
> >> > >> When applied to 2.6.25, the patch above causes ACPI Error
> >> messages
> >> > below
> >> > >on my T61.
> >> > >> Certainly this is a case of the EC getting an interrupt (GPE
> x02)
> >> > before
> >> > >it has initialized.
> >> > >>
> >> > >> Perhaps it breaks the call of acpi_install_gpe_handler() to
> >> > >acpi_ev_disable_gpe()?
> >> > >Congratulations, now you too hit this one, patch is already
> >> there...
> >> > >It is wroong to enable GPE before handler for it is installed...
> >> > >http://bugzilla.kernel.org/show_bug.cgi?id=9916
> >> > >
> >> > >>
> >> > >> -Len
> >> > >>
> >> > >>
> >> > >>  PCI: Using MMCONFIG at f0000000 - f3ffffff
> >> > >>  PCI: Using configuration type 1
> >> > >>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE]
> 4
> >> > regs on
> >> > >int 0x9
> >> > >> +ACPI Error (evregion-0316): No handler for Region [ECOR]
> >> > >(ffff81007d35dda0) [EmbeddedControl] [20070126]
> >> > >> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
> >> handler
> >> > >[20070126]
> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> >> > >[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),
> >> AE_NOT_EXIST
> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> >> > >[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),
> >> AE_NOT_EXIST
> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> >> > [\_GPE._L02]
> >> > >(Node ffff81007d376420), AE_NOT_EXIST
> >> > >> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE
> >> > method
> >> > >[_L02] [20070126]
> >> > >>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake,
> Enabled
> >> 3
> >> > >Runtime GPEs in this block
> >> > >>  ACPI: EC: EC description table is found, configuring boot EC
> >> > >> -ACPI: EC: non-query interrupt received, switching to interrupt
> >> mode
> >> > >> -Completing Region/Field/Buffer/Package
> >> >
> >>
> >initialization:........................................................
> >> > ....
> >> > >............................................................
> >> > >>
> >> >
> >>
> >.......................................................................
> >> > ....
> >> >
> >>
> >.......................................................................
> >> > ....
> >> > >................
> >> > >> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
> >> > Packages
> >> > >(1888 nodes)
> >> > >> +Completing Region/Field/Buffer/Package
> >> >
> >>
> >initialization:........................................................
> >> > ....
> >> > >............................................................
> >> > >>
> >> >
> >>
> >.......................................................................
> >> > ....
> >> >
> >>
> >.......................................................................
> >> > ....
> >> > >.................
> >> > >> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
> >> > Packages
> >> > >(1888 nodes)
> >> > >>  Initializing Device/Processor/Thermal objects by executing _INI
> >> > >methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
> >> > >> +ACPI: EC: non-query interrupt received, switching to interrupt
> >> mode
> >> > >>  .......
> >> > >>  Executed 8 _INI methods requiring 2 _STA executions (examined
> 88
> >> > >objects)
> >> > >>  ACPI: Interpreter enabled
> >> >
> >> >
> >>
> >>
> >>
> >>
> 


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-05-21 16:56                   ` Zhang Rui
@ 2008-05-22  1:35                     ` Zhao Yakui
  2008-05-22 16:45                     ` Moore, Robert
  2008-05-28 17:40                     ` Moore, Robert
  2 siblings, 0 replies; 123+ messages in thread
From: Zhao Yakui @ 2008-05-22  1:35 UTC (permalink / raw)
  To: Zhang Rui; +Cc: Moore, Robert, Len Brown, Alexey Starikovskiy, linux-acpi

On Thu, 2008-05-22 at 00:56 +0800, Zhang Rui wrote:
> On Wed, 2008-05-21 at 16:28 +0800, Zhang, Rui wrote:
> > Hi, all,
> > 
> > With Yakui's help, we've root caused this problem.
> > 
> > For the GPEs with _Lxx/_Exx methods, Linux updates the enable mask but
> > doesn't enable them in HW in acpi_ev_gpe_initialize.
> > And in acpi_ev_install_fadt_gpes, the GPEs that are shown in _PRW
> > methods but don't have _Lxx/_Exx methods are disabled in
> > acpi_ev_set_type, before 6217 is applied, the acpi_ev_disable_gpe won't
> > write the GPE enable register and everything goes well.
> > But with 6217 applied, acpi_ev_disable_gpe will write the GPE enable
> > register and enable all the _Lxx/_Exx GPEs as a side effect.
> > 
> > And the error message is printed out if a _Lxx/_Exx GPE is fired and try
> > to access EC address space.
> > 
> > Of cource this can be solved by Alexey's patch which installs the EC
> > address space handler before any GPE is enabled in HW.
> > 
> > But there is still one problem with both 6217 and 9916 applied which
> > I'll talk about in the next email. :)
> Please refer to bug 9781 and 10224, where a GPE is used as a wake GPE
> and a RUN_WAKE GPE at the same time,
> 
> Before 6217 and 9916 are applied, Linux disable the wake GPEs in
> acpi_ev_install_fadt_gpes, call _PSW to disable the device's wakeup
> ability in acpi_scan_init, and re-enable the GPE as a RUN_WAKE GPE in
> acpi_button_add.
> 
> But with both 6217 and 9916 applied, Linux enable all the _Lxx/_Exx GPEs
> in acpi_ec_ecdt_probe, and won't disable it until
> acpi_ev_install_fadt_gpes. And this may bring an interrupt storm because
> the _PSW is not called and the wakeup GPE keeps on firing.
What your said is right.  
The _PRW GPE will be disabled and all the other RUN_TIME GPEs will
enabled in the function of acpi_ev_install_fadt_gpes. 
After the patches in bug 9916 is applied, some _PRW GPEs will be enabled
when EC GPE is enabled in the course of EC initialization. Before the
_PRW GPE is disabled again, maybe there will be interrupt storm.
> IMO, we should revert the 9916 patch because Yakui reproduced the
> problem on T61 and confirm it's fixed by a BIOS update, maybe we should
> ask the bug reporter to test the new BIOS as well. :)
Agree.  It is very lucky that there is T61 notebook in hand. The error
can be fixed by upgrading BIOS. 
The patch in bug 9916 expectes that FADT GPEs are enabled after EC is
initialized. In fact this is applicable only for the bios with ECDT
table.(Of course the EC device with _INI object is also OK.). When there
is no ECDT table and the EC device has no _INI object, the FADT GPEs
still are enabled before EC initialization.

> For bug 6217, we should do the following for stray GPEs:
> 1. get the current value of GPE_ENABLE register
> 2. clear the stray GPE bit of GPE_ENABLE register
> 3. write the value back
Agree. It is reasonable that OS clears the corresponding GPE bit of GPE
enable register when the stray GPE is disabled.
> 
> Any comments on this?
> 
> thanks,
> rui
> 
> > 
> > Thanks,
> > Rui
> > 
> > >-----Original Message-----
> > >From: Moore, Robert
> > >Sent: Friday, April 25, 2008 9:57 AM
> > >To: Zhang, Rui; Len Brown
> > >Cc: Alexey Starikovskiy; linux-acpi@vger.kernel.org
> > >Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
> > >
> > >Yes, this is my question also.
> > >
> > >I hope Alexey can help with this. I'm very nervous about any code that
> > works
> > >or does not work for reasons unknown. When this happens in the GPE
> > code, I get
> > >more than nervous.
> > >
> > >Bob
> > >
> > >
> > >-----Original Message-----
> > >From: Zhang, Rui
> > >Sent: Thursday, April 24, 2008 6:53 PM
> > >To: Len Brown
> > >Cc: Moore, Robert; Alexey Starikovskiy; linux-acpi@vger.kernel.org
> > >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
> > >
> > >
> > >On Fri, 2008-04-25 at 09:40 +0800, Len Brown wrote:
> > >> oh goody, i thought this one rang a bell...
> > >>
> > >> I'll apply 6217 on top of 9916 (which was already in the test tree,
> > >> but not on the acpica branch)
> > >>
> > >> the error goes away with both applied.
> > >
> > >I still don't see why the error messages pop up if 6217 is applied.
> > >IMO, 6217 won't enable the EC GPE. :(
> > >
> > >thanks,
> > >rui
> > >
> > >> On Wednesday 23 April 2008, Moore, Robert wrote:
> > >> > Alexey,
> > >> >
> > >> > I remember there was some discussion on this, but I'm still not
> > sure
> > >> why
> > >> > the patch for 6217 (Ignore GPE if valid and not enabled) makes the
> > >> other
> > >> > problem (too early enabling of GPEs) apparent. Please explain.
> > >> >
> > >> > Thanks,
> > >> > Bob
> > >> >
> > >> >
> > >> > >-----Original Message-----
> > >> > >From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
> > >> > >Sent: Tuesday, April 22, 2008 10:29 PM
> > >> > >To: Len Brown
> > >> > >Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
> > >> > >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
> > >> GPEs
> > >> > >
> > >> > >Len Brown wrote:
> > >> > >> On Saturday 12 April 2008, Len Brown wrote:
> > >> > >>> From: Bob Moore <robert.moore@intel.com>
> > >> > >>>
> > >> > >>> Implemented another change to eliminate/suppress spurious or
> > >> > >>> stray GPEs. The AcpiEvDisableGpe function will now disable GPEs
> > >> > >>> that are neither enabled nor disabled -- meaning that the GPE
> > is
> > >> > >>> unknown to the system. This will prevent future interrupts from
> > >> > >>> that GPE. (Zhang Rui) BZ 6217
> > >> > >>>
> > >> > >>> Signed-off-by: Bob Moore <robert.moore@intel.com>
> > >> > >>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> > >> > >>> Signed-off-by: Len Brown <len.brown@intel.com>
> > >> > >>> ---
> > >> > >>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
> > >> > >>>  1 files changed, 8 insertions(+), 1 deletions(-)
> > >> > >>>
> > >> > >>> diff --git a/drivers/acpi/events/evgpe.c
> > >> > b/drivers/acpi/events/evgpe.c
> > >> > >>> index 897baed..6940f5d 100644
> > >> > >>> --- a/drivers/acpi/events/evgpe.c
> > >> > >>> +++ b/drivers/acpi/events/evgpe.c
> > >> > >>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
> > >> > >acpi_gpe_event_info *gpe_event_info)
> > >> > >>>
> > >> > >>>   ACPI_FUNCTION_TRACE(ev_disable_gpe);
> > >> > >>>
> > >> > >>> - if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
> > >> > >>> + /*
> > >> > >>> +  * Ignore this if the GPE is valid and not enabled.
> > >> > >>> +  *
> > >> > >>> +  * Flags is only zero if GPE is neither enabled or disabled
> > --
> > >> > it may
> > >> > >>> +  * be a spurious or stray GPE -- disable it in the default
> > >> case
> > >> > >below.
> > >> > >>> +  */
> > >> > >>> + if (gpe_event_info->flags &&
> > >> > >>> +     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
> > >> > >>>           return_ACPI_STATUS(AE_OK);
> > >> > >>>   }
> > >> > >>>
> > >> > >>
> > >> > >>
> > >> > >> When applied to 2.6.25, the patch above causes ACPI Error
> > >> messages
> > >> > below
> > >> > >on my T61.
> > >> > >> Certainly this is a case of the EC getting an interrupt (GPE
> > x02)
> > >> > before
> > >> > >it has initialized.
> > >> > >>
> > >> > >> Perhaps it breaks the call of acpi_install_gpe_handler() to
> > >> > >acpi_ev_disable_gpe()?
> > >> > >Congratulations, now you too hit this one, patch is already
> > >> there...
> > >> > >It is wroong to enable GPE before handler for it is installed...
> > >> > >http://bugzilla.kernel.org/show_bug.cgi?id=9916
> > >> > >
> > >> > >>
> > >> > >> -Len
> > >> > >>
> > >> > >>
> > >> > >>  PCI: Using MMCONFIG at f0000000 - f3ffffff
> > >> > >>  PCI: Using configuration type 1
> > >> > >>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F [_GPE]
> > 4
> > >> > regs on
> > >> > >int 0x9
> > >> > >> +ACPI Error (evregion-0316): No handler for Region [ECOR]
> > >> > >(ffff81007d35dda0) [EmbeddedControl] [20070126]
> > >> > >> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
> > >> handler
> > >> > >[20070126]
> > >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> > >> > >[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),
> > >> AE_NOT_EXIST
> > >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> > >> > >[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),
> > >> AE_NOT_EXIST
> > >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
> > >> > [\_GPE._L02]
> > >> > >(Node ffff81007d376420), AE_NOT_EXIST
> > >> > >> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE
> > >> > method
> > >> > >[_L02] [20070126]
> > >> > >>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake,
> > Enabled
> > >> 3
> > >> > >Runtime GPEs in this block
> > >> > >>  ACPI: EC: EC description table is found, configuring boot EC
> > >> > >> -ACPI: EC: non-query interrupt received, switching to interrupt
> > >> mode
> > >> > >> -Completing Region/Field/Buffer/Package
> > >> >
> > >>
> > >initialization:........................................................
> > >> > ....
> > >> > >............................................................
> > >> > >>
> > >> >
> > >>
> > >.......................................................................
> > >> > ....
> > >> >
> > >>
> > >.......................................................................
> > >> > ....
> > >> > >................
> > >> > >> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
> > >> > Packages
> > >> > >(1888 nodes)
> > >> > >> +Completing Region/Field/Buffer/Package
> > >> >
> > >>
> > >initialization:........................................................
> > >> > ....
> > >> > >............................................................
> > >> > >>
> > >> >
> > >>
> > >.......................................................................
> > >> > ....
> > >> >
> > >>
> > >.......................................................................
> > >> > ....
> > >> > >.................
> > >> > >> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
> > >> > Packages
> > >> > >(1888 nodes)
> > >> > >>  Initializing Device/Processor/Thermal objects by executing _INI
> > >> > >methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
> > >> > >> +ACPI: EC: non-query interrupt received, switching to interrupt
> > >> mode
> > >> > >>  .......
> > >> > >>  Executed 8 _INI methods requiring 2 _STA executions (examined
> > 88
> > >> > >objects)
> > >> > >>  ACPI: Interpreter enabled
> > >> >
> > >> >
> > >>
> > >>
> > >>
> > >>
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-05-21 16:56                   ` Zhang Rui
  2008-05-22  1:35                     ` Zhao Yakui
@ 2008-05-22 16:45                     ` Moore, Robert
  2008-05-22 16:55                       ` Alexey Starikovskiy
  2008-05-28 17:40                     ` Moore, Robert
  2 siblings, 1 reply; 123+ messages in thread
From: Moore, Robert @ 2008-05-22 16:45 UTC (permalink / raw)
  To: Zhang, Rui, Therien, Guy
  Cc: Len Brown, Alexey Starikovskiy, linux-acpi, Zhao, Yakui

Rui,

Thanks for examining this issue in detail. Your proposal to
read/update/write the GPE enable register to simply disable one GPE
sounds interesting. I want to think about this a bit more -- it has been
a long time since I have looked closely at the GPE handling.

With my discussions with Alexey Starikovskiy, we have concluded that
there is something incorrect about the current design, where there exist
windows where a GPE could come in with no driver available to handle it.

I'm no longer intimate with the GPE handling model, but it would seem to
me that GPEs should be treated like other interrupts where an interrupt
level remains disabled until a driver is installed which in turn calls
the kernel to install a handler for that interrupt. Only then can the
interrupt be safely enabled.

There is added complexity since drivers (with the exception of the
Embedded Controller) do not handle GPEs directly; instead, an _Lxx/_Exx
method is run which in turn (usually) generates a Notify on a device. We
expect the device driver for the device to have installed a notify
handler.

So it would seem to me that it would be architecturally best to leave a
GPE disabled until either a handler for the GPE is installed, or a
notify handler is installed for the device associated with the GPE.

What am I missing?
Bob


>-----Original Message-----
>From: Zhang, Rui
>Sent: Wednesday, May 21, 2008 9:56 AM
>To: Moore, Robert
>Cc: Len Brown; Alexey Starikovskiy; linux-acpi@vger.kernel.org; Zhao,
Yakui
>Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
>
>
>On Wed, 2008-05-21 at 16:28 +0800, Zhang, Rui wrote:
>> Hi, all,
>>
>> With Yakui's help, we've root caused this problem.
>>
>> For the GPEs with _Lxx/_Exx methods, Linux updates the enable mask
but
>> doesn't enable them in HW in acpi_ev_gpe_initialize.
>> And in acpi_ev_install_fadt_gpes, the GPEs that are shown in _PRW
>> methods but don't have _Lxx/_Exx methods are disabled in
>> acpi_ev_set_type, before 6217 is applied, the acpi_ev_disable_gpe
won't
>> write the GPE enable register and everything goes well.
>> But with 6217 applied, acpi_ev_disable_gpe will write the GPE enable
>> register and enable all the _Lxx/_Exx GPEs as a side effect.
>>
>> And the error message is printed out if a _Lxx/_Exx GPE is fired and
try
>> to access EC address space.
>>
>> Of cource this can be solved by Alexey's patch which installs the EC
>> address space handler before any GPE is enabled in HW.
>>
>> But there is still one problem with both 6217 and 9916 applied which
>> I'll talk about in the next email. :)
>Please refer to bug 9781 and 10224, where a GPE is used as a wake GPE
>and a RUN_WAKE GPE at the same time,
>
>Before 6217 and 9916 are applied, Linux disable the wake GPEs in
>acpi_ev_install_fadt_gpes, call _PSW to disable the device's wakeup
>ability in acpi_scan_init, and re-enable the GPE as a RUN_WAKE GPE in
>acpi_button_add.
>
>But with both 6217 and 9916 applied, Linux enable all the _Lxx/_Exx
GPEs
>in acpi_ec_ecdt_probe, and won't disable it until
>acpi_ev_install_fadt_gpes. And this may bring an interrupt storm
because
>the _PSW is not called and the wakeup GPE keeps on firing.
>
>IMO, we should revert the 9916 patch because Yakui reproduced the
>problem on T61 and confirm it's fixed by a BIOS update, maybe we should
>ask the bug reporter to test the new BIOS as well. :)
>
>For bug 6217, we should do the following for stray GPEs:
>1. get the current value of GPE_ENABLE register
>2. clear the stray GPE bit of GPE_ENABLE register
>3. write the value back
>
>Any comments on this?
>
>thanks,
>rui
>
>>
>> Thanks,
>> Rui
>>
>> >-----Original Message-----
>> >From: Moore, Robert
>> >Sent: Friday, April 25, 2008 9:57 AM
>> >To: Zhang, Rui; Len Brown
>> >Cc: Alexey Starikovskiy; linux-acpi@vger.kernel.org
>> >Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
GPEs
>> >
>> >Yes, this is my question also.
>> >
>> >I hope Alexey can help with this. I'm very nervous about any code
that
>> works
>> >or does not work for reasons unknown. When this happens in the GPE
>> code, I get
>> >more than nervous.
>> >
>> >Bob
>> >
>> >
>> >-----Original Message-----
>> >From: Zhang, Rui
>> >Sent: Thursday, April 24, 2008 6:53 PM
>> >To: Len Brown
>> >Cc: Moore, Robert; Alexey Starikovskiy; linux-acpi@vger.kernel.org
>> >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
GPEs
>> >
>> >
>> >On Fri, 2008-04-25 at 09:40 +0800, Len Brown wrote:
>> >> oh goody, i thought this one rang a bell...
>> >>
>> >> I'll apply 6217 on top of 9916 (which was already in the test
tree,
>> >> but not on the acpica branch)
>> >>
>> >> the error goes away with both applied.
>> >
>> >I still don't see why the error messages pop up if 6217 is applied.
>> >IMO, 6217 won't enable the EC GPE. :(
>> >
>> >thanks,
>> >rui
>> >
>> >> On Wednesday 23 April 2008, Moore, Robert wrote:
>> >> > Alexey,
>> >> >
>> >> > I remember there was some discussion on this, but I'm still not
>> sure
>> >> why
>> >> > the patch for 6217 (Ignore GPE if valid and not enabled) makes
the
>> >> other
>> >> > problem (too early enabling of GPEs) apparent. Please explain.
>> >> >
>> >> > Thanks,
>> >> > Bob
>> >> >
>> >> >
>> >> > >-----Original Message-----
>> >> > >From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
>> >> > >Sent: Tuesday, April 22, 2008 10:29 PM
>> >> > >To: Len Brown
>> >> > >Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
>> >> > >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown
spurious
>> >> GPEs
>> >> > >
>> >> > >Len Brown wrote:
>> >> > >> On Saturday 12 April 2008, Len Brown wrote:
>> >> > >>> From: Bob Moore <robert.moore@intel.com>
>> >> > >>>
>> >> > >>> Implemented another change to eliminate/suppress spurious or
>> >> > >>> stray GPEs. The AcpiEvDisableGpe function will now disable
GPEs
>> >> > >>> that are neither enabled nor disabled -- meaning that the
GPE
>> is
>> >> > >>> unknown to the system. This will prevent future interrupts
from
>> >> > >>> that GPE. (Zhang Rui) BZ 6217
>> >> > >>>
>> >> > >>> Signed-off-by: Bob Moore <robert.moore@intel.com>
>> >> > >>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
>> >> > >>> Signed-off-by: Len Brown <len.brown@intel.com>
>> >> > >>> ---
>> >> > >>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
>> >> > >>>  1 files changed, 8 insertions(+), 1 deletions(-)
>> >> > >>>
>> >> > >>> diff --git a/drivers/acpi/events/evgpe.c
>> >> > b/drivers/acpi/events/evgpe.c
>> >> > >>> index 897baed..6940f5d 100644
>> >> > >>> --- a/drivers/acpi/events/evgpe.c
>> >> > >>> +++ b/drivers/acpi/events/evgpe.c
>> >> > >>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
>> >> > >acpi_gpe_event_info *gpe_event_info)
>> >> > >>>
>> >> > >>>   ACPI_FUNCTION_TRACE(ev_disable_gpe);
>> >> > >>>
>> >> > >>> - if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
>> >> > >>> + /*
>> >> > >>> +  * Ignore this if the GPE is valid and not enabled.
>> >> > >>> +  *
>> >> > >>> +  * Flags is only zero if GPE is neither enabled or
disabled
>> --
>> >> > it may
>> >> > >>> +  * be a spurious or stray GPE -- disable it in the default
>> >> case
>> >> > >below.
>> >> > >>> +  */
>> >> > >>> + if (gpe_event_info->flags &&
>> >> > >>> +     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
>> >> > >>>           return_ACPI_STATUS(AE_OK);
>> >> > >>>   }
>> >> > >>>
>> >> > >>
>> >> > >>
>> >> > >> When applied to 2.6.25, the patch above causes ACPI Error
>> >> messages
>> >> > below
>> >> > >on my T61.
>> >> > >> Certainly this is a case of the EC getting an interrupt (GPE
>> x02)
>> >> > before
>> >> > >it has initialized.
>> >> > >>
>> >> > >> Perhaps it breaks the call of acpi_install_gpe_handler() to
>> >> > >acpi_ev_disable_gpe()?
>> >> > >Congratulations, now you too hit this one, patch is already
>> >> there...
>> >> > >It is wroong to enable GPE before handler for it is
installed...
>> >> > >http://bugzilla.kernel.org/show_bug.cgi?id=9916
>> >> > >
>> >> > >>
>> >> > >> -Len
>> >> > >>
>> >> > >>
>> >> > >>  PCI: Using MMCONFIG at f0000000 - f3ffffff
>> >> > >>  PCI: Using configuration type 1
>> >> > >>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F
[_GPE]
>> 4
>> >> > regs on
>> >> > >int 0x9
>> >> > >> +ACPI Error (evregion-0316): No handler for Region [ECOR]
>> >> > >(ffff81007d35dda0) [EmbeddedControl] [20070126]
>> >> > >> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
>> >> handler
>> >> > >[20070126]
>> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
>> >> > >[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),
>> >> AE_NOT_EXIST
>> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
>> >> > >[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),
>> >> AE_NOT_EXIST
>> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
>> >> > [\_GPE._L02]
>> >> > >(Node ffff81007d376420), AE_NOT_EXIST
>> >> > >> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating
GPE
>> >> > method
>> >> > >[_L02] [20070126]
>> >> > >>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake,
>> Enabled
>> >> 3
>> >> > >Runtime GPEs in this block
>> >> > >>  ACPI: EC: EC description table is found, configuring boot EC
>> >> > >> -ACPI: EC: non-query interrupt received, switching to
interrupt
>> >> mode
>> >> > >> -Completing Region/Field/Buffer/Package
>> >> >
>> >>
>>
>initialization:........................................................
>> >> > ....
>> >> > >............................................................
>> >> > >>
>> >> >
>> >>
>>
>.......................................................................
>> >> > ....
>> >> >
>> >>
>>
>.......................................................................
>> >> > ....
>> >> > >................
>> >> > >> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
>> >> > Packages
>> >> > >(1888 nodes)
>> >> > >> +Completing Region/Field/Buffer/Package
>> >> >
>> >>
>>
>initialization:........................................................
>> >> > ....
>> >> > >............................................................
>> >> > >>
>> >> >
>> >>
>>
>.......................................................................
>> >> > ....
>> >> >
>> >>
>>
>.......................................................................
>> >> > ....
>> >> > >.................
>> >> > >> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
>> >> > Packages
>> >> > >(1888 nodes)
>> >> > >>  Initializing Device/Processor/Thermal objects by executing
_INI
>> >> > >methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
>> >> > >> +ACPI: EC: non-query interrupt received, switching to
interrupt
>> >> mode
>> >> > >>  .......
>> >> > >>  Executed 8 _INI methods requiring 2 _STA executions
(examined
>> 88
>> >> > >objects)
>> >> > >>  ACPI: Interpreter enabled
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-acpi"
in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 123+ messages in thread

* Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-05-22 16:45                     ` Moore, Robert
@ 2008-05-22 16:55                       ` Alexey Starikovskiy
  2008-05-22 17:22                         ` Moore, Robert
  0 siblings, 1 reply; 123+ messages in thread
From: Alexey Starikovskiy @ 2008-05-22 16:55 UTC (permalink / raw)
  To: Moore, Robert
  Cc: Zhang, Rui, Therien, Guy, Len Brown, Alexey Starikovskiy,
	linux-acpi, Zhao, Yakui

Moore, Robert wrote:
> Rui,
>
> Thanks for examining this issue in detail. Your proposal to
> read/update/write the GPE enable register to simply disable one GPE
> sounds interesting. I want to think about this a bit more -- it has been
> a long time since I have looked closely at the GPE handling.
>
> With my discussions with Alexey Starikovskiy, we have concluded that
> there is something incorrect about the current design, where there exist
> windows where a GPE could come in with no driver available to handle it.
>
> I'm no longer intimate with the GPE handling model, but it would seem to
> me that GPEs should be treated like other interrupts where an interrupt
> level remains disabled until a driver is installed which in turn calls
> the kernel to install a handler for that interrupt. Only then can the
> interrupt be safely enabled.
>
> There is added complexity since drivers (with the exception of the
> Embedded Controller) do not handle GPEs directly; instead, an _Lxx/_Exx
> method is run which in turn (usually) generates a Notify on a device. We
> expect the device driver for the device to have installed a notify
> handler.
>
> So it would seem to me that it would be architecturally best to leave a
> GPE disabled until either a handler for the GPE is installed, or a
> notify handler is installed for the device associated with the GPE.
>
>   
Currently, there is no way to tell if GPE hanler method would
do Notify() to some device.  There could be any number of calls to other
methods, which might cause call of Notify().
So, probably this is a dead end.
The only implementable way I see is to move enabling of _Lxx/_Exx GPEs to
after bus scan, there we have devices autoloaded and installed.

Regards,
Alex.

^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-05-22 16:55                       ` Alexey Starikovskiy
@ 2008-05-22 17:22                         ` Moore, Robert
  0 siblings, 0 replies; 123+ messages in thread
From: Moore, Robert @ 2008-05-22 17:22 UTC (permalink / raw)
  To: Alexey Starikovskiy
  Cc: Zhang, Rui, Therien, Guy, Len Brown, Alexey Starikovskiy,
	linux-acpi, Zhao, Yakui

>Currently, there is no way to tell if GPE hanler method would
>do Notify() to some device.

Yep, I thought that might be the issue.

So, GPE is an interrupt mechanism with no way to map an interrupt to a
particular device or driver. So I guess that it is then appropriate for
us to simply enable all GPEs that have associated _Lxx/_Exx methods, and
hope that a driver will come along sometime to handle any associated
notifies. Meaning that all GPEs from the device will be missed until
such time as the driver is loaded.

What if ACPICA did not enable GPEs until after it received a call from
the host that the namespace has been scanned, and all ACPI-related
drivers have been loaded and initialized? Instead of one-by-one enabling
GPEs as drivers came up, wait until *all* drivers are ready?

Bob


>-----Original Message-----
>From: Alexey Starikovskiy [mailto:aystarik@gmail.com]
>Sent: Thursday, May 22, 2008 9:56 AM
>To: Moore, Robert
>Cc: Zhang, Rui; Therien, Guy; Len Brown; Alexey Starikovskiy; linux-
>acpi@vger.kernel.org; Zhao, Yakui
>Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
>
>Moore, Robert wrote:
>> Rui,
>>
>> Thanks for examining this issue in detail. Your proposal to
>> read/update/write the GPE enable register to simply disable one GPE
>> sounds interesting. I want to think about this a bit more -- it has
been
>> a long time since I have looked closely at the GPE handling.
>>
>> With my discussions with Alexey Starikovskiy, we have concluded that
>> there is something incorrect about the current design, where there
exist
>> windows where a GPE could come in with no driver available to handle
it.
>>
>> I'm no longer intimate with the GPE handling model, but it would seem
to
>> me that GPEs should be treated like other interrupts where an
interrupt
>> level remains disabled until a driver is installed which in turn
calls
>> the kernel to install a handler for that interrupt. Only then can the
>> interrupt be safely enabled.
>>
>> There is added complexity since drivers (with the exception of the
>> Embedded Controller) do not handle GPEs directly; instead, an
_Lxx/_Exx
>> method is run which in turn (usually) generates a Notify on a device.
We
>> expect the device driver for the device to have installed a notify
>> handler.
>>
>> So it would seem to me that it would be architecturally best to leave
a
>> GPE disabled until either a handler for the GPE is installed, or a
>> notify handler is installed for the device associated with the GPE.
>>
>>
>Currently, there is no way to tell if GPE hanler method would
>do Notify() to some device.  There could be any number of calls to
other
>methods, which might cause call of Notify().
>So, probably this is a dead end.
>The only implementable way I see is to move enabling of _Lxx/_Exx GPEs
to
>after bus scan, there we have devices autoloaded and installed.
>
>Regards,
>Alex.

^ permalink raw reply	[flat|nested] 123+ messages in thread

* RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
  2008-05-21 16:56                   ` Zhang Rui
  2008-05-22  1:35                     ` Zhao Yakui
  2008-05-22 16:45                     ` Moore, Robert
@ 2008-05-28 17:40                     ` Moore, Robert
  2 siblings, 0 replies; 123+ messages in thread
From: Moore, Robert @ 2008-05-28 17:40 UTC (permalink / raw)
  To: Zhang, Rui
  Cc: Len Brown, Alexey Starikovskiy, linux-acpi, Zhao, Yakui,
	Lin, Ming M

>For bug 6217, we should do the following for stray GPEs:
>1. get the current value of GPE_ENABLE register
>2. clear the stray GPE bit of GPE_ENABLE register
>3. write the value back

I think we will give this a go.



>-----Original Message-----
>From: Zhang, Rui
>Sent: Wednesday, May 21, 2008 9:56 AM
>To: Moore, Robert
>Cc: Len Brown; Alexey Starikovskiy; linux-acpi@vger.kernel.org; Zhao,
Yakui
>Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs
>
>
>On Wed, 2008-05-21 at 16:28 +0800, Zhang, Rui wrote:
>> Hi, all,
>>
>> With Yakui's help, we've root caused this problem.
>>
>> For the GPEs with _Lxx/_Exx methods, Linux updates the enable mask
but
>> doesn't enable them in HW in acpi_ev_gpe_initialize.
>> And in acpi_ev_install_fadt_gpes, the GPEs that are shown in _PRW
>> methods but don't have _Lxx/_Exx methods are disabled in
>> acpi_ev_set_type, before 6217 is applied, the acpi_ev_disable_gpe
won't
>> write the GPE enable register and everything goes well.
>> But with 6217 applied, acpi_ev_disable_gpe will write the GPE enable
>> register and enable all the _Lxx/_Exx GPEs as a side effect.
>>
>> And the error message is printed out if a _Lxx/_Exx GPE is fired and
try
>> to access EC address space.
>>
>> Of cource this can be solved by Alexey's patch which installs the EC
>> address space handler before any GPE is enabled in HW.
>>
>> But there is still one problem with both 6217 and 9916 applied which
>> I'll talk about in the next email. :)
>Please refer to bug 9781 and 10224, where a GPE is used as a wake GPE
>and a RUN_WAKE GPE at the same time,
>
>Before 6217 and 9916 are applied, Linux disable the wake GPEs in
>acpi_ev_install_fadt_gpes, call _PSW to disable the device's wakeup
>ability in acpi_scan_init, and re-enable the GPE as a RUN_WAKE GPE in
>acpi_button_add.
>
>But with both 6217 and 9916 applied, Linux enable all the _Lxx/_Exx
GPEs
>in acpi_ec_ecdt_probe, and won't disable it until
>acpi_ev_install_fadt_gpes. And this may bring an interrupt storm
because
>the _PSW is not called and the wakeup GPE keeps on firing.
>
>IMO, we should revert the 9916 patch because Yakui reproduced the
>problem on T61 and confirm it's fixed by a BIOS update, maybe we should
>ask the bug reporter to test the new BIOS as well. :)
>
>For bug 6217, we should do the following for stray GPEs:
>1. get the current value of GPE_ENABLE register
>2. clear the stray GPE bit of GPE_ENABLE register
>3. write the value back
>
>Any comments on this?
>
>thanks,
>rui
>
>>
>> Thanks,
>> Rui
>>
>> >-----Original Message-----
>> >From: Moore, Robert
>> >Sent: Friday, April 25, 2008 9:57 AM
>> >To: Zhang, Rui; Len Brown
>> >Cc: Alexey Starikovskiy; linux-acpi@vger.kernel.org
>> >Subject: RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
GPEs
>> >
>> >Yes, this is my question also.
>> >
>> >I hope Alexey can help with this. I'm very nervous about any code
that
>> works
>> >or does not work for reasons unknown. When this happens in the GPE
>> code, I get
>> >more than nervous.
>> >
>> >Bob
>> >
>> >
>> >-----Original Message-----
>> >From: Zhang, Rui
>> >Sent: Thursday, April 24, 2008 6:53 PM
>> >To: Len Brown
>> >Cc: Moore, Robert; Alexey Starikovskiy; linux-acpi@vger.kernel.org
>> >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious
GPEs
>> >
>> >
>> >On Fri, 2008-04-25 at 09:40 +0800, Len Brown wrote:
>> >> oh goody, i thought this one rang a bell...
>> >>
>> >> I'll apply 6217 on top of 9916 (which was already in the test
tree,
>> >> but not on the acpica branch)
>> >>
>> >> the error goes away with both applied.
>> >
>> >I still don't see why the error messages pop up if 6217 is applied.
>> >IMO, 6217 won't enable the EC GPE. :(
>> >
>> >thanks,
>> >rui
>> >
>> >> On Wednesday 23 April 2008, Moore, Robert wrote:
>> >> > Alexey,
>> >> >
>> >> > I remember there was some discussion on this, but I'm still not
>> sure
>> >> why
>> >> > the patch for 6217 (Ignore GPE if valid and not enabled) makes
the
>> >> other
>> >> > problem (too early enabling of GPEs) apparent. Please explain.
>> >> >
>> >> > Thanks,
>> >> > Bob
>> >> >
>> >> >
>> >> > >-----Original Message-----
>> >> > >From: Alexey Starikovskiy [mailto:astarikovskiy@suse.de]
>> >> > >Sent: Tuesday, April 22, 2008 10:29 PM
>> >> > >To: Len Brown
>> >> > >Cc: linux-acpi@vger.kernel.org; Moore, Robert; Zhang, Rui
>> >> > >Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown
spurious
>> >> GPEs
>> >> > >
>> >> > >Len Brown wrote:
>> >> > >> On Saturday 12 April 2008, Len Brown wrote:
>> >> > >>> From: Bob Moore <robert.moore@intel.com>
>> >> > >>>
>> >> > >>> Implemented another change to eliminate/suppress spurious or
>> >> > >>> stray GPEs. The AcpiEvDisableGpe function will now disable
GPEs
>> >> > >>> that are neither enabled nor disabled -- meaning that the
GPE
>> is
>> >> > >>> unknown to the system. This will prevent future interrupts
from
>> >> > >>> that GPE. (Zhang Rui) BZ 6217
>> >> > >>>
>> >> > >>> Signed-off-by: Bob Moore <robert.moore@intel.com>
>> >> > >>> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
>> >> > >>> Signed-off-by: Len Brown <len.brown@intel.com>
>> >> > >>> ---
>> >> > >>>  drivers/acpi/events/evgpe.c |    9 ++++++++-
>> >> > >>>  1 files changed, 8 insertions(+), 1 deletions(-)
>> >> > >>>
>> >> > >>> diff --git a/drivers/acpi/events/evgpe.c
>> >> > b/drivers/acpi/events/evgpe.c
>> >> > >>> index 897baed..6940f5d 100644
>> >> > >>> --- a/drivers/acpi/events/evgpe.c
>> >> > >>> +++ b/drivers/acpi/events/evgpe.c
>> >> > >>> @@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct
>> >> > >acpi_gpe_event_info *gpe_event_info)
>> >> > >>>
>> >> > >>>   ACPI_FUNCTION_TRACE(ev_disable_gpe);
>> >> > >>>
>> >> > >>> - if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
>> >> > >>> + /*
>> >> > >>> +  * Ignore this if the GPE is valid and not enabled.
>> >> > >>> +  *
>> >> > >>> +  * Flags is only zero if GPE is neither enabled or
disabled
>> --
>> >> > it may
>> >> > >>> +  * be a spurious or stray GPE -- disable it in the default
>> >> case
>> >> > >below.
>> >> > >>> +  */
>> >> > >>> + if (gpe_event_info->flags &&
>> >> > >>> +     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
>> >> > >>>           return_ACPI_STATUS(AE_OK);
>> >> > >>>   }
>> >> > >>>
>> >> > >>
>> >> > >>
>> >> > >> When applied to 2.6.25, the patch above causes ACPI Error
>> >> messages
>> >> > below
>> >> > >on my T61.
>> >> > >> Certainly this is a case of the EC getting an interrupt (GPE
>> x02)
>> >> > before
>> >> > >it has initialized.
>> >> > >>
>> >> > >> Perhaps it breaks the call of acpi_install_gpe_handler() to
>> >> > >acpi_ev_disable_gpe()?
>> >> > >Congratulations, now you too hit this one, patch is already
>> >> there...
>> >> > >It is wroong to enable GPE before handler for it is
installed...
>> >> > >http://bugzilla.kernel.org/show_bug.cgi?id=9916
>> >> > >
>> >> > >>
>> >> > >> -Len
>> >> > >>
>> >> > >>
>> >> > >>  PCI: Using MMCONFIG at f0000000 - f3ffffff
>> >> > >>  PCI: Using configuration type 1
>> >> > >>  evgpeblk-0956 [00] ev_create_gpe_block   : GPE 00 to 1F
[_GPE]
>> 4
>> >> > regs on
>> >> > >int 0x9
>> >> > >> +ACPI Error (evregion-0316): No handler for Region [ECOR]
>> >> > >(ffff81007d35dda0) [EmbeddedControl] [20070126]
>> >> > >> +ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no
>> >> handler
>> >> > >[20070126]
>> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
>> >> > >[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),
>> >> AE_NOT_EXIST
>> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
>> >> > >[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),
>> >> AE_NOT_EXIST
>> >> > >> +ACPI Error (psparse-0537): Method parse/execution failed
>> >> > [\_GPE._L02]
>> >> > >(Node ffff81007d376420), AE_NOT_EXIST
>> >> > >> +ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating
GPE
>> >> > method
>> >> > >[_L02] [20070126]
>> >> > >>  evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake,
>> Enabled
>> >> 3
>> >> > >Runtime GPEs in this block
>> >> > >>  ACPI: EC: EC description table is found, configuring boot EC
>> >> > >> -ACPI: EC: non-query interrupt received, switching to
interrupt
>> >> mode
>> >> > >> -Completing Region/Field/Buffer/Package
>> >> >
>> >>
>>
>initialization:........................................................
>> >> > ....
>> >> > >............................................................
>> >> > >>
>> >> >
>> >>
>>
>.......................................................................
>> >> > ....
>> >> >
>> >>
>>
>.......................................................................
>> >> > ....
>> >> > >................
>> >> > >> -Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72
>> >> > Packages
>> >> > >(1888 nodes)
>> >> > >> +Completing Region/Field/Buffer/Package
>> >> >
>> >>
>>
>initialization:........................................................
>> >> > ....
>> >> > >............................................................
>> >> > >>
>> >> >
>> >>
>>
>.......................................................................
>> >> > ....
>> >> >
>> >>
>>
>.......................................................................
>> >> > ....
>> >> > >.................
>> >> > >> +Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72
>> >> > Packages
>> >> > >(1888 nodes)
>> >> > >>  Initializing Device/Processor/Thermal objects by executing
_INI
>> >> > >methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI
>> >> > >> +ACPI: EC: non-query interrupt received, switching to
interrupt
>> >> mode
>> >> > >>  .......
>> >> > >>  Executed 8 _INI methods requiring 2 _STA executions
(examined
>> 88
>> >> > >objects)
>> >> > >>  ACPI: Interpreter enabled
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-acpi"
in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 123+ messages in thread

end of thread, other threads:[~2008-05-28 17:41 UTC | newest]

Thread overview: 123+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-12  4:24 ACPICA branch Len Brown
2008-04-12  4:24 ` [PATCH 01/73] ACPICA: Several fixes for internal method result stack Len Brown
2008-04-12  4:24   ` [PATCH 02/73] ACPICA: Removed unused code Len Brown
2008-04-12  4:24   ` [PATCH 03/73] ACPICA: Update for mutiple global lock acquisitions by same thread Len Brown
2008-04-12  4:24   ` [PATCH 04/73] ACPICA: changed order of interpretation of operand objects Len Brown
2008-04-12  4:24   ` [PATCH 05/73] ACPICA: Avoid use of invalid pointers in returned object field Len Brown
2008-04-12  4:24   ` [PATCH 06/73] ACPICA: Fixed a couple compiler warnings for extra extern statements Len Brown
2008-04-12  4:24   ` [PATCH 07/73] ACPICA: Update comments for acquire/release mutex interfaces Len Brown
2008-04-12  4:24   ` [PATCH 08/73] ACPICA: Removed extraneous code Len Brown
2008-04-12  4:24   ` [PATCH 09/73] ACPICA: Removed obsolete ACPI_NO_INTEGER64_SUPPORT define Len Brown
2008-04-12  4:24   ` [PATCH 10/73] ACPICA: Misc fixes for recent global lock code update Len Brown
2008-04-12  4:24   ` [PATCH 11/73] ACPICA: Increase maximum buffer size dumped to screen in buffer object dump Len Brown
2008-04-12  4:24   ` [PATCH 12/73] ACPICA: Fix for package reference counts Len Brown
2008-04-12  4:24   ` [PATCH 13/73] ACPICA: Update version to 20070320 Len Brown
2008-04-12  4:24   ` [PATCH 14/73] ACPICA: Fix for update of the Global Lock Handle Len Brown
2008-04-12  4:24   ` [PATCH 15/73] ACPICA: Update version to 20070508 Len Brown
2008-04-12  4:24   ` [PATCH 16/73] ACPICA: Updated error message for dynamic method serialization Len Brown
2008-04-12  4:25   ` [PATCH 17/73] ACPICA: Support for iASL - multiple files and wildcards Len Brown
2008-04-12  4:25   ` [PATCH 18/73] ACPICA: Add minimal disassembly support for the SLIC table Len Brown
2008-04-12  4:25   ` [PATCH 19/73] ACPICA: New interfaces for table event handlers Len Brown
2008-04-12  4:25   ` [PATCH 20/73] ACPICA: Fix for namespace lookup problem Len Brown
2008-04-12  4:25   ` [PATCH 21/73] ACPICA: update version number to 20070919 Len Brown
2008-04-12  4:25   ` [PATCH 22/73] ACPICA: Fix for Alias operator to see target child objects Len Brown
2008-04-12  4:25   ` [PATCH 23/73] ACPICA: Fix for fault if Load() fails Len Brown
2008-04-12  4:25   ` [PATCH 24/73] ACPICA: Fix a fault when storing DdbHandle to Debug object Len Brown
2008-04-12  4:25   ` [PATCH 25/73] ACPICA: Fix for memory leak related to DdbHandle objects Len Brown
2008-04-12  4:25   ` [PATCH 26/73] ACPICA: Add a table checksum verify for Load operator Len Brown
2008-04-12  4:25   ` [PATCH 27/73] ACPICA: Add error checks to prevent faults Len Brown
2008-04-12  4:25   ` [PATCH 28/73] ACPICA: Fix for Load/LoadTable to specify load location Len Brown
2008-04-12  4:25   ` [PATCH 29/73] ACPICA: Fixed a memory leak when Device or Thermal objects referenced in packages Len Brown
2008-04-12  4:25   ` [PATCH 30/73] ACPICA: Fix for Increment/Decrement operator, incorrect type change Len Brown
2008-04-12  4:25   ` [PATCH 31/73] ACPICA: Added additional parameter validation for LoadTable Len Brown
2008-04-12  4:25   ` [PATCH 32/73] ACPICA: Update version to 20071019 Len Brown
2008-04-12  4:25   ` [PATCH 33/73] ACPICA: Cosmetic changes only, no functional changes Len Brown
2008-04-12  4:25   ` [PATCH 34/73] " Len Brown
2008-04-12  4:25   ` [PATCH 35/73] ACPICA: Cleanup of debug output Len Brown
2008-04-12  4:25   ` [PATCH 36/73] ACPICA: Fixes a problem with control method references within packages Len Brown
2008-04-12  4:25   ` [PATCH 37/73] ACPICA: Fixed a problem with FromBCD and ToBCD with some compilers Len Brown
2008-04-12  4:25   ` [PATCH 38/73] ACPICA: Fixed a problem with Index references passed as method arguments Len Brown
2008-04-12  4:25   ` [PATCH 39/73] ACPICA: Fixed a problem with CopyObject used in conjunction with the Index operator Len Brown
2008-04-12  4:25   ` [PATCH 40/73] ACPICA: Update version to 20071114 Len Brown
2008-04-12  4:25   ` [PATCH 41/73] ACPICA: Fixed a problem with AcpiGetDevices where the search of a branch of the device tree could be terminated prematurely Len Brown
2008-04-12  4:25   ` [PATCH 42/73] ACPICA: Fixed a problem with Index Fields where the Index register was incorrectly limited to a maximum of 32 bits Len Brown
2008-04-12  4:25   ` [PATCH 43/73] ACPICA: Implemented full support for deferred execution for the TermArg string arguments for DataTableRegion Len Brown
2008-04-12  4:25   ` [PATCH 44/73] ACPICA: Undo accidental checkin of not-fully-tested mutex changes Len Brown
2008-04-12  4:25   ` [PATCH 45/73] ACPICA: Implemented full argument resolution support for the BankValue argument to BankField Len Brown
2008-04-12  4:25   ` [PATCH 46/73] ACPICA: Fixed a couple memory leaks associated with "implicit return" objects when the AML Interpreter slack mode is enabled Len Brown
2008-04-22 18:24     ` Len Brown
2008-04-12  4:25   ` [PATCH 47/73] ACPICA: Update version to 20071219 Len Brown
2008-04-12  4:25   ` [PATCH 48/73] ACPICA: Fix for SizeOf when used with Buffers and Packages Len Brown
2008-04-12  4:25   ` [PATCH 49/73] ACPICA: Methods now implicitly return 0 in slack mode Len Brown
2008-04-12  4:25   ` [PATCH 50/73] ACPICA: Fix for Load operator Len Brown
2008-04-12  4:25   ` [PATCH 51/73] ACPICA: Fix for LoadTable operator, input strings Len Brown
2008-04-12  4:25   ` [PATCH 52/73] ACPICA: Include file support for new ACPI tables Len Brown
2008-04-12  4:25   ` [PATCH 53/73] ACPICA: Bulletproof disassembler for bad " Len Brown
2008-04-12  4:25   ` [PATCH 54/73] ACPICA: Fixes for Unload and DDBHandles Len Brown
2008-04-12  4:25   ` [PATCH 55/73] ACPICA: Update version to 20080123 Len Brown
2008-04-12  4:25   ` [PATCH 56/73] ACPICA: Add va_end statements as appropriate Len Brown
2008-04-12  4:25   ` [PATCH 57/73] ACPICA: Added new error messages Len Brown
2008-04-12  4:25   ` [PATCH 58/73] ACPICA: Fix for ACPI_HIDWORD macro Len Brown
2008-04-12  4:25   ` [PATCH 59/73] ACPICA: Disassembler support for new ACPI tables Len Brown
2008-04-12  4:25   ` [PATCH 60/73] ACPICA: Additional GPE/Notify handling change Len Brown
2008-04-12  4:25   ` [PATCH 61/73] ACPICA: Fix for resource descriptor optimization issues for _CRS/_SRC Len Brown
2008-04-12  4:25   ` [PATCH 62/73] ACPICA: Update behavior of CopyObject to match ACPI spec Len Brown
2008-04-12  4:25   ` [PATCH 63/73] ACPICA: Fix for possible error when packages/buffers are passed to methods externally Len Brown
2008-04-12  4:25   ` [PATCH 64/73] ACPICA: Update ACPICA version to 20080213 Len Brown
2008-04-12  4:25   ` [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages Len Brown
2008-04-15  7:09     ` Len Brown
2008-04-15  8:36       ` Alexey Starikovskiy
2008-04-15 18:46         ` Moore, Robert
2008-04-15 18:56           ` Alexey Starikovskiy
2008-04-15 20:19             ` Moore, Robert
2008-04-15 20:39               ` Alexey Starikovskiy
2008-04-15 21:01                 ` Moore, Robert
2008-04-15 21:12                   ` Alexey Starikovskiy
2008-04-15 21:29                     ` Moore, Robert
2008-04-15 21:51                       ` Alexey Starikovskiy
2008-04-15 22:27                         ` Moore, Robert
2008-04-15 22:02                       ` Tomas Carnecky
2008-04-15 21:57                         ` Alexey Starikovskiy
2008-04-15 22:20                           ` Moore, Robert
2008-04-15 21:56                 ` Tomas Carnecky
2008-04-15 21:55                   ` Alexey Starikovskiy
2008-04-22 19:23         ` Len Brown
2008-04-22 22:21           ` Moore, Robert
2008-04-22 23:22             ` Len Brown
2008-04-23  1:00               ` Moore, Robert
2008-04-12  4:25   ` [PATCH 66/73] ACPICA: Fix to handle NULL package elements correctly Len Brown
2008-04-12  4:25   ` [PATCH 67/73] ACPICA: Fixes for external Reference Objects Len Brown
2008-04-22 23:15     ` Len Brown
2008-04-12  4:25   ` [PATCH 68/73] ACPICA: Updates for Debug object output Len Brown
2008-04-12  4:25   ` [PATCH 69/73] ACPICA: Fixes for size of StartDependent resource descriptor Len Brown
2008-04-12  4:25   ` [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs Len Brown
2008-04-23  2:57     ` Len Brown
2008-04-23  5:28       ` Alexey Starikovskiy
2008-04-23 20:35         ` Moore, Robert
2008-04-25  1:40           ` Len Brown
2008-04-25  1:53             ` Zhang Rui
2008-04-25  1:57               ` Moore, Robert
2008-04-25  2:10                 ` Alexey Starikovskiy
2008-04-25  2:28                   ` Zhang Rui
2008-04-25  2:39                     ` Alexey Starikovskiy
2008-04-25  4:18                       ` Moore, Robert
2008-05-21  8:28                 ` Zhang, Rui
2008-05-21 16:56                   ` Zhang Rui
2008-05-22  1:35                     ` Zhao Yakui
2008-05-22 16:45                     ` Moore, Robert
2008-05-22 16:55                       ` Alexey Starikovskiy
2008-05-22 17:22                         ` Moore, Robert
2008-05-28 17:40                     ` Moore, Robert
2008-05-22  1:08                   ` Zhao Yakui
2008-04-12  4:25   ` [PATCH 71/73] ACPICA: Update for new Notify values Len Brown
2008-04-12  4:25   ` [PATCH 72/73] ACPICA: Update version to 20080321 Len Brown
2008-04-12  4:25   ` [PATCH 73/73] ACPICA: Fix for some local named nodes not marked temporary and to disallow duplicates Len Brown
2008-04-12  4:41 ` ACPICA branch - first try Core revision 20080321 Len Brown
2008-04-12 20:46   ` Alexey Starikovskiy
2008-04-15  7:51     ` Len Brown
2008-04-29  9:04 ` ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions) Len Brown
2008-04-29 16:09   ` Moore, Robert
2008-04-30 11:03     ` Lin Ming
2008-05-06  6:20     ` Lin Ming
2008-05-06 17:07       ` Moore, Robert
2008-05-13  5:45       ` Lin Ming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).