Skip to contentSkip to conversation

ACPICA branch

PATCH In review Len Brown 8 participants 123 messages Apr 12, 2008 – May 28, 2008 Page 1 of 2

Subsystems (2)
lore
Share & tools
lore

Len Brown

author reviewer
#0 lore raw

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

author reviewer
#2 lore raw

PATCH 2/73 ACPICA: Removed unused code

From: Bob Moore <[email protected]>

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

---
 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(-)
drivers/acpi/executer/exdump.c +0 -9
index 51c9c29..fcb1da0 100644
@@ -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",
drivers/acpi/executer/exresolv.c +0 -18
index 6c64e55..74ab220 100644
@@ -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:
 
drivers/acpi/executer/exresop.c +0 -11
index 09d897b..259047a 100644
@@ -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 */
drivers/acpi/executer/exstore.c +0 -1
index f4b69a6..97cb188 100644
@@ -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" */
Signature · 1 line
1.5.5.29.g7134
author reviewer
#3 lore raw

PATCH 3/73 ACPICA: Update for mutiple global lock acquisitions by same thread

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 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(-)
drivers/acpi/dispatcher/dsmethod.c +6 -6
index 1cbe619..c50c0cd 100644
@@ -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;
 		}
 	}
 
drivers/acpi/events/evmisc.c +6 -5
index 21cb749..2d34663 100644
@@ -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);
 }
 
drivers/acpi/events/evxface.c +22 -4
index 6d866a0..dbf34a5 100644
@@ -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);
 }
 
drivers/acpi/executer/exfield.c +8 -16
index 2d88a3d..e66b367 100644
@@ -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 */
 
drivers/acpi/executer/exmutex.c +126 -68

265 lines not on this page · raw message

drivers/acpi/executer/exutils.c +26 -32

98 lines not on this page · raw message

drivers/acpi/namespace/nsaccess.c +1 -2
index 57faf59..32a0167 100644
@@ -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 */
 
drivers/acpi/utilities/utdelete.c +1 -1
index f777ceb..dcb34f8 100644
@@ -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 */
 
include/acpi/acglobal.h +12 -8
index 47a1fd8..e91008e 100644
@@ -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;
 
include/acpi/acinterp.h +9 -2
index ce7c9d6..2386388 100644
@@ -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);
 
include/acpi/acobject.h +2 -1
index 7e1211a..2461bb9 100644
@@ -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 */
Signature · 1 line
1.5.5.29.g7134
author reviewer
#4 lore raw

PATCH 4/73 ACPICA: changed order of interpretation of operand objects

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 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(-)
drivers/acpi/dispatcher/dsutils.c +110 -3
index d2a8cfd..36518b4 100644
@@ -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);
+}
drivers/acpi/dispatcher/dswexec.c +9 -2
index 12b1485..514b9d2 100644
@@ -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 */
 
drivers/acpi/executer/exutils.c +2 -1
index c0837af..c40b191 100644
@@ -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;
 	}
drivers/acpi/parser/psloop.c +21 -2
index 266dd0c..4348b05 100644
@@ -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) {
 		/*
drivers/acpi/parser/psopcode.c +26 -0
index 9296e86..3bf8105 100644
@@ -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);
+}
drivers/acpi/parser/pstree.c +2 -0
index 966e7ea..0e1a322 100644
@@ -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++;
 	}
 }
 
include/acpi/acdispat.h +2 -0
index 70d649e..3bffb4d 100644
@@ -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
  */
include/acpi/aclocal.h +3 -0
index 0b7c9a9..946da60 100644
@@ -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 */
include/acpi/acparser.h +2 -0
index 85c358e..a3ae76b 100644
@@ -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
  */
Signature · 1 line
1.5.5.29.g7134
author reviewer
#13 lore raw

PATCH 13/73 ACPICA: Update version to 20070320

In reply to Len Brown

From: Bob Moore <[email protected]>

pdate version to 20070320

---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acconfig.h +1 -1
index d13bab4..c1829a3 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#1 lore raw

PATCH 1/73 ACPICA: Several fixes for internal method result stack

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 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(-)
drivers/acpi/dispatcher/dsopcode.c +7 -2
index f501e08..0c4630d 100644
@@ -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 */
 
drivers/acpi/dispatcher/dsutils.c +38 -14

83 lines not on this page · raw message

drivers/acpi/dispatcher/dswexec.c +2 -41

89 lines not on this page · raw message

drivers/acpi/dispatcher/dswstate.c +111 -402

678 lines not on this page · raw message

drivers/acpi/parser/psloop.c +0 -11
index 773aee8..266dd0c 100644
@@ -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
drivers/acpi/parser/psparse.c +3 -12
index 5d63f48..ce3139a 100644
@@ -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:
include/acpi/acconfig.h +12 -1
index 422f29c..d13bab4 100644
@@ -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
include/acpi/acdispat.h +1 -15
index 7f690bb..70d649e 100644
@@ -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_ */
include/acpi/aclocal.h +2 -3
index 202cd42..0b7c9a9 100644
@@ -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
include/acpi/acstruct.h +3 -0
index 8848265..19b838d 100644
@@ -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 */
Signature · 1 line
1.5.5.29.g7134
author reviewer
#5 lore raw

PATCH 5/73 ACPICA: Avoid use of invalid pointers in returned object field

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 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(-)
drivers/acpi/executer/exoparg1.c +1 -0
index 252f10a..ab5c037 100644
@@ -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 */
 
drivers/acpi/executer/exoparg2.c +13 -6
index 17e652e..81c02b1 100644
@@ -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);
 }
drivers/acpi/executer/exoparg3.c +1 -0
index 7fe67cf..a573f5d 100644
@@ -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 */
drivers/acpi/executer/exoparg6.c +6 -2
index bd80a9c..163b2b3 100644
@@ -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);
 }
Signature · 1 line
1.5.5.29.g7134
author reviewer
#8 lore raw

PATCH 8/73 ACPICA: Removed extraneous code

In reply to Len Brown

From: Bob Moore <[email protected]>

---
 drivers/acpi/dispatcher/dsmethod.c |    7 -------
 drivers/acpi/namespace/nswalk.c    |    4 +---
 2 files changed, 1 insertions(+), 10 deletions(-)
drivers/acpi/dispatcher/dsmethod.c +0 -7
index c50c0cd..3db651c 100644
@@ -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
 		 */
drivers/acpi/namespace/nswalk.c +1 -3
index 280b835..c7b5409 100644
@@ -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 {
Signature · 1 line
1.5.5.29.g7134
author reviewer
#6 lore raw

PATCH 6/73 ACPICA: Fixed a couple compiler warnings for extra extern statements

In reply to Len Brown

From: Bob Moore <[email protected]>

---
 include/acpi/acglobal.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
include/acpi/acglobal.h +6 -0
index e91008e..44e718e 100644
@@ -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[];
Signature · 1 line
1.5.5.29.g7134
author reviewer
#14 lore raw

PATCH 14/73 ACPICA: Fix for update of the Global Lock Handle

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 drivers/acpi/events/evmisc.c  |   13 +++++++++++++
 drivers/acpi/events/evxface.c |    9 +--------
 2 files changed, 14 insertions(+), 8 deletions(-)
drivers/acpi/events/evmisc.c +13 -0
index 2d34663..d075062 100644
@@ -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.
 	 */
drivers/acpi/events/evxface.c +1 -8
index e210aa2..412cae6 100644
@@ -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;
 	}
Signature · 1 line
1.5.5.29.g7134
author reviewer
#17 lore raw

PATCH 17/73 ACPICA: Support for iASL - multiple files and wildcards

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 drivers/acpi/utilities/utinit.c  |    3 +++
 drivers/acpi/utilities/utxface.c |    4 ++++
 2 files changed, 7 insertions(+), 0 deletions(-)
drivers/acpi/utilities/utinit.c +3 -0
index ad3c0d0..de44477 100644
@@ -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 */
 
drivers/acpi/utilities/utxface.c +4 -0
index 2d49691..15bd6ff 100644
@@ -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
Signature · 1 line
1.5.5.29.g7134
author reviewer
#18 lore raw

PATCH 18/73 ACPICA: Add minimal disassembly support for the SLIC table

In reply to Len Brown

From: Bob Moore <[email protected]>

SLIC - Software Licensing Description Table.

---
 include/acpi/acdisasm.h |    1 +
 include/acpi/actbl1.h   |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
include/acpi/acdisasm.h +1 -0
index 389d772..75c354f 100644
@@ -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[];
include/acpi/actbl1.h +1 -0
index a1b1b2e..dd8e11e 100644
@@ -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 */
Signature · 1 line
1.5.5.29.g7134
author reviewer
#7 lore raw

PATCH 7/73 ACPICA: Update comments for acquire/release mutex interfaces

In reply to Len Brown

From: Bob Moore <[email protected]>

pdate comments for acquire/release mutex interfaces

---
 drivers/acpi/executer/exmutex.c |   36 ++++++++++++++++++++++++++++++------
 1 files changed, 30 insertions(+), 6 deletions(-)
drivers/acpi/executer/exmutex.c +30 -6
index 0bebe75..32f24a8 100644
@@ -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;
Signature · 1 line
1.5.5.29.g7134
author reviewer
#11 lore raw

PATCH 11/73 ACPICA: Increase maximum buffer size dumped to screen in buffer object dump

In reply to Len Brown

From: Bob Moore <[email protected]>

---
 drivers/acpi/executer/exstore.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/executer/exstore.c +1 -1
index 97cb188..f88b181 100644
@@ -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:
Signature · 1 line
1.5.5.29.g7134
author reviewer
#20 lore raw

PATCH 20/73 ACPICA: Fix for namespace lookup problem

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 drivers/acpi/parser/psargs.c |   24 ++++++++----------------
 1 files changed, 8 insertions(+), 16 deletions(-)
drivers/acpi/parser/psargs.c +8 -16
index c2b9835..442880f 100644
@@ -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
Signature · 1 line
1.5.5.29.g7134
author reviewer
#23 lore raw

PATCH 23/73 ACPICA: Fix for fault if Load() fails

In reply to Len Brown

From: Bob Moore <[email protected]>

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)

---
 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(-)
drivers/acpi/executer/exconfig.c +24 -11
index 009aef5..8cc410c 100644
@@ -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);
drivers/acpi/tables/tbinstal.c +14 -7
index 3bc0c67..6a6ee1f 100644
@@ -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);
 	}
 
drivers/acpi/utilities/utdebug.c +5 -0
index 7361204..a914867 100644
@@ -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;
 	}
Signature · 1 line
1.5.5.29.g7134
author reviewer
#10 lore raw

PATCH 10/73 ACPICA: Misc fixes for recent global lock code update

In reply to Len Brown

From: Bob Moore <[email protected]>

Fixes as a result of running full validation test suite.

---
 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(-)
drivers/acpi/events/evxface.c +1 -1
index dbf34a5..e210aa2 100644
@@ -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);
 	}
 
drivers/acpi/executer/exfield.c +4 -4
index e66b367..da772cb 100644
@@ -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 */
 
drivers/acpi/executer/exmutex.c +18 -5
index 32f24a8..b8d035c 100644
@@ -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);
 }
 
drivers/acpi/executer/exutils.c +9 -2
index c40b191..fd543ee 100644
@@ -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);
include/acpi/acinterp.h +1 -1
index 2386388..92eb014 100644
@@ -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);
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#9 lore raw

PATCH 9/73 ACPICA: Removed obsolete ACPI_NO_INTEGER64_SUPPORT define

In reply to Len Brown

From: Bob Moore <[email protected]>

---
 include/acpi/acmacros.h |   12 +-----------
 include/acpi/actypes.h  |   23 +++--------------------
 2 files changed, 4 insertions(+), 31 deletions(-)
include/acpi/acmacros.h +1 -11
index 99d171c..401228d 100644
@@ -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
include/acpi/actypes.h +3 -20
index e73a389..6182b57 100644
@@ -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
Signature · 1 line
1.5.5.29.g7134
author reviewer
#12 lore raw

PATCH 12/73 ACPICA: Fix for package reference counts

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/dispatcher/dsobject.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
drivers/acpi/dispatcher/dsobject.c +22 -0
index 954ac8c..fe28b9a 100644
@@ -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;
 	}
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#24 lore raw

PATCH 24/73 ACPICA: Fix a fault when storing DdbHandle to Debug object

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/executer/exstore.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
drivers/acpi/executer/exstore.c +11 -1
index f88b181..912889e 100644
@@ -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) ==
Signature · 1 line
1.5.5.29.g7134
author reviewer
#25 lore raw

PATCH 25/73 ACPICA: Fix for memory leak related to DdbHandle objects

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/executer/exconfig.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/acpi/executer/exconfig.c +1 -0
index 8cc410c..a0f34b4 100644
@@ -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);
 	}
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#26 lore raw

PATCH 26/73 ACPICA: Add a table checksum verify for Load operator

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/executer/exconfig.c |   24 +++++++++++++++++++++---
 drivers/acpi/tables/tbutils.c    |    2 +-
 2 files changed, 22 insertions(+), 4 deletions(-)
drivers/acpi/executer/exconfig.c +21 -3
index a0f34b4..dbf1e6f 100644
@@ -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;
 
drivers/acpi/tables/tbutils.c +1 -1
index 010f196..d04442f 100644
@@ -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)));
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#15 lore raw

PATCH 15/73 ACPICA: Update version to 20070508

In reply to Len Brown

From: Bob Moore <[email protected]>

Update version to 20070508.

---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acconfig.h +1 -1
index c1829a3..a45230d 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#16 lore raw

PATCH 16/73 ACPICA: Updated error message for dynamic method serialization

In reply to Len Brown

From: Bob Moore <[email protected]>

Added more information to make the message clearer.

---
 drivers/acpi/parser/psparse.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/parser/psparse.c +1 -1
index ce3139a..1442e55 100644
@@ -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));
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#27 lore raw

PATCH 27/73 ACPICA: Add error checks to prevent faults

In reply to Len Brown

From: Bob Moore <[email protected]>

Added additional error checking to prevent run-time faults.

---
 drivers/acpi/executer/exstore.c  |   12 ++++++++++--
 drivers/acpi/namespace/nsnames.c |    6 ++++++
 2 files changed, 16 insertions(+), 2 deletions(-)
drivers/acpi/executer/exstore.c +10 -2
index 912889e..d860f9c 100644
@@ -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;
 
drivers/acpi/namespace/nsnames.c +6 -0
index cbd94af..e14a141 100644
@@ -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);
 	}
Signature · 1 line
1.5.5.29.g7134
author reviewer
#28 lore raw

PATCH 28/73 ACPICA: Fix for Load/LoadTable to specify load location

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 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(-)
drivers/acpi/executer/exconfig.c +2 -1
index dbf1e6f..b9543a7 100644
@@ -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 */
drivers/acpi/namespace/nsload.c +1 -1
index d4f9654..545010d 100644
@@ -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 {
drivers/acpi/namespace/nsparse.c +15 -3
index e696aa8..86bd6e5 100644
@@ -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);
 	}
include/acpi/acnamesp.h +2 -1
index 5ef38a6..1cad10b 100644
@@ -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
Signature · 1 line
1.5.5.29.g7134
author reviewer
#19 lore raw

PATCH 19/73 ACPICA: New interfaces for table event handlers

In reply to Len Brown

From: Bob Moore <[email protected]>

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)

---
 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(-)
drivers/acpi/executer/exconfig.c +28 -1
index 25802f3..009aef5 100644
@@ -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);
 }
drivers/acpi/tables/tbxface.c +89 -0

95 lines not on this page · raw message

drivers/acpi/utilities/utglobal.c +2 -1
index 630c9a2..4442543 100644
@@ -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 */
 
include/acpi/acdisasm.h +2 -2
index 75c354f..67d152e 100644
@@ -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;
 };
 
include/acpi/acglobal.h +2 -0
index 44e718e..8624686 100644
@@ -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 */
include/acpi/acpixf.h +5 -0
index d970f7f..c92acda 100644
@@ -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
  */
include/acpi/actypes.h +11 -0
index 6182b57..766178c 100644
@@ -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
Signature · 1 line
1.5.5.29.g7134
author reviewer
#21 lore raw

PATCH 21/73 ACPICA: update version number to 20070919

In reply to Len Brown

From: Bob Moore <[email protected]>

---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acconfig.h +1 -1
index a45230d..6581500 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#22 lore raw

PATCH 22/73 ACPICA: Fix for Alias operator to see target child objects

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 drivers/acpi/executer/excreate.c  |   20 ++++++--
 drivers/acpi/namespace/nsaccess.c |   96 +++++++++++++++++++++++--------------
 2 files changed, 75 insertions(+), 41 deletions(-)
drivers/acpi/executer/excreate.c +15 -5
index 6e9a23e..b391439 100644
@@ -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 =
drivers/acpi/namespace/nsaccess.c +60 -36

104 lines not on this page · raw message

Signature · 1 line
1.5.5.29.g7134
author reviewer
#29 lore raw

PATCH 29/73 ACPICA: Fixed a memory leak when Device or Thermal objects referenced in packages

In reply to Len Brown

From: Bob Moore <[email protected]>

Problem introduced in fix for Package references.

---
 drivers/acpi/dispatcher/dsobject.c |   38 +++++++++++++++++++----------------
 drivers/acpi/utilities/utdelete.c  |    8 ++++--
 2 files changed, 26 insertions(+), 20 deletions(-)
drivers/acpi/dispatcher/dsobject.c +21 -17
index fe28b9a..7556d91 100644
@@ -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;
drivers/acpi/utilities/utdelete.c +5 -3
index dcb34f8..6a763cd 100644
@@ -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;
Signature · 1 line
1.5.5.29.g7134
author reviewer
#30 lore raw

PATCH 30/73 ACPICA: Fix for Increment/Decrement operator, incorrect type change

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 include/acpi/acopcode.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/acpi/acopcode.h +2 -2
index e6f76a2..ab54349 100644
@@ -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)
Signature · 1 line
1.5.5.29.g7134
author reviewer
#31 lore raw

PATCH 31/73 ACPICA: Added additional parameter validation for LoadTable

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 drivers/acpi/executer/exconfig.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/acpi/executer/exconfig.c +8 -0
index b9543a7..3370aad 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#34 lore raw

PATCH 34/73 ACPICA: Cosmetic changes only, no functional changes

In reply to Len Brown

From: Bob Moore <[email protected]>

Lint changes, fix compiler warnings, etc.

---
 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(-)
drivers/acpi/dispatcher/dsmethod.c +17 -21
index 3db651c..7a99740 100644
@@ -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 */
drivers/acpi/dispatcher/dsobject.c +3 -1
index 7556d91..58d4d91 100644
@@ -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
drivers/acpi/dispatcher/dsopcode.c +1 -1
index 0c4630d..f0847ee 100644
@@ -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 */
drivers/acpi/dispatcher/dsutils.c +4 -6
index 36518b4..97d01dc 100644
@@ -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,
drivers/acpi/dispatcher/dswstate.c +3 -3
index 698d2e1..4c402be 100644
@@ -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;
 		}
drivers/acpi/executer/exconfig.c +5 -5
index 3370aad..52b1e95 100644
@@ -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);
 
drivers/acpi/executer/exdump.c +8 -2
index fcb1da0..e48d916 100644
@@ -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;
drivers/acpi/executer/exfldio.c +2 -1
index 65a48b6..1ece1c3 100644
@@ -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 */
 
drivers/acpi/executer/exregion.c +5 -3
index 3f51b7e..cbc6788 100644
@@ -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 */
 
drivers/acpi/executer/exstore.c +4 -2
index d860f9c..2408122 100644
@@ -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,
drivers/acpi/executer/exsystem.c +0 -1
index 9460baf..a20a974 100644
@@ -44,7 +44,6 @@
 
 #include <acpi/acpi.h>
 #include <acpi/acinterp.h>
-#include <acpi/acevents.h>
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("exsystem")
drivers/acpi/executer/exutils.c +0 -1
index fd543ee..1b93f4d 100644
@@ -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")
drivers/acpi/parser/psopcode.c +2 -1
index 3bf8105..153621d 100644
@@ -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 };
 
 /*******************************************************************************
  *
include/acpi/acglobal.h +3 -5
index 8624686..86cff21 100644
@@ -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
 
include/acpi/acmacros.h +10 -0
index 401228d..dc6a037 100644
@@ -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.
include/acpi/actypes.h +2 -0
index 766178c..bb44700 100644
@@ -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
  */
Signature · 1 line
1.5.5.29.g7134
author reviewer
#45 lore raw

PATCH 45/73 ACPICA: Implemented full argument resolution support for the BankValue argument to BankField

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 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(-)
drivers/acpi/dispatcher/dsfield.c +41 -39
index f049639..e87f6bf 100644
@@ -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);
 }
 
drivers/acpi/dispatcher/dsopcode.c +144 -0

156 lines not on this page · raw message

drivers/acpi/dispatcher/dsutils.c +3 -1
index 97d01dc..f6c28d7 100644
@@ -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.
drivers/acpi/dispatcher/dswexec.c +11 -0
index 8ba4bb3..bfe4450 100644
@@ -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;
 
drivers/acpi/executer/exprep.c +15 -0
index efe5d4b..6eb45bf 100644
@@ -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:
drivers/acpi/namespace/nsinit.c +10 -0
index 33db224..72b3245 100644
@@ -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++;
drivers/acpi/parser/psloop.c +19 -0
index a079975..a7c7688 100644
@@ -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) {
drivers/acpi/parser/psopcode.c +3 -2
index b273a0a..18ed59d 100644
@@ -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 */
 
drivers/acpi/parser/psparse.c +2 -0
index 1442e55..a8995ca 100644
@@ -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);
drivers/acpi/utilities/utdelete.c +11 -0
index 6a763cd..f5b2f6a 100644
@@ -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;
 	}
drivers/acpi/utilities/utobject.c +1 -0
index e08b3fa..1eccd3d 100644
@@ -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 */
 
include/acpi/acdispat.h +7 -0
index d8dabe8..a5b97f0 100644
@@ -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);
 
 /*
Signature · 1 line
1.5.5.29.g7134
author reviewer
#46 lore raw

PATCH 46/73 ACPICA: Fixed a couple memory leaks associated with "implicit return" objects when the AML Interpreter slack mode is enabled

In reply to Len Brown

From: Bob Moore <[email protected]>

Lin Ming BZ 349

---
 drivers/acpi/dispatcher/dsmethod.c |    3 +++
 drivers/acpi/dispatcher/dsmthdat.c |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)
drivers/acpi/dispatcher/dsmethod.c +3 -0
index 7a99740..9e24641 100644
@@ -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)) {
 
drivers/acpi/dispatcher/dsmthdat.c +2 -0
index ba4626e..38510d1 100644
@@ -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;
 }
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#32 lore raw

PATCH 32/73 ACPICA: Update version to 20071019

In reply to Len Brown

From: Bob Moore <[email protected]>

Update version to 20071019.

---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acconfig.h +1 -1
index 6581500..a2d4c87 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#33 lore raw

PATCH 33/73 ACPICA: Cosmetic changes only, no functional changes

In reply to Len Brown

From: Bob Moore <[email protected]>

Lint changes, fix compiler warnings, etc.

---
 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(-)
drivers/acpi/events/evmisc.c +4 -3
index d075062..4e7a13a 100644
@@ -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);
 	}
drivers/acpi/events/evregion.c +1 -1
index 58ad097..03624e9 100644
@@ -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)));
 
drivers/acpi/hardware/hwsleep.c +8 -6
index 4290e01..202f11a 100644
@@ -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);
 	}
drivers/acpi/namespace/nsdump.c +5 -4
index 1fc4f86..3068e20 100644
@@ -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
drivers/acpi/namespace/nsload.c +1 -1
index 545010d..1bfcb6f 100644
@@ -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:
drivers/acpi/namespace/nsnames.c +1 -1
index e14a141..ba1a4f0 100644
@@ -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;
 		}
drivers/acpi/namespace/nsparse.c +11 -6
index 86bd6e5..f260b69 100644
@@ -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);
 }
drivers/acpi/resources/rscalc.c +3 -3
index 0dd2ce8..dcc51e9 100644
@@ -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);
 }
 
 /*******************************************************************************
drivers/acpi/resources/rsutils.c +3 -3
index 11c0bd7..935a482 100644
@@ -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);
 }
 
 /*******************************************************************************
drivers/acpi/utilities/utalloc.c +1 -1
index 6e56d5f..181e669 100644
@@ -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
 
drivers/acpi/utilities/utcopy.c +1 -1
index 879eaa1..b56953d 100644
@@ -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);
drivers/acpi/utilities/utdebug.c +4 -6
index a914867..2d6a78f 100644
@@ -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) {
drivers/acpi/utilities/utglobal.c +1 -1
index 4442543..d2097de 100644
@@ -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
Signature · 1 line
1.5.5.29.g7134
author reviewer
#48 lore raw

PATCH 47/73 ACPICA: Update version to 20071219

In reply to Len Brown

From: Bob Moore <[email protected]>

Update version to 20071219.

---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acconfig.h +1 -1
index c21e12d..010703e 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#49 lore raw

PATCH 48/73 ACPICA: Fix for SizeOf when used with Buffers and Packages

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/executer/exoparg1.c |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)
drivers/acpi/executer/exoparg1.c +17 -5
index ab5c037..313803b 100644
@@ -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
Signature · 1 line
1.5.5.29.g7134
author reviewer
#50 lore raw

PATCH 49/73 ACPICA: Methods now implicitly return 0 in slack mode

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/parser/psparse.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
drivers/acpi/parser/psparse.c +24 -0
index a8995ca..a4c4020 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#35 lore raw

PATCH 35/73 ACPICA: Cleanup of debug output

In reply to Len Brown

From: Bob Moore <[email protected]>

Improved output of object dump routine.

---
 drivers/acpi/executer/exdump.c |   39 ++++++++++++++++++++++++++++++---------
 1 files changed, 30 insertions(+), 9 deletions(-)
drivers/acpi/executer/exdump.c +30 -9
index e48d916..251d84b 100644
@@ -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;
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#36 lore raw

PATCH 36/73 ACPICA: Fixes a problem with control method references within packages

In reply to Len Brown

From: Bob Moore <[email protected]>

Completes the package changes started with version 20071019.

---
 drivers/acpi/dispatcher/dswexec.c |    2 +-
 drivers/acpi/executer/exresnte.c  |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/acpi/dispatcher/dswexec.c +1 -1
index 514b9d2..6af4671 100644
@@ -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);
drivers/acpi/executer/exresnte.c +2 -1
index 2b3a01c..79a0d28 100644
@@ -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:
Signature · 1 line
1.5.5.29.g7134
author reviewer
#39 lore raw

PATCH 39/73 ACPICA: Fixed a problem with CopyObject used in conjunction with the Index operator

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/executer/exresnte.c |    7 +++----
 drivers/acpi/executer/exresolv.c |   16 ++++++++++------
 2 files changed, 13 insertions(+), 10 deletions(-)
drivers/acpi/executer/exresnte.c +3 -4
index 79a0d28..42c8a0f 100644
@@ -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;
drivers/acpi/executer/exresolv.c +10 -6
index 795ec8c..9c3cdf6 100644
@@ -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;
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#51 lore raw

PATCH 50/73 ACPICA: Fix for Load operator

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/tables/tbinstal.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/acpi/tables/tbinstal.c +1 -0
index 6a6ee1f..c4a9abb 100644
@@ -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;
 	}
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#37 lore raw

PATCH 37/73 ACPICA: Fixed a problem with FromBCD and ToBCD with some compilers

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/utilities/utmath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/utilities/utmath.c +1 -1
index 0c56a0d..16dbf66 100644
@@ -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);
Signature · 1 line
1.5.5.29.g7134
author reviewer
#38 lore raw

PATCH 38/73 ACPICA: Fixed a problem with Index references passed as method arguments

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/executer/exresolv.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
drivers/acpi/executer/exresolv.c +8 -2
index 74ab220..795ec8c 100644
@@ -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;
Signature · 1 line
1.5.5.29.g7134
author reviewer
#52 lore raw

PATCH 51/73 ACPICA: Fix for LoadTable operator, input strings

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/executer/exconfig.c |    5 +----
 drivers/acpi/tables/tbfind.c     |   32 +++++++++++++++++++++++---------
 2 files changed, 24 insertions(+), 13 deletions(-)
drivers/acpi/executer/exconfig.c +1 -4
index 52b1e95..ed92fb5 100644
@@ -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);
 }
drivers/acpi/tables/tbfind.c +23 -9
index 058c064..772ca41 100644
@@ -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);
 		}
 	}
Signature · 1 line
1.5.5.29.g7134
author reviewer
#53 lore raw

PATCH 52/73 ACPICA: Include file support for new ACPI tables

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 include/acpi/actbl1.h |  335 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 334 insertions(+), 1 deletions(-)
include/acpi/actbl1.h +334 -1
index dd8e11e..5d39992 100644
@@ -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
  *
  ******************************************************************************/
Signature · 1 line
1.5.5.29.g7134
author reviewer
#55 lore raw

PATCH 54/73 ACPICA: Fixes for Unload and DDBHandles

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 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(-)
drivers/acpi/executer/exdump.c +19 -8
index 251d84b..ed560e6 100644
@@ -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);
drivers/acpi/executer/exresolv.c +9 -4
index 9c3cdf6..5b5b2ff 100644
@@ -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:
 
drivers/acpi/executer/exstore.c +18 -5
index 2408122..725614e 100644
@@ -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) {
drivers/acpi/parser/psargs.c +34 -3
index 442880f..2a3a948 100644
@@ -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 */
 
drivers/acpi/utilities/utcopy.c +8 -0
index b56953d..ba89971 100644
@@ -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;
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#58 lore raw

PATCH 57/73 ACPICA: Added new error messages

In reply to Len Brown

From: Bob Moore <[email protected]>

New messages for the 2 AE_SUPPORT cases.

---
 drivers/acpi/utilities/utcopy.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/acpi/utilities/utcopy.c +9 -0
index ba89971..4c4021d 100644
@@ -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);
 	}
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#40 lore raw

PATCH 40/73 ACPICA: Update version to 20071114

In reply to Len Brown

From: Bob Moore <[email protected]>

Update version to 20071114.

---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acconfig.h +1 -1
index a2d4c87..c21e12d 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#41 lore raw

PATCH 41/73 ACPICA: Fixed a problem with AcpiGetDevices where the search of a branch of the device tree could be terminated prematurely

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 drivers/acpi/namespace/nsxfeval.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/acpi/namespace/nsxfeval.c +8 -5
index b92133f..cd97c80 100644
@@ -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.
  *
  ******************************************************************************/
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#42 lore raw

PATCH 42/73 ACPICA: Fixed a problem with Index Fields where the Index register was incorrectly limited to a maximum of 32 bits

In reply to Len Brown

From: Bob Moore <[email protected]>

Now any size may be used.

---
 drivers/acpi/executer/exfield.c |   37 -----------------------------------
 drivers/acpi/executer/exfldio.c |   41 ++++++++++++++++++++++++++++++++------
 2 files changed, 34 insertions(+), 44 deletions(-)
drivers/acpi/executer/exfield.c +0 -37
index da772cb..aef8db8 100644
@@ -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);
 }
drivers/acpi/executer/exfldio.c +34 -7

64 lines not on this page · raw message

Signature · 1 line
1.5.5.29.g7134
author reviewer
#44 lore raw

PATCH 44/73 ACPICA: Undo accidental checkin of not-fully-tested mutex changes

In reply to Len Brown

From: Bob Moore <[email protected]>

---
 drivers/acpi/executer/exmutex.c |   16 ----------------
 1 files changed, 0 insertions(+), 16 deletions(-)
drivers/acpi/executer/exmutex.c +0 -16
index 7c70938..b8d035c 100644
@@ -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);
 }
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#57 lore raw

PATCH 56/73 ACPICA: Add va_end statements as appropriate

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/utilities/utdebug.c |    2 ++
 drivers/acpi/utilities/utmisc.c  |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)
drivers/acpi/utilities/utdebug.c +2 -0
index 2d6a78f..8014442 100644
@@ -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)
drivers/acpi/utilities/utmisc.c +4 -0
index 2d19f71..2f48fd6 100644
@@ -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);
 }
Signature · 1 line
1.5.5.29.g7134
author reviewer
#62 lore raw

PATCH 61/73 ACPICA: Fix for resource descriptor optimization issues for _CRS/_SRC

In reply to Len Brown

From: Bob Moore <[email protected]>

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)

---
 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(-)
drivers/acpi/resources/rscalc.c +7 -0
index dcc51e9..db0a835 100644
@@ -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:
drivers/acpi/resources/rsdump.c +6 -2
index 46da116..ed6447d 100644
@@ -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),
drivers/acpi/resources/rsio.c +37 -2
index b297bc3..50f3acd 100644
@@ -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
 	 */
drivers/acpi/resources/rsirq.c +39 -4

79 lines not on this page · raw message

drivers/acpi/resources/rsmisc.c +11 -0
index c7081af..3e69eff 100644
@@ -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"));
include/acpi/acresrc.h +1 -0
index 9486ab2..33e9f38 100644
@@ -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 */
 
include/acpi/actypes.h +2 -0
index bb44700..599657e 100644
@@ -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;
 };
Signature · 1 line
1.5.5.29.g7134
author reviewer
#43 lore raw

PATCH 43/73 ACPICA: Implemented full support for deferred execution for the TermArg string arguments for DataTableRegion

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 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(-)
drivers/acpi/dispatcher/dsopcode.c +103 -0
index f0847ee..a3f2979 100644
@@ -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
drivers/acpi/dispatcher/dswexec.c +11 -0
index 6af4671..8ba4bb3 100644
@@ -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;
 
drivers/acpi/dispatcher/dswload.c +20 -9
index 8ab9d1b..ec68c1d 100644
@@ -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);
drivers/acpi/executer/excreate.c +0 -95

101 lines not on this page · raw message

drivers/acpi/executer/exmutex.c +16 -0
index b8d035c..7c70938 100644
@@ -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);
 }
 
drivers/acpi/parser/psloop.c +4 -2
index 4348b05..a079975 100644
@@ -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
drivers/acpi/parser/psopcode.c +2 -2
index 153621d..b273a0a 100644
@@ -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,
include/acpi/acdispat.h +4 -0
index 3bffb4d..d8dabe8 100644
@@ -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);
include/acpi/acinterp.h +0 -2
index 92eb014..f4dd98f 100644
@@ -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);
Signature · 1 line
1.5.5.29.g7134
author reviewer
#54 lore raw

PATCH 53/73 ACPICA: Bulletproof disassembler for bad ACPI tables

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 include/acpi/acdisasm.h |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
include/acpi/acdisasm.h +7 -6
index 67d152e..07d5241 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#64 lore raw

PATCH 63/73 ACPICA: Fix for possible error when packages/buffers are passed to methods externally

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 drivers/acpi/utilities/utcopy.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/acpi/utilities/utcopy.c +8 -0
index 4c4021d..4e9a62b 100644
@@ -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);
 }
Signature · 1 line
1.5.5.29.g7134
author reviewer
#65 lore raw

PATCH 64/73 ACPICA: Update ACPICA version to 20080213

In reply to Len Brown

From: Bob Moore <[email protected]>

Update ACPICA version to 20080213.

---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acconfig.h +1 -1
index c7d5c91..2c85fd3 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#87 lore raw

PATCH 66/73 ACPICA: Fix to handle NULL package elements correctly

In reply to Len Brown

From: Bob Moore <[email protected]>

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)

---
 drivers/acpi/utilities/utobject.c |    5 ++---
 include/acpi/actypes.h            |   29 +++++++++++++++++------------
 2 files changed, 19 insertions(+), 15 deletions(-)
drivers/acpi/utilities/utobject.c +2 -3
index 1eccd3d..cdb8ff5 100644
@@ -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:
include/acpi/actypes.h +17 -12
index 599657e..75ec153 100644
@@ -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;
Signature · 1 line
1.5.5.29.g7134
author reviewer
#56 lore raw

PATCH 55/73 ACPICA: Update version to 20080123

In reply to Len Brown

From: Bob Moore <[email protected]>

Update version to 20080123.

---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acconfig.h +1 -1
index 010703e..c7d5c91 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#60 lore raw

PATCH 59/73 ACPICA: Disassembler support for new ACPI tables

In reply to Len Brown

From: Bob Moore <[email protected]>

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).

---
 include/acpi/acdisasm.h |   26 ++++-
 include/acpi/actbl1.h   |  233 ++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 249 insertions(+), 10 deletions(-)
include/acpi/acdisasm.h +21 -5
index 07d5241..73d86eb 100644
@@ -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);
 
 /*
include/acpi/actbl1.h +228 -5

269 lines not on this page · raw message

Signature · 1 line
1.5.5.29.g7134
author reviewer
#88 lore raw

PATCH 67/73 ACPICA: Fixes for external Reference Objects

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 drivers/acpi/utilities/utcopy.c |   32 ++++++++++++++++++++++++--------
 1 files changed, 24 insertions(+), 8 deletions(-)
drivers/acpi/utilities/utcopy.c +24 -8
index 4e9a62b..2a57c2c 100644
@@ -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;
Signature · 1 line
1.5.5.29.g7134
author reviewer
#59 lore raw

PATCH 58/73 ACPICA: Fix for ACPI_HIDWORD macro

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 include/acpi/acmacros.h |   69 ++++++++++++++++++++++++-----------------------
 1 files changed, 35 insertions(+), 34 deletions(-)
include/acpi/acmacros.h +35 -34
index dc6a037..1f0fdbf 100644
@@ -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];\
Signature · 1 line
1.5.5.29.g7134
author reviewer
#61 lore raw

PATCH 60/73 ACPICA: Additional GPE/Notify handling change

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/events/evgpe.c |   40 ++++++++++++++++++++++++++++++----------
 1 files changed, 30 insertions(+), 10 deletions(-)
drivers/acpi/events/evgpe.c +30 -10
index 0dadd2a..897baed 100644
@@ -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;
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#63 lore raw

PATCH 62/73 ACPICA: Update behavior of CopyObject to match ACPI spec

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/executer/exstore.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
drivers/acpi/executer/exstore.c +11 -4
index 725614e..36c0fcc 100644
@@ -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;
 	}
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#66 lore raw

PATCH 65/73 ACPICA: Fix for extraneous debug message for packages

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 drivers/acpi/dispatcher/dsobject.c |   33 ++++++++++++++++++++++++++++++---
 1 files changed, 30 insertions(+), 3 deletions(-)
drivers/acpi/dispatcher/dsobject.c +30 -3
index 58d4d91..5184278 100644
@@ -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;
Signature · 1 line
1.5.5.29.g7134
author reviewer
#90 lore raw

PATCH 68/73 ACPICA: Updates for Debug object output

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 drivers/acpi/executer/exstore.c |   76 ++++++++++++++++++++++++++------------
 1 files changed, 52 insertions(+), 24 deletions(-)
drivers/acpi/executer/exstore.c +52 -24
index 36c0fcc..dbc5e18 100644
@@ -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;
 	}
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#91 lore raw

PATCH 69/73 ACPICA: Fixes for size of StartDependent resource descriptor

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/resources/rscalc.c |   11 +++++++++++
 drivers/acpi/resources/rsio.c   |    2 +-
 2 files changed, 12 insertions(+), 1 deletions(-)
drivers/acpi/resources/rscalc.c +11 -0
index db0a835..d801823 100644
@@ -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:
drivers/acpi/resources/rsio.c +1 -1
index 50f3acd..610d7c2 100644
@@ -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
Signature · 1 line
1.5.5.29.g7134
author reviewer
#92 lore raw

PATCH 70/73 ACPICA: Fix to disable unknown spurious GPEs

In reply to Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/events/evgpe.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
drivers/acpi/events/evgpe.c +8 -1
index 897baed..6940f5d 100644
@@ -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);
 	}
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#111 lore raw

PATCH 71/73 ACPICA: Update for new Notify values

In reply to Len Brown

From: Bob Moore <[email protected]>

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)

---
 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(-)
drivers/acpi/events/evmisc.c +23 -36
index 4e7a13a..16cf270 100644
@@ -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));
 	}
drivers/acpi/utilities/utglobal.c +42 -0

48 lines not on this page · raw message

include/acpi/actypes.h +15 -9
index 75ec153..cc24cef 100644
@@ -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
include/acpi/acutils.h +2 -0
index a291854..26115da 100644
@@ -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);
Signature · 1 line
1.5.5.29.g7134
author reviewer
#112 lore raw

PATCH 72/73 ACPICA: Update version to 20080321

In reply to Len Brown

From: Bob Moore <[email protected]>

Update version to 20080321.

---
 include/acpi/acconfig.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/acpi/acconfig.h +1 -1
index 2c85fd3..b4668b1 100644
@@ -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,
Signature · 1 line
1.5.5.29.g7134
author reviewer
#113 lore raw

PATCH 73/73 ACPICA: Fix for some local named nodes not marked temporary and to disallow duplicates

In reply to Len Brown

From: Bob Moore <[email protected]>

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.

---
 drivers/acpi/dispatcher/dsfield.c |  121 ++++++++++++++++++++++---------------
 drivers/acpi/dispatcher/dswload.c |    6 ++
 2 files changed, 79 insertions(+), 48 deletions(-)
drivers/acpi/dispatcher/dsfield.c +73 -48
index e87f6bf..0befcff 100644
@@ -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;
 	}
drivers/acpi/dispatcher/dswload.c +6 -0
index ec68c1d..775b183 100644
@@ -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;
 	}
 
Signature · 1 line
1.5.5.29.g7134
author reviewer
#114 lore raw

Re: ACPICA branch - first try Core revision 20080321

In reply to Len Brown

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

Quoted 1 line

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

Quoted 1 line

early res: 2 [200000-8d9747] TEXT DATA BSS

95a96

Quoted 1 line

spurious 8259A interrupt: IRQ7.

102c103
< Memory: 442500k/458560k available (3629k kernel code, 15672k reserved, 2023k data, 364k init)
---

Quoted 1 line

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)
---

Quoted 1 line

Calibrating delay using timer specific routine.. 3194.25 BogoMIPS (lpj=1597129)

113c114
< ACPI: Core revision 20070126
---

Quoted 1 line

ACPI: Core revision 20080321

126c127
< Calibrating delay using timer specific routine.. 3191.63 BogoMIPS (lpj=1595818)
---

Quoted 1 line

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)
---

Quoted 2 lines

Completing Region/Field/Buffer/Package initialization:............................................................................................................................................................... Initialized 29/33 Regions 0/0 Fields 63/64 Buffers 67/78 Packages (1172 nodes)

160a162,168

Quoted 7 lines

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

Quoted 1 line

PCI: Bridge: 0000:00:05.0

381c389
< usb usb1: Manufacturer: Linux 2.6.25-rc9 ehci_hcd
---

Quoted 1 line

usb usb1: Manufacturer: Linux 2.6.25-rc9-00073-g8b56e6a ehci_hcd

394c402
< usb usb2: Manufacturer: Linux 2.6.25-rc9 ohci_hcd
---

Quoted 1 line

usb usb2: Manufacturer: Linux 2.6.25-rc9-00073-g8b56e6a ohci_hcd

406c414
< usb usb3: Manufacturer: Linux 2.6.25-rc9 ohci_hcd
---

Quoted 1 line

usb usb3: Manufacturer: Linux 2.6.25-rc9-00073-g8b56e6a ohci_hcd

448a457,463

Quoted 7 lines

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

Quoted 4 lines

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

Quoted 8 lines

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

Quoted 1 line

ACPI: WMI: Mapper loaded

481c508
< power_supply C1BF: prop VOLTAGE_NOW=12617000
---

Quoted 1 line

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)
---

Quoted 1 line

Clocksource tsc unstable (delta = -249928054 ns)

527a537,600

Quoted 56 lines

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
Quoted 8 lines
 [<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 ]---

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 [email protected]).
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 <[email protected]>
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: [email protected]
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 ]---
#115 lore raw

Re: ACPICA branch - first try Core revision 20080321

Quoted 9 lines · Len Brown

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

drivers/acpi/utils.c +1 -1
index 44ea60c..1009261 100644
@@ -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",

Quoted 5 lines

2. memory coorruption:

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

drop #60

Quoted 3 lines

-Len

Regards,
Alex.

author reviewer
#67 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

In reply to Len Brown

From: Len Brown <[email protected]>

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’

---
 drivers/acpi/dispatcher/dsobject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/dispatcher/dsobject.c +1 -1
index 5184278..bdef2f0 100644
@@ -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;
 
Signature · 6 lines
1.5.5.49.gf43e2

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author reviewer
#116 lore raw

Re: ACPICA branch - first try Core revision 20080321

In reply to Alexey Starikovskiy
Quoted 26 lines · Alexey Starikovskiy
Quoted 9 lines · Len Brown

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

drivers/acpi/utils.c +1 -1
index 44ea60c..1009261 100644
@@ -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",

Quoted 6 lines
Quoted 5 lines

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:

Quoted 5 lines

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]

#68 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

In reply to Len Brown
Quoted 15 lines · Len Brown

From: Len Brown <[email protected]>

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’

---
 drivers/acpi/dispatcher/dsobject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/dispatcher/dsobject.c +0 -0
index 5184278..bdef2f0 100644

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, · line 377

Quoted 6 lines
drivers/acpi/dispatcher/dsobject.c +1 -1
@@ -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 ?

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, · line 378

Quoted 4 lines
drivers/acpi/dispatcher/dsobject.c +0 -0
 	u16 index;
 	u16 reference_count;

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

#69 lore raw

RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

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

Quoted 8 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 15, 2008 1:36 AM
To: Len Brown
Cc: [email protected]; Moore, Robert; Alexey Starikovskiy
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 4 lines
Quoted 3 lines · Len Brown

From: Len Brown <[email protected]>

drivers/acpi/dispatcher/dsobject.c:499: warning: format '%X' expects

type

Quoted 2 lines

'unsigned int', but argument 4 has type 'acpi_native_uint'

Quoted 1 line

drivers/acpi/dispatcher/dsobject.c:507: warning: format '%X' expects

type

Quoted 25 lines

'unsigned int', but argument 7 has type 'acpi_native_uint'

Review

Quoted 7 lines
---
 drivers/acpi/dispatcher/dsobject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/dispatcher/dsobject.c

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct

Quoted 4 lines

index 5184278..bdef2f0 100644

drivers/acpi/dispatcher/dsobject.c +0 -0
@@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct

acpi_walk_state *walk_state,

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, · line 379

Quoted 6 lines
drivers/acpi/dispatcher/dsobject.c +1 -1
 	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 ?

Quoted 4 lines
drivers/acpi/dispatcher/dsobject.c +0 -0
 	u16 index;
 	u16 reference_count;
#70 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 7 lines · Robert

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.

Quoted 44 lines

during the linuxiztion, I think

Quoted 8 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 15, 2008 1:36 AM
To: Len Brown
Cc: [email protected]; Moore, Robert; Alexey Starikovskiy
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 4 lines
Quoted 3 lines · Len Brown

From: Len Brown <[email protected]>

drivers/acpi/dispatcher/dsobject.c:499: warning: format '%X' expects

type

Quoted 2 lines

'unsigned int', but argument 4 has type 'acpi_native_uint'

Quoted 1 line

drivers/acpi/dispatcher/dsobject.c:507: warning: format '%X' expects

type

Quoted 24 lines

'unsigned int', but argument 7 has type 'acpi_native_uint'

Review

Quoted 6 lines
---
 drivers/acpi/dispatcher/dsobject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/dispatcher/dsobject.c

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct

Quoted 4 lines

index 5184278..bdef2f0 100644

drivers/acpi/dispatcher/dsobject.c +0 -0
@@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct

acpi_walk_state *walk_state,

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, · line 379

Quoted 6 lines
drivers/acpi/dispatcher/dsobject.c +1 -1
 	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 ?

Quoted 4 lines
drivers/acpi/dispatcher/dsobject.c +0 -0
 	u16 index;
 	u16 reference_count;
#71 lore raw

RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

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
Quoted 10 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 15, 2008 11:57 AM
To: Moore, Robert
Cc: Alexey Starikovskiy; Len Brown; [email protected]
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 1 line · Robert

We use acpi_native_uint for things like array indexes so it goes

32/64

Quoted 8 lines
Quoted 7 lines

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

Quoted 6 lines

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...

Quoted 13 lines

Regards,
Alex.

Quoted 9 lines

during the linuxiztion, I think

Quoted 6 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 15, 2008 1:36 AM
To: Len Brown
Cc: [email protected]; Moore, Robert; Alexey Starikovskiy
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message

for

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

packages

Quoted 3 lines · Len Brown

From: Len Brown <[email protected]>

drivers/acpi/dispatcher/dsobject.c:499: warning: format '%X'

expects

Quoted 3 lines
Quoted 3 lines

type

Quoted 2 lines

'unsigned int', but argument 4 has type 'acpi_native_uint'

Quoted 1 line

drivers/acpi/dispatcher/dsobject.c:507: warning: format '%X'

expects

Quoted 26 lines
Quoted 26 lines

type

Quoted 24 lines

'unsigned int', but argument 7 has type 'acpi_native_uint'

Review

Quoted 6 lines
---
 drivers/acpi/dispatcher/dsobject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/dispatcher/dsobject.c

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct

Quoted 4 lines

index 5184278..bdef2f0 100644

drivers/acpi/dispatcher/dsobject.c +0 -0
@@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct

acpi_walk_state *walk_state,

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, · line 379

Quoted 6 lines
drivers/acpi/dispatcher/dsobject.c +1 -1
 	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 ?

Quoted 4 lines
drivers/acpi/dispatcher/dsobject.c +0 -0
 	u16 index;
 	u16 reference_count;
#72 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 5 lines · Robert

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

Quoted 10 lines
 * 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?

#73 lore raw

RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

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.

Quoted 10 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 15, 2008 1:40 PM
To: Moore, Robert
Cc: Alexey Starikovskiy; Len Brown; [email protected]
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 1 line · Robert

I think one of the reasons we introduced ACPI_NATIVE_UINT is that

"int"

Quoted 17 lines
Quoted 4 lines

is in fact not "native" under all compilation models.

Here is the table from actypes.h

Quoted 10 lines
 * 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?

#74 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 6 lines · Robert

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.

Quoted 31 lines
Quoted 10 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 15, 2008 1:40 PM
To: Moore, Robert
Cc: Alexey Starikovskiy; Len Brown; [email protected]
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 2 lines
Quoted 1 line · Robert

I think one of the reasons we introduced ACPI_NATIVE_UINT is that

"int"

Quoted 17 lines
Quoted 4 lines

is in fact not "native" under all compilation models.

Here is the table from actypes.h

Quoted 10 lines
 * 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?

#75 lore raw

RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

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.

Quoted 8 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 15, 2008 2:12 PM
To: Moore, Robert
Cc: Alexey Starikovskiy; Len Brown; [email protected]
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 4 lines
Quoted 3 lines · Robert

Native word size of the machine.

As I remember, lint especially really likes array indexes that use

the

Quoted 6 lines
Quoted 3 lines

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

Quoted 3 lines

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

Quoted 3 lines

Co.

Now we introduce new typedef to annoy printf(), C, and Linux bosses

only to

Quoted 12 lines

please lint?

Regards,
Alex.

Quoted 8 lines
Quoted 8 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 15, 2008 1:40 PM
To: Moore, Robert
Cc: Alexey Starikovskiy; Len Brown; [email protected]
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message

for

Quoted 23 lines
Quoted 23 lines
Quoted 4 lines

packages

Quoted 1 line · Robert

I think one of the reasons we introduced ACPI_NATIVE_UINT is that

"int"

Quoted 17 lines
Quoted 4 lines

is in fact not "native" under all compilation models.

Here is the table from actypes.h

Quoted 10 lines
 * 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?

#76 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 8 lines · Robert

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.

Quoted 5 lines

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.

#78 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

In reply to Moore, Robert
Quoted 5 lines · Robert

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

#82 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

In reply to Tomas Carnecky
Quoted 17 lines · Tomas Carnecky
Quoted 16 lines · Alexey Starikovskiy
Quoted 15 lines · Robert

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
Quoted 4 lines
Quoted 2 lines

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?

Quoted 4 lines

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.

#81 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

In reply to Alexey Starikovskiy
Quoted 16 lines · Alexey Starikovskiy
Quoted 5 lines · Robert

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

Quoted 10 lines
 * 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
Quoted 2 lines

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

#79 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

In reply to Tomas Carnecky
Quoted 7 lines · Tomas Carnecky
Quoted 5 lines · Robert

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.

Quoted 5 lines

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.

#80 lore raw

RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

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.

Quoted 9 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 15, 2008 2:57 PM
To: Tomas Carnecky
Cc: Moore, Robert; Alexey Starikovskiy; Len Brown; linux- [email protected]
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 4 lines
Quoted 3 lines · Tomas Carnecky
Quoted 2 lines · Robert

Yes, ACPI_NATIVE_UINT has issues with printf because there is unfortunately no printf formatting operator other than %p that goes

32

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

use it with printf.

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

the

Quoted 6 lines
Quoted 6 lines

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,

Quoted 2 lines
Quoted 1 line

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

Quoted 5 lines

appears to
care about that.

Regards,
Alex.

#77 lore raw

RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

In reply to Alexey Starikovskiy
Quoted 1 line

So, once again, why we used acpi_native_uint there and why we changed

that

Quoted 1 line

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.

Quoted 10 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 15, 2008 2:51 PM
To: Moore, Robert
Cc: Alexey Starikovskiy; Len Brown; [email protected]
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 1 line · Robert

Well, yes native word size being the pointer size, now that the

16-bit

Quoted 3 lines
Quoted 3 lines

model is out of the picture.

We defined ACPI_NATIVE_UINT in order to have an integer data type

that

Quoted 1 line
Quoted 1 line

is 32 bits in 32-bit mode, and 64 bits in 64-bit mode (and

originally,

Quoted 5 lines
Quoted 5 lines

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

Quoted 2 lines
Quoted 2 lines

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

Quoted 3 lines
Quoted 1 line

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

Quoted 1 line

"uint32 i;" Both types are not supported by printf(), while the reason

of

Quoted 1 line

the patch to gain such support. There is no expectation that i will

need to

Quoted 2 lines

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

Quoted 4 lines

to uint32 and not unsigned?

Regards,
Alex.

author reviewer
#47 lore raw

Re: [PATCH 46/73] ACPICA: Fixed a couple memory leaks associated with "implicit return" objects when the AML Interpreter slack mode is enabled

In reply to Len Brown

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

thanks,
-Len

Quoted 39 lines · Len Brown

From: Bob Moore <[email protected]>

Lin Ming BZ 349

---
 drivers/acpi/dispatcher/dsmethod.c |    3 +++
 drivers/acpi/dispatcher/dsmthdat.c |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)
drivers/acpi/dispatcher/dsmethod.c +3 -0
index 7a99740..9e24641 100644
@@ -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)) {
 
drivers/acpi/dispatcher/dsmthdat.c +2 -0
index ba4626e..38510d1 100644
@@ -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;
 }
 
author reviewer
#83 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

In reply to Alexey Starikovskiy
Quoted 11 lines · Alexey Starikovskiy
Quoted 10 lines · Len Brown

From: Len Brown <[email protected]>

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’

---
 drivers/acpi/dispatcher/dsobject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 15 lines

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, · line 377

Quoted 11 lines
drivers/acpi/dispatcher/dsobject.c +1 -1
index 5184278..bdef2f0 100644
@@ -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 ?

Quoted 2 lines
drivers/acpi/dispatcher/dsobject.c +0 -0
 	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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#84 lore raw

RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 1 line

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

Quoted 8 lines

-----Original Message-----
From: Len Brown [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 12:23 PM
To: Alexey Starikovskiy
Cc: [email protected]; Moore, Robert; Alexey Starikovskiy
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 5 lines
Quoted 4 lines · Alexey Starikovskiy
Quoted 3 lines · Len Brown

From: Len Brown <[email protected]>

drivers/acpi/dispatcher/dsobject.c:499: warning: format '%X'

expects

Quoted 2 lines

type 'unsigned int', but argument 4 has type 'acpi_native_uint'

Quoted 1 line
Quoted 1 line

drivers/acpi/dispatcher/dsobject.c:507: warning: format '%X'

expects

Quoted 22 lines

type 'unsigned int', but argument 7 has type 'acpi_native_uint'

Quoted 7 lines

Review

Quoted 7 lines
---
 drivers/acpi/dispatcher/dsobject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/dispatcher/dsobject.c

Quoted 4 lines

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct

Quoted 4 lines

index 5184278..bdef2f0 100644

drivers/acpi/dispatcher/dsobject.c +0 -0
@@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct

acpi_walk_state *walk_state,

Quoted 7 lines

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, · line 379

Quoted 6 lines
drivers/acpi/dispatcher/dsobject.c +1 -1
 	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 ?

Quoted 4 lines
Quoted 2 lines

drivers/acpi/dispatcher/dsobject.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, · line 378

Quoted 2 lines
drivers/acpi/dispatcher/dsobject.c +0 -0
 	u16 index;
 	u16 reference_count;

No particular reason, u32 and unsigned are synonyms on the

architectures we

Quoted 4 lines

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-

Quoted 2 lines

bits
would probably work just as well. Certainly acpi_native_uint was

overkill.

Quoted 2 lines

-Len

author reviewer
#89 lore raw

Re: [PATCH 67/73] ACPICA: Fixes for external Reference Objects

In reply to Len Brown

commit cd0b2248241f4146152fb04a6bf4bccb6ce0478a

Author: Bob Moore <[email protected]>
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.

---
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(-)
drivers/acpi/scan.c +1 -2
index e6ce262..464ee6e 100644
@@ -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;
 	}
drivers/acpi/utilities/utcopy.c +24 -8
index 4e9a62b..2a57c2c 100644
@@ -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;
drivers/acpi/utils.c +1 -1
index 44ea60c..1009261 100644
@@ -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",
author reviewer
#85 lore raw

Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

In reply to Moore, Robert
Quoted 5 lines · Robert
Quoted 1 line

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

#86 lore raw

RE: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

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:[email protected]]
Sent: Tuesday, April 22, 2008 4:23 PM
To: Moore, Robert
Cc: Alexey Starikovskiy; [email protected]
Subject: Re: [PATCH 65/73] ACPICA: Fix for extraneous debug message for packages

Quoted 4 lines · Robert
Quoted 1 line

would probably work just as well. Certainly acpi_native_uint was

overkill.

I disagree. Often more efficient to use machine native word rather

than

Quoted 1 line

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

author reviewer
#93 lore raw

Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

In reply to Len Brown
Quoted 25 lines · Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/events/evgpe.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
drivers/acpi/events/evgpe.c +1 -1
index 897baed..6940f5d 100644
@@ -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)) {
+	/*

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info) · line 263

Quoted 10 lines
drivers/acpi/events/evgpe.c +7 -0
+	 * 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

#94 lore raw

Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

Quoted 41 lines · Len Brown
Quoted 25 lines · Len Brown

From: Bob Moore <[email protected]>

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

---
 drivers/acpi/events/evgpe.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
drivers/acpi/events/evgpe.c +1 -1
index 897baed..6940f5d 100644
@@ -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)) {
+	/*

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info) · line 263

Quoted 10 lines
drivers/acpi/events/evgpe.c +7 -0
+	 * 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.

Quoted 1 line

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

Quoted 27 lines
(quoted diff) +9 -4
-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
#95 lore raw

RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

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

Quoted 17 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

Quoted 9 lines · Len Brown
Quoted 8 lines · Len Brown

From: Bob Moore <[email protected]>

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

Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
---
 drivers/acpi/events/evgpe.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/events/evgpe.c

Quoted 6 lines
Quoted 4 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct

Quoted 4 lines

index 897baed..6940f5d 100644

drivers/acpi/events/evgpe.c +0 -0
@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct

acpi_gpe_event_info *gpe_event_info)

Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)

Quoted 7 lines
drivers/acpi/events/evgpe.c +4 -1
 	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

Quoted 11 lines
Quoted 1 line

drivers/acpi/events/evgpe.c

Quoted 1 line
drivers/acpi/events/evgpe.c +1 -0
+	 * be a spurious or stray GPE -- disable it in the default case

below.

Quoted 9 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info) · line 262

Quoted 6 lines
drivers/acpi/events/evgpe.c +3 -0
+	 */
+	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

Quoted 2 lines

on my T61.

Quoted 1 line

Certainly this is a case of the EC getting an interrupt (GPE x02)

before

Quoted 15 lines

it has initialized.

Quoted 2 lines

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

Quoted 7 lines

-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

Quoted 10 lines

int 0x9

Quoted 1 line

+ACPI Error (evregion-0316): No handler for Region [ECOR]

(ffff81007d35dda0) [EmbeddedControl] [20070126]

Quoted 1 line

+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no handler

[20070126]

Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0), AE_NOT_EXIST

Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48), AE_NOT_EXIST

Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_GPE._L02]

Quoted 2 lines

(Node ffff81007d376420), AE_NOT_EXIST

Quoted 1 line

+ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE

method

Quoted 7 lines

[_L02] [20070126]

Quoted 1 line

evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled 3

Runtime GPEs in this block

Review

Quoted 3 lines

ACPI: EC: EC description table is found, configuring boot EC

(quoted diff) +0 -2
-ACPI: EC: non-query interrupt received, switching to interrupt mode
-Completing Region/Field/Buffer/Package

initialization:........................................................

....

Quoted 3 lines

............................................................

Quoted 1 line

.......................................................................

....

Quoted 1 line

.......................................................................

....

Quoted 2 lines

................

Quoted 1 line

-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 3 lines

(1888 nodes)

Quoted 1 line

+Completing Region/Field/Buffer/Package

initialization:........................................................

....

Quoted 3 lines

............................................................

Quoted 1 line

.......................................................................

....

Quoted 1 line

.......................................................................

....

Quoted 2 lines

.................

Quoted 1 line

+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 8 lines

(1888 nodes)

Quoted 1 line

Initializing Device/Processor/Thermal objects by executing _INI

methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI

Quoted 3 lines

+ACPI: EC: non-query interrupt received, switching to interrupt mode
.......
Executed 8 _INI methods requiring 2 _STA executions (examined 88

objects)

Quoted 1 line

ACPI: Interpreter enabled

author reviewer
#96 lore raw

Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

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

Quoted 135 lines · Robert

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

Quoted 17 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

Quoted 9 lines · Len Brown
Quoted 8 lines · Len Brown

From: Bob Moore <[email protected]>

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

Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
---
 drivers/acpi/events/evgpe.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/events/evgpe.c

Quoted 6 lines
Quoted 4 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct

Quoted 4 lines

index 897baed..6940f5d 100644

drivers/acpi/events/evgpe.c +0 -0
@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct

acpi_gpe_event_info *gpe_event_info)

Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)

Quoted 7 lines
drivers/acpi/events/evgpe.c +4 -1
 	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

Quoted 11 lines
Quoted 1 line

drivers/acpi/events/evgpe.c

Quoted 1 line
drivers/acpi/events/evgpe.c +1 -0
+	 * be a spurious or stray GPE -- disable it in the default case

below.

Quoted 9 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info) · line 262

Quoted 6 lines
drivers/acpi/events/evgpe.c +3 -0
+	 */
+	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

Quoted 2 lines

on my T61.

Quoted 1 line

Certainly this is a case of the EC getting an interrupt (GPE x02)

before

Quoted 15 lines

it has initialized.

Quoted 2 lines

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

Quoted 7 lines

-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

Quoted 10 lines

int 0x9

Quoted 1 line

+ACPI Error (evregion-0316): No handler for Region [ECOR]

(ffff81007d35dda0) [EmbeddedControl] [20070126]

Quoted 1 line

+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no handler

[20070126]

Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0), AE_NOT_EXIST

Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48), AE_NOT_EXIST

Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_GPE._L02]

Quoted 2 lines

(Node ffff81007d376420), AE_NOT_EXIST

Quoted 1 line

+ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE

method

Quoted 7 lines

[_L02] [20070126]

Quoted 1 line

evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled 3

Runtime GPEs in this block

Review

Quoted 3 lines

ACPI: EC: EC description table is found, configuring boot EC

(quoted diff) +0 -2
-ACPI: EC: non-query interrupt received, switching to interrupt mode
-Completing Region/Field/Buffer/Package

initialization:........................................................

....

Quoted 3 lines

............................................................

Quoted 1 line

.......................................................................

....

Quoted 1 line

.......................................................................

....

Quoted 2 lines

................

Quoted 1 line

-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 3 lines

(1888 nodes)

Quoted 1 line

+Completing Region/Field/Buffer/Package

initialization:........................................................

....

Quoted 3 lines

............................................................

Quoted 1 line

.......................................................................

....

Quoted 1 line

.......................................................................

....

Quoted 2 lines

.................

Quoted 1 line

+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 8 lines

(1888 nodes)

Quoted 1 line

Initializing Device/Processor/Thermal objects by executing _INI

methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI

Quoted 3 lines

+ACPI: EC: non-query interrupt received, switching to interrupt mode
.......
Executed 8 _INI methods requiring 2 _STA executions (examined 88

objects)

Quoted 1 line

ACPI: Interpreter enabled

#97 lore raw

Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

Quoted 6 lines · Len Brown

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

Quoted 158 lines · Robert
Quoted 3 lines

Alexey,

I remember there was some discussion on this, but I'm still not sure

why

Quoted 1 line

the patch for 6217 (Ignore GPE if valid and not enabled) makes the

other

Quoted 12 lines

problem (too early enabling of GPEs) apparent. Please explain.

Thanks,
Bob

Quoted 6 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious

GPEs

Quoted 26 lines
Quoted 11 lines
Quoted 9 lines · Len Brown
Quoted 8 lines · Len Brown

From: Bob Moore <[email protected]>

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

Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
---
 drivers/acpi/events/evgpe.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/events/evgpe.c

Quoted 6 lines
Quoted 4 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct

Quoted 4 lines

index 897baed..6940f5d 100644

drivers/acpi/events/evgpe.c +0 -0
@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct

acpi_gpe_event_info *gpe_event_info)

Quoted 1 line
Quoted 1 line
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)

Quoted 7 lines
  ACPI_FUNCTION_TRACE(ev_disable_gpe);

- if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
+ /*

drivers/acpi/events/evgpe.c +3 -0
+  * Ignore this if the GPE is valid and not enabled.
+  *
+  * Flags is only zero if GPE is neither enabled or disabled --

it may

Quoted 1 line
Quoted 1 line
Quoted 1 line

+ * be a spurious or stray GPE -- disable it in the default

case

Quoted 10 lines
Quoted 10 lines

below.

Quoted 9 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info) · line 262

Quoted 6 lines
drivers/acpi/events/evgpe.c +3 -0
+  */
+ 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

Quoted 9 lines

below

Quoted 2 lines

on my T61.

Quoted 1 line

Certainly this is a case of the EC getting an interrupt (GPE x02)

before

Quoted 5 lines

it has initialized.

Quoted 2 lines

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...

Quoted 4 lines
Quoted 4 lines

It is wroong to enable GPE before handler for it is installed...
http://bugzilla.kernel.org/show_bug.cgi?id=9916

Quoted 1 line
Quoted 11 lines
Quoted 6 lines
Quoted 6 lines

-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

Quoted 4 lines

int 0x9

Quoted 1 line

+ACPI Error (evregion-0316): No handler for Region [ECOR]

(ffff81007d35dda0) [EmbeddedControl] [20070126]

Quoted 1 line

+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no

handler

Quoted 3 lines
Quoted 3 lines

[20070126]

Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),

AE_NOT_EXIST

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),

AE_NOT_EXIST

Quoted 7 lines
Quoted 1 line
Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_GPE._L02]

Quoted 2 lines

(Node ffff81007d376420), AE_NOT_EXIST

Quoted 1 line

+ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE

method

Quoted 2 lines

[_L02] [20070126]

Quoted 1 line

evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled

3

Quoted 3 lines
Quoted 3 lines

Runtime GPEs in this block

Quoted 2 lines

ACPI: EC: EC description table is found, configuring boot EC
-ACPI: EC: non-query interrupt received, switching to interrupt

mode

Quoted 23 lines
Quoted 1 line
Quoted 1 line

-Completing Region/Field/Buffer/Package

initialization:........................................................
....

Quoted 2 lines

............................................................

Quoted 1 line

.......................................................................
....

.......................................................................
....

Quoted 2 lines

................

Quoted 1 line

-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 2 lines

(1888 nodes)

Quoted 1 line

+Completing Region/Field/Buffer/Package

initialization:........................................................
....

Quoted 2 lines

............................................................

Quoted 1 line
Quoted 12 lines

.......................................................................
....

.......................................................................
....

Quoted 2 lines

.................

Quoted 1 line

+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 4 lines

(1888 nodes)

Quoted 1 line

Initializing Device/Processor/Thermal objects by executing _INI

methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI

Quoted 1 line

+ACPI: EC: non-query interrupt received, switching to interrupt

mode

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

.......
Executed 8 _INI methods requiring 2 _STA executions (examined 88

objects)

Quoted 1 line

ACPI: Interpreter enabled

#98 lore raw

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; [email protected]
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

Quoted 6 lines · Len Brown

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

Quoted 164 lines · Robert
Quoted 3 lines

Alexey,

I remember there was some discussion on this, but I'm still not sure

why

Quoted 1 line

the patch for 6217 (Ignore GPE if valid and not enabled) makes the

other

Quoted 12 lines

problem (too early enabling of GPEs) apparent. Please explain.

Thanks,
Bob

Quoted 6 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious

GPEs

Quoted 26 lines
Quoted 11 lines
Quoted 9 lines · Len Brown
Quoted 8 lines · Len Brown

From: Bob Moore <[email protected]>

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

Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
---
 drivers/acpi/events/evgpe.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/events/evgpe.c

Quoted 6 lines
Quoted 4 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct

Quoted 4 lines

index 897baed..6940f5d 100644

drivers/acpi/events/evgpe.c +0 -0
@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct

acpi_gpe_event_info *gpe_event_info)

Quoted 1 line
Quoted 1 line
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)

Quoted 7 lines
  ACPI_FUNCTION_TRACE(ev_disable_gpe);

- if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
+ /*

drivers/acpi/events/evgpe.c +3 -0
+  * Ignore this if the GPE is valid and not enabled.
+  *
+  * Flags is only zero if GPE is neither enabled or disabled --

it may

Quoted 1 line
Quoted 1 line
Quoted 1 line

+ * be a spurious or stray GPE -- disable it in the default

case

Quoted 10 lines
Quoted 10 lines

below.

Quoted 9 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info) · line 262

Quoted 6 lines
drivers/acpi/events/evgpe.c +3 -0
+  */
+ 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

Quoted 9 lines

below

Quoted 2 lines

on my T61.

Quoted 1 line

Certainly this is a case of the EC getting an interrupt (GPE x02)

before

Quoted 5 lines

it has initialized.

Quoted 2 lines

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...

Quoted 4 lines
Quoted 4 lines

It is wroong to enable GPE before handler for it is installed...
http://bugzilla.kernel.org/show_bug.cgi?id=9916

Quoted 1 line
Quoted 11 lines
Quoted 6 lines
Quoted 6 lines

-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

Quoted 4 lines

int 0x9

Quoted 1 line

+ACPI Error (evregion-0316): No handler for Region [ECOR]

(ffff81007d35dda0) [EmbeddedControl] [20070126]

Quoted 1 line

+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no

handler

Quoted 3 lines
Quoted 3 lines

[20070126]

Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),

AE_NOT_EXIST

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),

AE_NOT_EXIST

Quoted 7 lines
Quoted 1 line
Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_GPE._L02]

Quoted 2 lines

(Node ffff81007d376420), AE_NOT_EXIST

Quoted 1 line

+ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE

method

Quoted 2 lines

[_L02] [20070126]

Quoted 1 line

evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled

3

Quoted 3 lines
Quoted 3 lines

Runtime GPEs in this block

Quoted 2 lines

ACPI: EC: EC description table is found, configuring boot EC
-ACPI: EC: non-query interrupt received, switching to interrupt

mode

Quoted 2 lines
Quoted 1 line
Quoted 1 line

-Completing Region/Field/Buffer/Package

initialization:........................................................

Quoted 4 lines

....

Quoted 2 lines

............................................................

Quoted 1 line

.......................................................................

Quoted 2 lines

....

.......................................................................

Quoted 7 lines

....

Quoted 2 lines

................

Quoted 1 line

-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 2 lines

(1888 nodes)

Quoted 1 line

+Completing Region/Field/Buffer/Package

initialization:........................................................

Quoted 4 lines

....

Quoted 2 lines

............................................................

Quoted 1 line

.......................................................................

Quoted 2 lines

....

.......................................................................

Quoted 8 lines

....

Quoted 2 lines

.................

Quoted 1 line

+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 4 lines

(1888 nodes)

Quoted 1 line

Initializing Device/Processor/Thermal objects by executing _INI

methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI

Quoted 1 line

+ACPI: EC: non-query interrupt received, switching to interrupt

mode

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

.......
Executed 8 _INI methods requiring 2 _STA executions (examined 88

objects)

Quoted 1 line

ACPI: Interpreter enabled

#99 lore raw

Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

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.

Quoted 176 lines · Robert

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; [email protected]
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

Quoted 6 lines · Len Brown

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

Quoted 145 lines · Robert
Quoted 3 lines

Alexey,

I remember there was some discussion on this, but I'm still not sure

why

Quoted 1 line

the patch for 6217 (Ignore GPE if valid and not enabled) makes the

other

Quoted 12 lines

problem (too early enabling of GPEs) apparent. Please explain.

Thanks,
Bob

Quoted 6 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious

GPEs

Quoted 24 lines
Quoted 10 lines
Quoted 9 lines · Len Brown
Quoted 8 lines · Len Brown

From: Bob Moore <[email protected]>

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

Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
---
 drivers/acpi/events/evgpe.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/events/evgpe.c

Quoted 5 lines
Quoted 4 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct

Quoted 4 lines

index 897baed..6940f5d 100644

drivers/acpi/events/evgpe.c +0 -0
@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct

acpi_gpe_event_info *gpe_event_info)

Quoted 9 lines
Quoted 7 lines
Quoted 7 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct · line 255

Quoted 7 lines
drivers/acpi/events/evgpe.c +4 -1
  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

Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/acpi/events/evgpe.c +1 -0
+  * be a spurious or stray GPE -- disable it in the default

case

Quoted 9 lines
Quoted 9 lines

below.

Quoted 8 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct · line 262

Quoted 6 lines
drivers/acpi/events/evgpe.c +3 -0
+  */
+ 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

Quoted 8 lines

below

Quoted 2 lines

on my T61.

Quoted 1 line

Certainly this is a case of the EC getting an interrupt (GPE x02)

before

Quoted 4 lines

it has initialized.

Quoted 1 line

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...

Quoted 14 lines
Quoted 9 lines

It is wroong to enable GPE before handler for it is installed...
http://bugzilla.kernel.org/show_bug.cgi?id=9916

Quoted 6 lines

-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

Quoted 4 lines

int 0x9

Quoted 1 line

+ACPI Error (evregion-0316): No handler for Region [ECOR]

(ffff81007d35dda0) [EmbeddedControl] [20070126]

Quoted 1 line

+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no

handler

Quoted 3 lines
Quoted 3 lines

[20070126]

Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),

AE_NOT_EXIST

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),

AE_NOT_EXIST

Quoted 7 lines
Quoted 1 line
Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_GPE._L02]

Quoted 2 lines

(Node ffff81007d376420), AE_NOT_EXIST

Quoted 1 line

+ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE

method

Quoted 2 lines

[_L02] [20070126]

Quoted 1 line

evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake, Enabled

3

Quoted 3 lines
Quoted 3 lines

Runtime GPEs in this block

Quoted 2 lines

ACPI: EC: EC description table is found, configuring boot EC
-ACPI: EC: non-query interrupt received, switching to interrupt

mode

Quoted 1 line
Quoted 1 line
Quoted 1 line

-Completing Region/Field/Buffer/Package

initialization:........................................................

Quoted 2 lines

....

Quoted 1 line

............................................................

.......................................................................

Quoted 2 lines

....

.......................................................................

Quoted 6 lines

....

Quoted 2 lines

................

Quoted 1 line

-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 2 lines

(1888 nodes)

Quoted 1 line

+Completing Region/Field/Buffer/Package

initialization:........................................................

Quoted 2 lines

....

Quoted 1 line

............................................................

.......................................................................

Quoted 2 lines

....

.......................................................................

Quoted 8 lines

....

Quoted 2 lines

.................

Quoted 1 line

+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 4 lines

(1888 nodes)

Quoted 1 line

Initializing Device/Processor/Thermal objects by executing _INI

methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI

Quoted 1 line

+ACPI: EC: non-query interrupt received, switching to interrupt

mode

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

.......
Executed 8 _INI methods requiring 2 _STA executions (examined 88

objects)

Quoted 1 line

ACPI: Interpreter enabled

#100 lore raw

Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

Quoted 8 lines · Alexey Starikovskiy

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

Quoted 194 lines
Quoted 3 lines · Robert

Yes, this is my question also.

I hope Alexey can help with this. I'm very nervous about any code

that

Quoted 1 line

works or does not work for reasons unknown. When this happens in the

GPE

Quoted 11 lines

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; [email protected]
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious

GPEs

Quoted 8 lines · Len Brown
Quoted 5 lines

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)

Quoted 12 lines
Quoted 1 line

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

Quoted 4 lines · Robert
Quoted 3 lines

Alexey,

I remember there was some discussion on this, but I'm still not

sure

Quoted 9 lines
Quoted 9 lines

why

Quoted 1 line

the patch for 6217 (Ignore GPE if valid and not enabled) makes the

other

Quoted 6 lines

problem (too early enabling of GPEs) apparent. Please explain.

Thanks,
Bob

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown

spurious

Quoted 8 lines
Quoted 8 lines

GPEs

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines · Len Brown
Quoted 5 lines · Len Brown

From: Bob Moore <[email protected]>

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

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 11 lines
Quoted 11 lines

Review

Quoted 11 lines

unknown to the system. This will prevent future interrupts from that GPE. (Zhang Rui) BZ 6217

---
 drivers/acpi/events/evgpe.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/events/evgpe.c

Quoted 5 lines
Quoted 4 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct

Quoted 4 lines

index 897baed..6940f5d 100644

drivers/acpi/events/evgpe.c +0 -0
@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct

acpi_gpe_event_info *gpe_event_info)

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct · line 255

Quoted 7 lines
drivers/acpi/events/evgpe.c +4 -1
  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

--

Quoted 11 lines
Quoted 11 lines
Quoted 2 lines

it may

Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/acpi/events/evgpe.c +1 -0
+  * be a spurious or stray GPE -- disable it in the default

case

Quoted 8 lines
Quoted 8 lines

below.

Quoted 7 lines
Quoted 6 lines
drivers/acpi/events/evgpe.c +3 -0
+  */
+ if (gpe_event_info->flags &&
+     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
          return_ACPI_STATUS(AE_OK);
  }
 
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

When applied to 2.6.25, the patch above causes ACPI Error

messages

Quoted 3 lines

below

Quoted 2 lines

on my T61.

Quoted 1 line

Certainly this is a case of the EC getting an interrupt (GPE

x02)

Quoted 9 lines
Quoted 9 lines
Quoted 5 lines

before

Quoted 4 lines

it has initialized.

Quoted 1 line

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...

Quoted 3 lines
Quoted 3 lines

It is wroong to enable GPE before handler for it is installed...
http://bugzilla.kernel.org/show_bug.cgi?id=9916

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

-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

Quoted 12 lines
Quoted 12 lines
Quoted 5 lines

regs on

Quoted 4 lines

int 0x9

Quoted 1 line

+ACPI Error (evregion-0316): No handler for Region [ECOR]

(ffff81007d35dda0) [EmbeddedControl] [20070126]

Quoted 1 line

+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no

handler

Quoted 3 lines
Quoted 3 lines

[20070126]

Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),

AE_NOT_EXIST

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),

Quoted 8 lines
Quoted 8 lines

AE_NOT_EXIST

Quoted 7 lines
Quoted 1 line
Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_GPE._L02]

Quoted 2 lines

(Node ffff81007d376420), AE_NOT_EXIST

Quoted 1 line

+ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE

method

Quoted 2 lines

[_L02] [20070126]

Quoted 1 line

evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake,

Enabled

Quoted 7 lines
Quoted 7 lines

3

Quoted 3 lines
Quoted 3 lines

Runtime GPEs in this block

Quoted 2 lines

ACPI: EC: EC description table is found, configuring boot EC
-ACPI: EC: non-query interrupt received, switching to interrupt

mode

Quoted 1 line
Quoted 1 line
Quoted 1 line

-Completing Region/Field/Buffer/Package

initialization:........................................................

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

....

Quoted 1 line

............................................................

.......................................................................

Quoted 2 lines

....

Quoted 8 lines
Quoted 8 lines

.......................................................................

Quoted 6 lines

....

Quoted 2 lines

................

Quoted 1 line

-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 2 lines

(1888 nodes)

Quoted 1 line

+Completing Region/Field/Buffer/Package

initialization:........................................................

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

....

Quoted 1 line

............................................................

.......................................................................

Quoted 2 lines

....

.......................................................................

Quoted 3 lines

....

Quoted 2 lines

.................

Quoted 1 line

+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

Packages

Quoted 4 lines

(1888 nodes)

Quoted 1 line

Initializing Device/Processor/Thermal objects by executing _INI

methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI

Quoted 1 line

+ACPI: EC: non-query interrupt received, switching to interrupt

mode

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

.......
Executed 8 _INI methods requiring 2 _STA executions (examined

88

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

objects)

Quoted 1 line

ACPI: Interpreter enabled

#101 lore raw

Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

Quoted 9 lines · Zhang Rui
Quoted 8 lines · Alexey Starikovskiy

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.

Quoted 5 lines

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...

#102 lore raw

RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

Quoted 1 line
Quoted 1 line

After 6217 is applied, when installing EC GPE handler, Linux will

invoke

Quoted 1 line
Quoted 1 line

acpi_hw_write_gpe_enable_reg to try to disable EC GPE which is not

done

Quoted 3 lines
Quoted 1 line

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.

Quoted 7 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Thursday, April 24, 2008 7:40 PM
To: Zhang, Rui
Cc: Moore, Robert; Len Brown; [email protected]
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

Quoted 9 lines
Quoted 8 lines · Zhang Rui
Quoted 7 lines · Alexey Starikovskiy

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

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

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

Quoted 1 line
Quoted 1 line

acpi_hw_write_gpe_enable_reg to try to disable EC GPE which is not

done

Quoted 3 lines
Quoted 1 line

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...

author reviewer
#117 lore raw

Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)

In reply to Len Brown

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

#118 lore raw

RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)

It looks like the tables in question are dynamically loaded:

Quoted 8 lines

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

Quoted 5 lines

-----Original Message-----
From: Len Brown [mailto:[email protected]]
Sent: Tuesday, April 29, 2008 2:05 AM
To: [email protected]; Moore, Robert; Lin, Ming M
Subject: Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0

Regions)

Quoted 54 lines

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

#119 lore raw

RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)

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".

Quoted 86 lines · Robert

It looks like the tables in question are dynamically loaded:

Quoted 8 lines

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

Quoted 5 lines

-----Original Message-----
From: Len Brown [mailto:[email protected]]
Sent: Tuesday, April 29, 2008 2:05 AM
To: [email protected]; Moore, Robert; Lin, Ming M
Subject: Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0

Regions)

Quoted 54 lines

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

#120 lore raw

RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)

In reply to Moore, Robert

Hi, all

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

commit 7f4ac9f91383a0707de559dc8fbca986fc2d302f

Author: Bob Moore <[email protected]>
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.

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

(quoted diff) +0 -0

b/drivers/acpi/executer/exconfig.c
index 24da921..508bb0e 100644

drivers/acpi/executer/exconfig.c +0 -1
@@ -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)) {
Quoted 86 lines · Robert

It looks like the tables in question are dynamically loaded:

Quoted 8 lines

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

Quoted 5 lines

-----Original Message-----
From: Len Brown [mailto:[email protected]]
Sent: Tuesday, April 29, 2008 2:05 AM
To: [email protected]; Moore, Robert; Lin, Ming M
Subject: Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0

Regions)

Quoted 54 lines

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

#121 lore raw

RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)

We should find out how windows handles table loading. Bob

Quoted 6 lines

-----Original Message-----
From: Lin, Ming M
Sent: Monday, May 05, 2008 11:21 PM
To: Moore, Robert
Cc: Len Brown; [email protected]
Subject: RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0

Regions)

Quoted 25 lines

Hi, all

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

commit 7f4ac9f91383a0707de559dc8fbca986fc2d302f

Author: Bob Moore <[email protected]>
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.

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

Quoted 7 lines

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

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

at

Quoted 7 lines

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

drivers/acpi/executer/exconfig.c acpi_ex_load_op(union acpi_operand_object

Quoted 10 lines

exit.

Lin Ming
---

drivers/acpi/executer/exconfig.c +0 -0
index 24da921..508bb0e 100644
@@ -376,7 +376,7 @@ acpi_ex_load_op(union acpi_operand_object

*obj_desc,

Quoted 9 lines
drivers/acpi/executer/exconfig.c +1 -1
       }
 
       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)) {
Quoted 4 lines
Quoted 3 lines · Robert

It looks like the tables in question are dynamically loaded:

Quoted 1 line

ACPI: SSDT 7D6E1B32, 02C4 (r1 PmRef Cpu0Ist 100 INTL

20050513)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
ACPI: SSDT 7D6E1E7B, 085E (r1 PmRef Cpu0Cst 100 INTL

20050513)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
ACPI: SSDT 7D6E1A6A, 00C8 (r1 PmRef Cpu1Ist 100 INTL

20050513)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
ACPI: SSDT 7D6E1DF6, 0085 (r1 PmRef Cpu1Cst 100 INTL

20050513)

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

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

Quoted 3 lines
Quoted 3 lines

potential to cause problems on other machines.

The difference in owner IDs between the two traces might mean that

there

Quoted 13 lines
Quoted 13 lines

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

Quoted 5 lines

-----Original Message-----
From: Len Brown [mailto:[email protected]]
Sent: Tuesday, April 29, 2008 2:05 AM
To: [email protected]; Moore, Robert; Lin, Ming M
Subject: Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0

Quoted 8 lines
Quoted 8 lines

Regions)

Quoted 7 lines

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)

Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L 2100 INTL

20050513)

Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L 2100 INTL

20050513)

Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L 2100 INTL

20050513)

Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L 2100 INTL

20050513)

Quoted 1 line
Quoted 1 line
Quoted 1 line

Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0

Regions

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

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

Quoted 1 line
Quoted 1 line
Quoted 1 line

Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0

Regions

Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI: SSDT 7D6E1B32, 02C4 (r1 PmRef Cpu0Ist 100 INTL

20050513)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Table [SSDT](id 003A) - 6 Objects with 0 Devices 4 Methods 0 Regions
ACPI: SSDT 7D6E1E7B, 085E (r1 PmRef Cpu0Cst 100 INTL

20050513)

Quoted 1 line
Quoted 1 line
Quoted 1 line

Table [SSDT](id 003B) - 16 Objects with 0 Devices 1 Methods 0

Regions

Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI: SSDT 7D6E1A6A, 00C8 (r1 PmRef Cpu1Ist 100 INTL

20050513)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Table [SSDT](id 0046) - 4 Objects with 0 Devices 4 Methods 0 Regions
ACPI: SSDT 7D6E1DF6, 0085 (r1 PmRef Cpu1Cst 100 INTL

20050513)

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

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)

Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI: SSDT 7D6E26D9, 025F (r1 LENOVO TP-7L 2100 INTL

20050513)

Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI: SSDT 7D6E2938, 00A6 (r1 LENOVO TP-7L 2100 INTL

20050513)

Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI: SSDT 7D6E29DE, 04F7 (r1 LENOVO TP-7L 2100 INTL

20050513)

Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI: SSDT 7D6E2ED5, 01D8 (r1 LENOVO TP-7L 2100 INTL

20050513)

Quoted 1 line
Quoted 1 line
Quoted 1 line

Table [SSDT](id 0002) - 11 Objects with 0 Devices 7 Methods 0

Regions

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

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

Quoted 1 line
Quoted 1 line
Quoted 1 line

Table [SSDT](id 0006) - 14 Objects with 1 Devices 2 Methods 0

Regions

Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI: SSDT 7D6E1B32, 02C4 (r1 PmRef Cpu0Ist 100 INTL

20050513)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Table [SSDT](id 0044) - 0 Objects with 0 Devices 0 Methods 0 Regions
ACPI: SSDT 7D6E1E7B, 085E (r1 PmRef Cpu0Cst 100 INTL

20050513)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Table [SSDT](id 0045) - 0 Objects with 0 Devices 0 Methods 0 Regions
ACPI: SSDT 7D6E1A6A, 00C8 (r1 PmRef Cpu1Ist 100 INTL

20050513)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Table [SSDT](id 0050) - 0 Objects with 0 Devices 0 Methods 0 Regions
ACPI: SSDT 7D6E1DF6, 0085 (r1 PmRef Cpu1Cst 100 INTL

20050513)

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

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

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

the SSDT's seem to be working normally, and C-states do too.

-Len

#122 lore raw

RE: ACPICA branch (0 Objects with 0 Devices 0 Methods 0 Regions)

In reply to Lin Ming

Hi, Len

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

Lin Ming

---

(quoted diff) +0 -0

b/drivers/acpi/executer/exconfig.c
index 24da921..508bb0e 100644

drivers/acpi/executer/exconfig.c +0 -1
@@ -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)) {
Quoted 144 lines · Lin Ming

Hi, all

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

commit 7f4ac9f91383a0707de559dc8fbca986fc2d302f

Author: Bob Moore <[email protected]>
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.

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

drivers/acpi/executer/exconfig.c +1 -1
index 24da921..508bb0e 100644
@@ -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)) {
Quoted 86 lines · Robert

It looks like the tables in question are dynamically loaded:

Quoted 8 lines

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

Quoted 5 lines

-----Original Message-----
From: Len Brown [mailto:[email protected]]
Sent: Tuesday, April 29, 2008 2:05 AM
To: [email protected]; Moore, Robert; Lin, Ming M
Subject: Re: ACPICA branch (0 Objects with 0 Devices 0 Methods 0

Regions)

Quoted 54 lines

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

#103 lore raw

RE: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

In reply to Moore, Robert

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

Quoted 10 lines

-----Original Message-----
From: Moore, Robert
Sent: Friday, April 25, 2008 9:57 AM
To: Zhang, Rui; Len Brown
Cc: Alexey Starikovskiy; [email protected]
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

Quoted 1 line

or does not work for reasons unknown. When this happens in the GPE

code, I get

Quoted 19 lines

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; [email protected]
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious GPEs

Quoted 5 lines · Len Brown

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)

Quoted 12 lines
Quoted 1 line

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

Quoted 4 lines · Robert
Quoted 3 lines

Alexey,

I remember there was some discussion on this, but I'm still not

sure

Quoted 17 lines
Quoted 17 lines

why

Quoted 1 line

the patch for 6217 (Ignore GPE if valid and not enabled) makes the

other

Quoted 12 lines

problem (too early enabling of GPEs) apparent. Please explain.

Thanks,
Bob

Quoted 6 lines

-----Original Message-----
From: Alexey Starikovskiy [mailto:[email protected]]
Sent: Tuesday, April 22, 2008 10:29 PM
To: Len Brown
Cc: [email protected]; Moore, Robert; Zhang, Rui
Subject: Re: [PATCH 70/73] ACPICA: Fix to disable unknown spurious

GPEs

Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines · Len Brown
Quoted 5 lines · Len Brown

From: Bob Moore <[email protected]>

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

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 11 lines
Quoted 11 lines

Review

Quoted 11 lines

unknown to the system. This will prevent future interrupts from that GPE. (Zhang Rui) BZ 6217

---
 drivers/acpi/events/evgpe.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/events/evgpe.c

Quoted 6 lines
Quoted 4 lines

drivers/acpi/events/evgpe.c acpi_status acpi_ev_disable_gpe(struct

Quoted 4 lines

index 897baed..6940f5d 100644

drivers/acpi/events/evgpe.c +0 -0
@@ -250,7 +250,14 @@ acpi_status acpi_ev_disable_gpe(struct

acpi_gpe_event_info *gpe_event_info)

Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

drivers/acpi/events/evgpe.c

Quoted 7 lines
  ACPI_FUNCTION_TRACE(ev_disable_gpe);

- if (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK)) {
+ /*

drivers/acpi/events/evgpe.c +3 -0
+  * Ignore this if the GPE is valid and not enabled.
+  *
+  * Flags is only zero if GPE is neither enabled or disabled

--

Quoted 12 lines
Quoted 12 lines
Quoted 2 lines

it may

Quoted 1 line
Quoted 1 line
Quoted 1 line

+ * be a spurious or stray GPE -- disable it in the default

case

Quoted 9 lines
Quoted 9 lines

below.

Quoted 8 lines
Quoted 6 lines
drivers/acpi/events/evgpe.c +3 -0
+  */
+ if (gpe_event_info->flags &&
+     (!(gpe_event_info->flags & ACPI_GPE_ENABLE_MASK))) {
          return_ACPI_STATUS(AE_OK);
  }
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

When applied to 2.6.25, the patch above causes ACPI Error

messages

Quoted 3 lines

below

Quoted 2 lines

on my T61.

Quoted 1 line

Certainly this is a case of the EC getting an interrupt (GPE

x02)

Quoted 11 lines
Quoted 11 lines
Quoted 6 lines

before

Quoted 5 lines

it has initialized.

Quoted 2 lines

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...

Quoted 4 lines
Quoted 4 lines

It is wroong to enable GPE before handler for it is installed...
http://bugzilla.kernel.org/show_bug.cgi?id=9916

Quoted 1 line
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

-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

Quoted 12 lines
Quoted 12 lines
Quoted 5 lines

regs on

Quoted 4 lines

int 0x9

Quoted 1 line

+ACPI Error (evregion-0316): No handler for Region [ECOR]

(ffff81007d35dda0) [EmbeddedControl] [20070126]

Quoted 1 line

+ACPI Error (exfldio-0289): Region EmbeddedControl(3) has no

handler

Quoted 3 lines
Quoted 3 lines

[20070126]

Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.AC__._PSR] (Node ffff81007d364ab0),

AE_NOT_EXIST

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_SB_.PCI0.LPC_.EC__.HKEY.CKC4] (Node ffff81007d364f48),

Quoted 8 lines
Quoted 8 lines

AE_NOT_EXIST

Quoted 7 lines
Quoted 1 line
Quoted 1 line

+ACPI Error (psparse-0537): Method parse/execution failed

[\_GPE._L02]

Quoted 2 lines

(Node ffff81007d376420), AE_NOT_EXIST

Quoted 1 line

+ACPI Exception (evgpe-0584): AE_NOT_EXIST, while evaluating GPE

method

Quoted 2 lines

[_L02] [20070126]

Quoted 1 line

evgpeblk-1052 [00] ev_initialize_gpe_bloc: Found 9 Wake,

Enabled

Quoted 33 lines
Quoted 8 lines

3

Quoted 3 lines
Quoted 3 lines

Runtime GPEs in this block

Quoted 2 lines

ACPI: EC: EC description table is found, configuring boot EC
-ACPI: EC: non-query interrupt received, switching to interrupt

mode

Quoted 2 lines
Quoted 1 line
Quoted 1 line

-Completing Region/Field/Buffer/Package

initialization:........................................................

Quoted 5 lines
Quoted 4 lines

....

Quoted 2 lines

............................................................

Quoted 1 line

.......................................................................

Quoted 3 lines
Quoted 2 lines

....

.......................................................................

Quoted 8 lines
Quoted 7 lines

....

Quoted 2 lines

................

Quoted 1 line

-Initialized 29/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 2 lines

(1888 nodes)

Quoted 1 line

+Completing Region/Field/Buffer/Package

initialization:........................................................

Quoted 5 lines
Quoted 4 lines

....

Quoted 2 lines

............................................................

Quoted 1 line
Quoted 16 lines

.......................................................................

Quoted 3 lines
Quoted 2 lines

....

.......................................................................

Quoted 11 lines
Quoted 8 lines

....

Quoted 2 lines

.................

Quoted 1 line

+Initialized 30/33 Regions 138/138 Fields 64/64 Buffers 55/72

Packages

Quoted 4 lines

(1888 nodes)

Quoted 1 line

Initializing Device/Processor/Thermal objects by executing _INI

methods:.<5>ACPI: BIOS _OSI(Linux) query honored via DMI

Quoted 1 line

+ACPI: EC: non-query interrupt received, switching to interrupt

mode

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

.......
Executed 8 _INI methods requiring 2 _STA executions (examined

88

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

objects)

Quoted 1 line

ACPI: Interpreter enabled