Skip to contentSkip to conversation

Hotfixes in ACPICA 20130418 Release

PATCH New Lv Zheng 3 participants 16 messages May 8, 2013 – Jun 1, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Lv Zheng

author
#1 lore raw

cover Hotfixes in ACPICA 20130418 Release

In reply to a message not in the archive

The 20130418 ACPICA kernel resident system updates is linuxized based on the pm/linux-next branch.
This patch set includes hot fixes useful for -stable.

Bob Moore (1):
ACPICA: Fix possible buffer overflow during a field unit read
operation

Jung-uk Kim (1):
ACPICA: _OSI support: Fix possible memory leak

Tomasz Nowicki (1):
ACPICA: ACPICA: Fix for _INI regression

 drivers/acpi/acpica/exfldio.c |   14 +++++++++++++-
 drivers/acpi/acpica/nsinit.c  |    1 +
 drivers/acpi/acpica/utosi.c   |    3 ++-
 3 files changed, 16 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.10
author
#2 lore raw

PATCH 1/3 ACPICA: Fix possible buffer overflow during a field unit read operation

From: Bob Moore <[email protected]>

Can only happen under these conditions: 1) The DSDT version is 1, meaning integers are 32-bits. 2) The field is between 33 and 64 bits long.
It applies cleanly back to ACPICA 20100806+ (Linux v2.6.37+).

---
 drivers/acpi/acpica/exfldio.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/acpi/acpica/exfldio.c +13 -1
index ec7f569..c84ee95 100644
@@ -720,7 +720,19 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
 
 	if ((obj_desc->common_field.start_field_bit_offset == 0) &&
 	    (obj_desc->common_field.bit_length == access_bit_width)) {
-		status = acpi_ex_field_datum_io(obj_desc, 0, buffer, ACPI_READ);
+		if (buffer_length >= sizeof(u64)) {
+			status =
+			    acpi_ex_field_datum_io(obj_desc, 0, buffer,
+						   ACPI_READ);
+		} else {
+			/* Use raw_datum (u64) to handle buffers < 64 bits */
+
+			status =
+			    acpi_ex_field_datum_io(obj_desc, 0, &raw_datum,
+						   ACPI_READ);
+			ACPI_MEMCPY(buffer, &raw_datum, buffer_length);
+		}
+
 		return_ACPI_STATUS(status);
 	}
 
Signature · 1 line
1.7.10
author
#4 lore raw

PATCH 3/3 ACPICA: ACPICA: Fix for _INI regression

In reply to Lv Zheng

From: Tomasz Nowicki <[email protected]>

This change fixes a problem introduced in 20130328 where _INI methods are no longer executed properly because of a memory block that is not initialized properly. ACPICA BZ1016. Tomasz Nowicki <[email protected]>

---
 drivers/acpi/acpica/nsinit.c |    1 +
 1 file changed, 1 insertion(+)
drivers/acpi/acpica/nsinit.c +1 -0
index 2a431ec..46f0f83 100644
@@ -558,6 +558,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
 	ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
 			(ACPI_TYPE_METHOD, device_node, METHOD_NAME__INI));
 
+	ACPI_MEMSET(info, 0, sizeof(struct acpi_evaluate_info));
 	info->prefix_node = device_node;
 	info->pathname = METHOD_NAME__INI;
 	info->parameters = NULL;
Signature · 1 line
1.7.10
author
#3 lore raw

PATCH 2/3 ACPICA: _OSI support: Fix possible memory leak

In reply to Lv Zheng

From: Jung-uk Kim <[email protected]>

Fixes a possible memory leak in the error exit path.
From 388a9902074c3cfe57d2425d766c491d072d2948 Mon Sep 17 00:00:00 2001
From: Jung-uk Kim <[email protected]>
Date: Fri, 12 Apr 2013 00:24:34 +0000
Subject: ACPICA: _OSI Support: handle any errors from acpi_os_acquire_mutex()
Jung-uk Kim ([email protected]), Bob Moore.

---
 drivers/acpi/acpica/utosi.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/acpica/utosi.c +2 -1
index b15aceb..7e80772 100644
@@ -349,7 +349,8 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state * walk_state)
 	return_value = 0;
 	status = acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
 	if (ACPI_FAILURE(status)) {
-		return (status);
+		acpi_ut_remove_reference(return_desc);
+		return_ACPI_STATUS(status);
 	}
 
 	/* Lookup the interface in the global _OSI list */
Signature · 1 line
1.7.10
author
#5 lore raw

cover ACPICA 20130418 Release

In reply to a message not in the archive

The 20130418 ACPICA kernel resident system updates is linuxized based on the pm/linux-next branch.
The patch set has passed basic build/boot tests on i386/x86-64 machines.

Bob Moore (5):
ACPICA: Change an exception code for the ASL UnLoad() operator
ACPICA: Add BIOS error interface for predefined name validation
support
ACPICA: Add argument typechecking for all predefined ACPI names
ACPICA: Predefined name support: Remove unused local variable
ACPICA: Update version to 20130418

Lv Zheng (1):
ACPICA: Remove unused macros, no functional change

Zhang Rui (1):
ACPICA: Update for "orphan" embedded controller _REG method support

 drivers/acpi/acpica/Makefile      |    1 +
 drivers/acpi/acpica/aclocal.h     |   17 ---
 drivers/acpi/acpica/acmacros.h    |   10 +-
 drivers/acpi/acpica/acnamesp.h    |   43 ++++--
 drivers/acpi/acpica/acpredef.h    |    4 +-
 drivers/acpi/acpica/acstruct.h    |   40 +++--
 drivers/acpi/acpica/acutils.h     |    6 +
 drivers/acpi/acpica/evgpe.c       |    1 -
 drivers/acpi/acpica/evregion.c    |   63 +++-----
 drivers/acpi/acpica/exconfig.c    |    2 +-
 drivers/acpi/acpica/hwxface.c     |    6 +-
 drivers/acpi/acpica/nsarguments.c |  294 +++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/nseval.c      |  247 ++++++++++++++++++-------------
 drivers/acpi/acpica/nsinit.c      |    7 +-
 drivers/acpi/acpica/nspredef.c    |  202 ++++++-------------------
 drivers/acpi/acpica/nsprepkg.c    |   76 +++++-----
 drivers/acpi/acpica/nsrepair.c    |   50 +++----
 drivers/acpi/acpica/nsrepair2.c   |   87 +++++------
 drivers/acpi/acpica/nsxfeval.c    |  162 ++++++++++++++++----
 drivers/acpi/acpica/psxface.c     |   14 +-
 drivers/acpi/acpica/rsutils.c     |    2 +-
 drivers/acpi/acpica/uteval.c      |    2 +-
 drivers/acpi/acpica/utpredef.c    |   16 +-
 drivers/acpi/acpica/utxferror.c   |   51 ++++++-
 include/acpi/acconfig.h           |    4 +-
 include/acpi/acoutput.h           |    8 +-
 include/acpi/acpixf.h             |    2 +-
 27 files changed, 882 insertions(+), 535 deletions(-)
 create mode 100644 drivers/acpi/acpica/nsarguments.c
Signature · 1 line
1.7.10
author
#6 lore raw

PATCH 1/7 ACPICA: Change an exception code for the ASL UnLoad() operator

From: Bob Moore <[email protected]>

Change the exception code for the case where the input DdbHandle is invalid from AE_BAD_PARAMETER to the more appropriate AE_AML_OPERAND_TYPE.

---
 drivers/acpi/acpica/exconfig.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpica/exconfig.c +1 -1
index d93b70b..a689aac 100644
@@ -588,7 +588,7 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)
 	    (ACPI_GET_DESCRIPTOR_TYPE(ddb_handle) != ACPI_DESC_TYPE_OPERAND) ||
 	    (ddb_handle->common.type != ACPI_TYPE_LOCAL_REFERENCE) ||
 	    (!(ddb_handle->common.flags & AOPOBJ_DATA_VALID))) {
-		return_ACPI_STATUS(AE_BAD_PARAMETER);
+		return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
 	}
 
 	/* Get the table index from the ddb_handle */
Signature · 1 line
1.7.10
author
#7 lore raw

PATCH 2/7 ACPICA: Add BIOS error interface for predefined name validation support

In reply to Lv Zheng

From: Bob Moore <[email protected]>

BIOS error message for errors found in predefined names.

---
 drivers/acpi/acpica/acmacros.h  |   10 +++++---
 drivers/acpi/acpica/acutils.h   |    6 +++++
 drivers/acpi/acpica/utxferror.c |   51 ++++++++++++++++++++++++++++++++++++---
 3 files changed, 59 insertions(+), 8 deletions(-)
drivers/acpi/acpica/acmacros.h +6 -4
index 53666bd..530a2f8 100644
@@ -374,10 +374,11 @@
  * the plist contains a set of parens to allow variable-length lists.
  * These macros are used for both the debug and non-debug versions of the code.
  */
-#define ACPI_ERROR_NAMESPACE(s, e)      acpi_ut_namespace_error (AE_INFO, s, e);
-#define ACPI_ERROR_METHOD(s, n, p, e)   acpi_ut_method_error (AE_INFO, s, n, p, e);
-#define ACPI_WARN_PREDEFINED(plist)     acpi_ut_predefined_warning plist
-#define ACPI_INFO_PREDEFINED(plist)     acpi_ut_predefined_info plist
+#define ACPI_ERROR_NAMESPACE(s, e)          acpi_ut_namespace_error (AE_INFO, s, e);
+#define ACPI_ERROR_METHOD(s, n, p, e)       acpi_ut_method_error (AE_INFO, s, n, p, e);
+#define ACPI_WARN_PREDEFINED(plist)         acpi_ut_predefined_warning plist
+#define ACPI_INFO_PREDEFINED(plist)         acpi_ut_predefined_info plist
+#define ACPI_BIOS_ERROR_PREDEFINED(plist)   acpi_ut_predefined_bios_error plist
 
 #else
 
@@ -387,6 +388,7 @@
 #define ACPI_ERROR_METHOD(s, n, p, e)
 #define ACPI_WARN_PREDEFINED(plist)
 #define ACPI_INFO_PREDEFINED(plist)
+#define ACPI_BIOS_ERROR_PREDEFINED(plist)
 
 #endif				/* ACPI_NO_ERROR_MESSAGES */
 
drivers/acpi/acpica/acutils.h +6 -0
index 202f4f1..19e5cf7 100644
@@ -670,6 +670,12 @@ acpi_ut_predefined_info(const char *module_name,
 			u32 line_number,
 			char *pathname, u8 node_flags, const char *format, ...);
 
+void ACPI_INTERNAL_VAR_XFACE
+acpi_ut_predefined_bios_error(const char *module_name,
+			      u32 line_number,
+			      char *pathname,
+			      u8 node_flags, const char *format, ...);
+
 void
 acpi_ut_namespace_error(const char *module_name,
 			u32 line_number,
drivers/acpi/acpica/utxferror.c +47 -4

69 lines not on this page · raw message

Signature · 1 line
1.7.10
author
#8 lore raw

PATCH 3/7 ACPICA: Add argument typechecking for all predefined ACPI names

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Fully implements typechecking on all incoming arguments for all predefined names. This ensures that ACPI-related drivers are passing the correct number of arguments, each of the correct object type.

---
 drivers/acpi/acpica/Makefile      |    1 +
 drivers/acpi/acpica/aclocal.h     |   17 ---
 drivers/acpi/acpica/acnamesp.h    |   43 ++++--
 drivers/acpi/acpica/acpredef.h    |    4 +-
 drivers/acpi/acpica/acstruct.h    |   40 +++--
 drivers/acpi/acpica/evgpe.c       |    1 -
 drivers/acpi/acpica/evregion.c    |    2 +-
 drivers/acpi/acpica/hwxface.c     |    6 +-
 drivers/acpi/acpica/nsarguments.c |  294 +++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/nseval.c      |  247 ++++++++++++++++++-------------
 drivers/acpi/acpica/nsinit.c      |    7 +-
 drivers/acpi/acpica/nspredef.c    |  201 ++++++-------------------
 drivers/acpi/acpica/nsprepkg.c    |   76 +++++-----
 drivers/acpi/acpica/nsrepair.c    |   50 +++----
 drivers/acpi/acpica/nsrepair2.c   |   87 +++++------
 drivers/acpi/acpica/nsxfeval.c    |  162 ++++++++++++++++----
 drivers/acpi/acpica/psxface.c     |   14 +-
 drivers/acpi/acpica/rsutils.c     |    2 +-
 drivers/acpi/acpica/uteval.c      |    2 +-
 drivers/acpi/acpica/utpredef.c    |   16 +-
 include/acpi/acconfig.h           |    4 +-
 21 files changed, 800 insertions(+), 476 deletions(-)
 create mode 100644 drivers/acpi/acpica/nsarguments.c
drivers/acpi/acpica/Makefile +1 -0
index 7ddf29e..29b3dab 100644
@@ -83,6 +83,7 @@ acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
 acpi-y +=		\
 	nsaccess.o	\
 	nsalloc.o	\
+	nsarguments.o	\
 	nsconvert.o	\
 	nsdump.o	\
 	nseval.o	\
drivers/acpi/acpica/aclocal.h +0 -17
index d5bfbd3..dfed265 100644
@@ -362,23 +362,6 @@ union acpi_predefined_info {
 
 #pragma pack()
 
-/* Data block used during object validation */
-
-struct acpi_predefined_data {
-	char *pathname;
-	const union acpi_predefined_info *predefined;
-	union acpi_operand_object *parent_package;
-	struct acpi_namespace_node *node;
-	u32 flags;
-	u32 return_btype;
-	u8 node_flags;
-};
-
-/* Defines for Flags field above */
-
-#define ACPI_OBJECT_REPAIRED    1
-#define ACPI_OBJECT_WRAPPED     2
-
 /* Return object auto-repair info */
 
 typedef acpi_status(*acpi_object_converter) (union acpi_operand_object
drivers/acpi/acpica/acnamesp.h +27 -16

87 lines not on this page · raw message

drivers/acpi/acpica/acpredef.h +2 -2
index b22b709..f600ade 100644
@@ -128,8 +128,8 @@ enum acpi_return_package_types {
 #define ARG_COUNT_IS_MINIMUM            0x8000
 #define METHOD_MAX_ARG_TYPE             ACPI_TYPE_PACKAGE
 
-#define METHOD_GET_COUNT(arg_list)      (arg_list & METHOD_ARG_MASK)
-#define METHOD_GET_NEXT_ARG(arg_list)   (arg_list >> METHOD_ARG_BIT_WIDTH)
+#define METHOD_GET_ARG_COUNT(arg_list)  ((arg_list) & METHOD_ARG_MASK)
+#define METHOD_GET_NEXT_TYPE(arg_list)  (((arg_list) >>= METHOD_ARG_BIT_WIDTH) & METHOD_ARG_MASK)
 
 /* Macros used to build the predefined info table */
 
drivers/acpi/acpica/acstruct.h +28 -12
index 7896d85..fc83c0a 100644
@@ -178,25 +178,41 @@ union acpi_aml_operands {
 };
 
 /*
- * Structure used to pass object evaluation parameters.
+ * Structure used to pass object evaluation information and parameters.
  * Purpose is to reduce CPU stack use.
  */
 struct acpi_evaluate_info {
-	struct acpi_namespace_node *prefix_node;
-	char *pathname;
-	union acpi_operand_object *obj_desc;
-	union acpi_operand_object **parameters;
-	struct acpi_namespace_node *resolved_node;
-	union acpi_operand_object *return_object;
-	u8 param_count;
-	u8 pass_number;
-	u8 return_object_type;
-	u8 flags;
+	/* The first 3 elements are passed by the caller to acpi_ns_evaluate */
+
+	struct acpi_namespace_node *prefix_node;	/* Input: starting node */
+	char *relative_pathname;	/* Input: path relative to prefix_node */
+	union acpi_operand_object **parameters;	/* Input: argument list */
+
+	struct acpi_namespace_node *node;	/* Resolved node (prefix_node:relative_pathname) */
+	union acpi_operand_object *obj_desc;	/* Object attached to the resolved node */
+	char *full_pathname;	/* Full pathname of the resolved node */
+
+	const union acpi_predefined_info *predefined;	/* Used if Node is a predefined name */
+	union acpi_operand_object *return_object;	/* Object returned from the evaluation */
+	union acpi_operand_object *parent_package;	/* Used if return object is a Package */
+
+	u32 return_flags;	/* Used for return value analysis */
+	u32 return_btype;	/* Bitmapped type of the returned object */
+	u16 param_count;	/* Count of the input argument list */
+	u8 pass_number;		/* Parser pass number */
+	u8 return_object_type;	/* Object type of the returned object */
+	u8 node_flags;		/* Same as Node->Flags */
+	u8 flags;		/* General flags */
 };
 
 /* Values for Flags above */
 
-#define ACPI_IGNORE_RETURN_VALUE        1
+#define ACPI_IGNORE_RETURN_VALUE    1
+
+/* Defines for return_flags field above */
+
+#define ACPI_OBJECT_REPAIRED        1
+#define ACPI_OBJECT_WRAPPED         2
 
 /* Info used by acpi_ns_initialize_devices */
 
drivers/acpi/acpica/evgpe.c +0 -1
index a493b52..ae50d6c 100644
@@ -579,7 +579,6 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
 					(local_gpe_event_info->dispatch.
 					 method_node)));
 		}
-
 		break;
 
 	default:
drivers/acpi/acpica/evregion.c +1 -1
index 6555e35..8ae8f5b 100644
@@ -532,7 +532,7 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
 	}
 
 	info->prefix_node = region_obj2->extra.method_REG;
-	info->pathname = NULL;
+	info->relative_pathname = NULL;
 	info->parameters = args;
 	info->flags = ACPI_IGNORE_RETURN_VALUE;
 
drivers/acpi/acpica/hwxface.c +3 -3
index 04c2e16..f4224e6 100644
@@ -495,7 +495,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 	 * Evaluate the \_Sx namespace object containing the register values
 	 * for this state
 	 */
-	info->pathname =
+	info->relative_pathname =
 	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
 	status = acpi_ns_evaluate(info);
 	if (ACPI_FAILURE(status)) {
@@ -506,7 +506,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 
 	if (!info->return_object) {
 		ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]",
-			    info->pathname));
+			    info->relative_pathname));
 		status = AE_AML_NO_RETURN_VALUE;
 		goto cleanup;
 	}
@@ -565,7 +565,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 	if (ACPI_FAILURE(status)) {
 		ACPI_EXCEPTION((AE_INFO, status,
 				"While evaluating Sleep State [%s]",
-				info->pathname));
+				info->relative_pathname));
 	}
 
 	ACPI_FREE(info);
drivers/acpi/acpica/nsarguments.c new file +294 -0

294 lines not on this page · raw message

drivers/acpi/acpica/nseval.c +142 -105

335 lines not on this page · raw message

drivers/acpi/acpica/nsinit.c +3 -4
index 46f0f83..23e426f 100644
@@ -176,7 +176,7 @@ acpi_status acpi_ns_initialize_devices(void)
 	 * part of the ACPI specification.
 	 */
 	info.evaluate_info->prefix_node = acpi_gbl_root_node;
-	info.evaluate_info->pathname = METHOD_NAME__INI;
+	info.evaluate_info->relative_pathname = METHOD_NAME__INI;
 	info.evaluate_info->parameters = NULL;
 	info.evaluate_info->flags = ACPI_IGNORE_RETURN_VALUE;
 
@@ -560,7 +560,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
 
 	ACPI_MEMSET(info, 0, sizeof(struct acpi_evaluate_info));
 	info->prefix_node = device_node;
-	info->pathname = METHOD_NAME__INI;
+	info->relative_pathname = METHOD_NAME__INI;
 	info->parameters = NULL;
 	info->flags = ACPI_IGNORE_RETURN_VALUE;
 
@@ -574,8 +574,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
 
 		/* Ignore error and move on to next device */
 
-		char *scope_name =
-		    acpi_ns_get_external_pathname(info->resolved_node);
+		char *scope_name = acpi_ns_get_external_pathname(info->node);
 
 		ACPI_EXCEPTION((AE_INFO, status, "during %s._INI execution",
 				scope_name));
drivers/acpi/acpica/nspredef.c +43 -158

345 lines not on this page · raw message

drivers/acpi/acpica/nsprepkg.c +39 -37

289 lines not on this page · raw message

drivers/acpi/acpica/nsrepair.c +25 -25

184 lines not on this page · raw message

drivers/acpi/acpica/nsrepair2.c +44 -43

301 lines not on this page · raw message

drivers/acpi/acpica/nsxfeval.c +130 -32

205 lines not on this page · raw message

drivers/acpi/acpica/psxface.c +6 -8
index f682542..11b99ab 100644
@@ -125,7 +125,7 @@ static void acpi_ps_start_trace(struct acpi_evaluate_info *info)
 	}
 
 	if ((!acpi_gbl_trace_method_name) ||
-	    (acpi_gbl_trace_method_name != info->resolved_node->name.integer)) {
+	    (acpi_gbl_trace_method_name != info->node->name.integer)) {
 		goto exit;
 	}
 
@@ -170,7 +170,7 @@ static void acpi_ps_stop_trace(struct acpi_evaluate_info *info)
 	}
 
 	if ((!acpi_gbl_trace_method_name) ||
-	    (acpi_gbl_trace_method_name != info->resolved_node->name.integer)) {
+	    (acpi_gbl_trace_method_name != info->node->name.integer)) {
 		goto exit;
 	}
 
@@ -226,15 +226,14 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
 
 	/* Validate the Info and method Node */
 
-	if (!info || !info->resolved_node) {
+	if (!info || !info->node) {
 		return_ACPI_STATUS(AE_NULL_ENTRY);
 	}
 
 	/* Init for new method, wait on concurrency semaphore */
 
 	status =
-	    acpi_ds_begin_method_execution(info->resolved_node, info->obj_desc,
-					   NULL);
+	    acpi_ds_begin_method_execution(info->node, info->obj_desc, NULL);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
@@ -253,8 +252,7 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
 	 */
 	ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
 			  "**** Begin Method Parse/Execute [%4.4s] **** Node=%p Obj=%p\n",
-			  info->resolved_node->name.ascii, info->resolved_node,
-			  info->obj_desc));
+			  info->node->name.ascii, info->node, info->obj_desc));
 
 	/* Create and init a Root Node */
 
@@ -275,7 +273,7 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
 		goto cleanup;
 	}
 
-	status = acpi_ds_init_aml_walk(walk_state, op, info->resolved_node,
+	status = acpi_ds_init_aml_walk(walk_state, op, info->node,
 				       info->obj_desc->method.aml_start,
 				       info->obj_desc->method.aml_length, info,
 				       info->pass_number);
drivers/acpi/acpica/rsutils.c +1 -1
index a44953c..59bdf37 100644
@@ -736,7 +736,7 @@ acpi_rs_set_srs_method_data(struct acpi_namespace_node *node,
 	}
 
 	info->prefix_node = node;
-	info->pathname = METHOD_NAME__SRS;
+	info->relative_pathname = METHOD_NAME__SRS;
 	info->parameters = args;
 	info->flags = ACPI_IGNORE_RETURN_VALUE;
 
drivers/acpi/acpica/uteval.c +1 -1
index c3f3a7e..1673ddd 100644
@@ -87,7 +87,7 @@ acpi_ut_evaluate_object(struct acpi_namespace_node * prefix_node,
 	}
 
 	info->prefix_node = prefix_node;
-	info->pathname = path;
+	info->relative_pathname = path;
 
 	/* Evaluate the object/method */
 
drivers/acpi/acpica/utpredef.c +8 -8
index 2945947..2b1ce4c 100644
@@ -147,6 +147,11 @@ void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes)
 	u32 i;
 	u32 j;
 
+	if (!expected_btypes) {
+		ACPI_STRCPY(buffer, "NONE");
+		return;
+	}
+
 	j = 1;
 	buffer[0] = 0;
 	this_rtype = ACPI_RTYPE_INTEGER;
@@ -328,9 +333,7 @@ static u32 acpi_ut_get_argument_types(char *buffer, u16 argument_types)
 
 	/* First field in the types list is the count of args to follow */
 
-	arg_count = (argument_types & METHOD_ARG_MASK);
-	argument_types >>= METHOD_ARG_BIT_WIDTH;
-
+	arg_count = METHOD_GET_ARG_COUNT(argument_types);
 	if (arg_count > METHOD_PREDEF_ARGS_MAX) {
 		printf("**** Invalid argument count (%u) "
 		       "in predefined info structure\n", arg_count);
@@ -340,7 +343,8 @@ static u32 acpi_ut_get_argument_types(char *buffer, u16 argument_types)
 	/* Get each argument from the list, convert to ascii, store to buffer */
 
 	for (i = 0; i < arg_count; i++) {
-		this_argument_type = (argument_types & METHOD_ARG_MASK);
+		this_argument_type = METHOD_GET_NEXT_TYPE(argument_types);
+
 		if (!this_argument_type
 		    || (this_argument_type > METHOD_MAX_ARG_TYPE)) {
 			printf("**** Invalid argument type (%u) "
@@ -351,10 +355,6 @@ static u32 acpi_ut_get_argument_types(char *buffer, u16 argument_types)
 
 		strcat(buffer,
 		       ut_external_type_names[this_argument_type] + sub_index);
-
-		/* Shift to next argument type field */
-
-		argument_types >>= METHOD_ARG_BIT_WIDTH;
 		sub_index = 0;
 	}
 
include/acpi/acconfig.h +2 -2
index 14ceff7..1c16f82 100644
@@ -219,8 +219,8 @@
  *
  *****************************************************************************/
 
-#define ACPI_DEBUGGER_MAX_ARGS          8	/* Must be max method args + 1 */
-#define ACPI_DB_LINE_BUFFER_SIZE	512
+#define ACPI_DEBUGGER_MAX_ARGS          ACPI_METHOD_NUM_ARGS + 4	/* Max command line arguments */
+#define ACPI_DB_LINE_BUFFER_SIZE        512
 
 #define ACPI_DEBUGGER_COMMAND_PROMPT    '-'
 #define ACPI_DEBUGGER_EXECUTE_PROMPT    '%'
Signature · 1 line
1.7.10
author
#9 lore raw

PATCH 4/7 ACPICA: Predefined name support: Remove unused local variable

In reply to Lv Zheng

From: Bob Moore <[email protected]>

"Pathname" is no longer used.

---
 drivers/acpi/acpica/nspredef.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/acpi/acpica/nspredef.c +1 -4
index 7ab7ddb..5c83a8b 100644
@@ -104,13 +104,10 @@ acpi_ns_check_return_value(struct acpi_namespace_node *node,
 {
 	acpi_status status;
 	const union acpi_predefined_info *predefined;
-	char *pathname;
-
-	predefined = info->predefined;
-	pathname = info->full_pathname;
 
 	/* If not a predefined name, we cannot validate the return object */
 
+	predefined = info->predefined;
 	if (!predefined) {
 		return (AE_OK);
 	}
Signature · 1 line
1.7.10
author
#10 lore raw

PATCH 5/7 ACPICA: Remove unused macros, no functional change

In reply to Lv Zheng

Remove several unused/duplicated macros in acoutput.h Lv Zheng.

---
 include/acpi/acoutput.h |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
include/acpi/acoutput.h +1 -7
index 4f52ea7..4607b02 100644
@@ -428,27 +428,21 @@
  * This is the non-debug case -- make everything go away,
  * leaving no executable debug code!
  */
-#define ACPI_FUNCTION_NAME(a)
 #define ACPI_DEBUG_PRINT(pl)
 #define ACPI_DEBUG_PRINT_RAW(pl)
 #define ACPI_DEBUG_EXEC(a)
 #define ACPI_DEBUG_ONLY_MEMBERS(a)
+#define ACPI_FUNCTION_NAME(a)
 #define ACPI_FUNCTION_TRACE(a)
 #define ACPI_FUNCTION_TRACE_PTR(a, b)
 #define ACPI_FUNCTION_TRACE_U32(a, b)
 #define ACPI_FUNCTION_TRACE_STR(a, b)
-#define ACPI_FUNCTION_EXIT
-#define ACPI_FUNCTION_STATUS_EXIT(s)
-#define ACPI_FUNCTION_VALUE_EXIT(s)
 #define ACPI_FUNCTION_ENTRY()
 #define ACPI_DUMP_STACK_ENTRY(a)
 #define ACPI_DUMP_OPERANDS(a, b, c)
 #define ACPI_DUMP_ENTRY(a, b)
-#define ACPI_DUMP_TABLES(a, b)
 #define ACPI_DUMP_PATHNAME(a, b, c, d)
 #define ACPI_DUMP_BUFFER(a, b)
-#define ACPI_DEBUG_PRINT(pl)
-#define ACPI_DEBUG_PRINT_RAW(pl)
 #define ACPI_IS_DEBUG_ENABLED(level, component) 0
 
 /* Return macros must have a return statement at the minimum */
Signature · 1 line
1.7.10
author
#11 lore raw

PATCH 6/7 ACPICA: Update for "orphan" embedded controller _REG method support

In reply to Lv Zheng

From: Zhang Rui <[email protected]>

This refers to _REG methods under the EC device that have no corresponding operation region. This is allowed by the ACPI specification. This update removes a dependency on having an ECDT table, and will execute an orphan _REG method as long as the handler for the EC is installed at the EC device node (not the namespace root). Rui Zhang (original update), Bob Moore (update/integrate).

---
 drivers/acpi/acpica/evregion.c |   61 ++++++++++++++--------------------------
 1 file changed, 21 insertions(+), 40 deletions(-)
drivers/acpi/acpica/evregion.c +21 -40
index 8ae8f5b..cea14d6 100644
@@ -54,7 +54,8 @@ extern u8 acpi_gbl_default_address_spaces[];
 
 /* Local prototypes */
 
-static void acpi_ev_orphan_ec_reg_method(void);
+static void
+acpi_ev_orphan_ec_reg_method(struct acpi_namespace_node *ec_device_node);
 
 static acpi_status
 acpi_ev_reg_run(acpi_handle obj_handle,
@@ -612,7 +613,7 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
 	/* Special case for EC: handle "orphan" _REG methods with no region */
 
 	if (space_id == ACPI_ADR_SPACE_EC) {
-		acpi_ev_orphan_ec_reg_method();
+		acpi_ev_orphan_ec_reg_method(node);
 	}
 
 	return_ACPI_STATUS(status);
@@ -681,7 +682,7 @@ acpi_ev_reg_run(acpi_handle obj_handle,
  *
  * FUNCTION:    acpi_ev_orphan_ec_reg_method
  *
- * PARAMETERS:  None
+ * PARAMETERS:  ec_device_node      - Namespace node for an EC device
  *
  * RETURN:      None
  *
@@ -693,37 +694,27 @@ acpi_ev_reg_run(acpi_handle obj_handle,
  *              detected by providing a _REG method object underneath the
  *              Embedded Controller device."
  *
- *              To quickly access the EC device, we use the EC_ID that appears
- *              within the ECDT. Otherwise, we would need to perform a time-
- *              consuming namespace walk, executing _HID methods to find the
- *              EC device.
+ *              To quickly access the EC device, we use the ec_device_node used
+ *              during EC handler installation. Otherwise, we would need to
+ *              perform a time consuming namespace walk, executing _HID
+ *              methods to find the EC device.
+ *
+ *  MUTEX:      Assumes the namespace is locked
  *
  ******************************************************************************/
 
-static void acpi_ev_orphan_ec_reg_method(void)
+static void
+acpi_ev_orphan_ec_reg_method(struct acpi_namespace_node *ec_device_node)
 {
-	struct acpi_table_ecdt *table;
+	acpi_handle reg_method;
+	struct acpi_namespace_node *next_node;
 	acpi_status status;
 	struct acpi_object_list args;
 	union acpi_object objects[2];
-	struct acpi_namespace_node *ec_device_node;
-	struct acpi_namespace_node *reg_method;
-	struct acpi_namespace_node *next_node;
 
 	ACPI_FUNCTION_TRACE(ev_orphan_ec_reg_method);
 
-	/* Get the ECDT (if present in system) */
-
-	status = acpi_get_table(ACPI_SIG_ECDT, 0,
-				ACPI_CAST_INDIRECT_PTR(struct acpi_table_header,
-						       &table));
-	if (ACPI_FAILURE(status)) {
-		return_VOID;
-	}
-
-	/* We need a valid EC_ID string */
-
-	if (!(*table->id)) {
+	if (!ec_device_node) {
 		return_VOID;
 	}
 
@@ -731,22 +722,11 @@ static void acpi_ev_orphan_ec_reg_method(void)
 
 	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 
-	/* Get a handle to the EC device referenced in the ECDT */
-
-	status = acpi_get_handle(NULL,
-				 ACPI_CAST_PTR(char, table->id),
-				 ACPI_CAST_PTR(acpi_handle, &ec_device_node));
-	if (ACPI_FAILURE(status)) {
-		goto exit;
-	}
-
 	/* Get a handle to a _REG method immediately under the EC device */
 
-	status = acpi_get_handle(ec_device_node,
-				 METHOD_NAME__REG, ACPI_CAST_PTR(acpi_handle,
-								 &reg_method));
+	status = acpi_get_handle(ec_device_node, METHOD_NAME__REG, &reg_method);
 	if (ACPI_FAILURE(status)) {
-		goto exit;
+		goto exit;	/* There is no _REG method present */
 	}
 
 	/*
@@ -754,19 +734,20 @@ static void acpi_ev_orphan_ec_reg_method(void)
 	 * this scope with the Embedded Controller space ID. Otherwise, it
 	 * will already have been executed. Note, this allows for Regions
 	 * with other space IDs to be present; but the code below will then
-	 * execute the _REG method with the EC space ID argument.
+	 * execute the _REG method with the embedded_control space_ID argument.
 	 */
 	next_node = acpi_ns_get_next_node(ec_device_node, NULL);
 	while (next_node) {
 		if ((next_node->type == ACPI_TYPE_REGION) &&
 		    (next_node->object) &&
 		    (next_node->object->region.space_id == ACPI_ADR_SPACE_EC)) {
-			goto exit;	/* Do not execute _REG */
+			goto exit;	/* Do not execute the _REG */
 		}
+
 		next_node = acpi_ns_get_next_node(ec_device_node, next_node);
 	}
 
-	/* Evaluate the _REG(EC,Connect) method */
+	/* Evaluate the _REG(embedded_control,Connect) method */
 
 	args.count = 2;
 	args.pointer = objects;
Signature · 1 line
1.7.10
author
#13 lore raw

PATCH 7/7 ACPICA: Update version to 20130418

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Version 20130418.

---
 include/acpi/acpixf.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
index 454881e..1561264 100644
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20130328
+#define ACPI_CA_VERSION                 0x20130418
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
Signature · 1 line
1.7.10
Acked-by on the v1 series
#14 lore raw

RE: [PATCH 00/07] ACPICA 20130418 Release

In reply to Lv Zheng

for 1-7:

thanks,
-Len

ps. i would prefer that there be less whitespace changes mixed with functional changes in the future. Those kind of things are best done in separate functionality vs cleanup patches.

author
#15 lore raw

RE: [PATCH 00/07] ACPICA 20130418 Release

OK.
I'll add and re-send them.

Thanks
-Lv

Quoted 18 lines

-----Original Message-----
From: Brown, Len
Sent: Thursday, May 30, 2013 4:41 AM
To: Zheng, Lv; Wysocki, Rafael J; Moore, Robert
Cc: [email protected]
Subject: RE: [PATCH 00/07] ACPICA 20130418 Release

for 1-7:

thanks,
-Len

ps. i would prefer that there be less whitespace changes mixed with functional changes in the future. Those kind of things are best done in separate functionality vs cleanup patches.

author
#12 lore raw

RE: [PATCH v2 6/7] ACPICA: Update for "orphan" embedded controller _REG method support

In reply to Lv Zheng

A mistake in the email address.
Please ignore this and find an updated one sent later. Sorry for the mistake.

Thanks
-Lv

Quoted 171 lines

-----Original Message-----
From: Zheng, Lv
Sent: Thursday, May 30, 2013 10:01 AM
To: Wysocki, Rafael J; Moore, Robert; Brown, Len
Cc: Zheng, Lv; [email protected]; Zhang Rui; Zhang, Rui
Subject: [PATCH v2 6/7] ACPICA: Update for "orphan" embedded controller _REG method support

From: Zhang Rui <[email protected]>

This refers to _REG methods under the EC device that have no corresponding operation region. This is allowed by the ACPI specification. This update removes a dependency on having an ECDT table, and will execute an orphan _REG method as long as the handler for the EC is installed at the EC device node (not the namespace root). Rui Zhang (original update), Bob Moore (update/integrate).

---
 drivers/acpi/acpica/evregion.c |   61 ++++++++++++++--------------------------
 1 file changed, 21 insertions(+), 40 deletions(-)
drivers/acpi/acpica/evregion.c +3 -1
index 8ae8f5b..cea14d6 100644
@@ -54,7 +54,8 @@ extern u8 acpi_gbl_default_address_spaces[];
 
 /* Local prototypes */
 
-static void acpi_ev_orphan_ec_reg_method(void);
+static void
+acpi_ev_orphan_ec_reg_method(struct acpi_namespace_node
+*ec_device_node);
 
 static acpi_status
 acpi_ev_reg_run(acpi_handle obj_handle, @@ -612,7 +613,7 @@

acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,

drivers/acpi/acpica/evregion.c +2 -2
 	/* Special case for EC: handle "orphan" _REG methods with no region */
 
 	if (space_id == ACPI_ADR_SPACE_EC) {
-		acpi_ev_orphan_ec_reg_method();
+		acpi_ev_orphan_ec_reg_method(node);
 	}
 
 	return_ACPI_STATUS(status);
@@ -681,7 +682,7 @@ acpi_ev_reg_run(acpi_handle obj_handle,
  *
  * FUNCTION:    acpi_ev_orphan_ec_reg_method
  *
- * PARAMETERS:  None
+ * PARAMETERS:  ec_device_node      - Namespace node for an EC device
  *
  * RETURN:      None
  *
@@ -693,37 +694,27 @@ acpi_ev_reg_run(acpi_handle obj_handle,
  *              detected by providing a _REG method object underneath

the
* Embedded Controller device."
*
- * To quickly access the EC device, we use the EC_ID that
appears
- * within the ECDT. Otherwise, we would need to perform a
time-
- * consuming namespace walk, executing _HID methods to
find the
- * EC device.
+ * To quickly access the EC device, we use the
ec_device_node used
+ * during EC handler installation. Otherwise, we would need
to
+ * perform a time consuming namespace walk, executing
_HID
+ * methods to find the EC device.
+ *
+ * MUTEX: Assumes the namespace is locked
*

****************************************************************
**************/

drivers/acpi/acpica/evregion.c +10 -31
-static void acpi_ev_orphan_ec_reg_method(void)
+static void
+acpi_ev_orphan_ec_reg_method(struct acpi_namespace_node
+*ec_device_node)
 {
-	struct acpi_table_ecdt *table;
+	acpi_handle reg_method;
+	struct acpi_namespace_node *next_node;
 	acpi_status status;
 	struct acpi_object_list args;
 	union acpi_object objects[2];
-	struct acpi_namespace_node *ec_device_node;
-	struct acpi_namespace_node *reg_method;
-	struct acpi_namespace_node *next_node;
 
 	ACPI_FUNCTION_TRACE(ev_orphan_ec_reg_method);
 
-	/* Get the ECDT (if present in system) */
-
-	status = acpi_get_table(ACPI_SIG_ECDT, 0,
-				ACPI_CAST_INDIRECT_PTR(struct acpi_table_header,
-						       &table));
-	if (ACPI_FAILURE(status)) {
-		return_VOID;
-	}
-
-	/* We need a valid EC_ID string */
-
-	if (!(*table->id)) {
+	if (!ec_device_node) {
 		return_VOID;
 	}
@@ -731,22 +722,11 @@ static void acpi_ev_orphan_ec_reg_method(void)
 
 	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 
-	/* Get a handle to the EC device referenced in the ECDT */
-
-	status = acpi_get_handle(NULL,
-				 ACPI_CAST_PTR(char, table->id),
-				 ACPI_CAST_PTR(acpi_handle, &ec_device_node));
-	if (ACPI_FAILURE(status)) {
-		goto exit;
-	}
-
 	/* Get a handle to a _REG method immediately under the EC device */
 
-	status = acpi_get_handle(ec_device_node,
-				 METHOD_NAME__REG, ACPI_CAST_PTR(acpi_handle,
-								 &reg_method));
+	status = acpi_get_handle(ec_device_node, METHOD_NAME__REG,
+&reg_method);
 	if (ACPI_FAILURE(status)) {
-		goto exit;
+		goto exit;	/* There is no _REG method present */
 	}
 
 	/*
@@ -754,19 +734,20 @@ static void acpi_ev_orphan_ec_reg_method(void)
 	 * this scope with the Embedded Controller space ID. Otherwise, it
 	 * will already have been executed. Note, this allows for Regions
 	 * with other space IDs to be present; but the code below will then
-	 * execute the _REG method with the EC space ID argument.
+	 * execute the _REG method with the embedded_control space_ID

argument.

drivers/acpi/acpica/evregion.c +0 -0
 	 */
 	next_node = acpi_ns_get_next_node(ec_device_node, NULL);
 	while (next_node) {
 		if ((next_node->type == ACPI_TYPE_REGION) &&
 		    (next_node->object) &&
 		    (next_node->object->region.space_id == ACPI_ADR_SPACE_EC))

{

drivers/acpi/acpica/evregion.c +3 -3
-			goto exit;	/* Do not execute _REG */
+			goto exit;	/* Do not execute the _REG */
 		}
+
 		next_node = acpi_ns_get_next_node(ec_device_node, next_node);
 	}
 
-	/* Evaluate the _REG(EC,Connect) method */
+	/* Evaluate the _REG(embedded_control,Connect) method */
 
 	args.count = 2;
 	args.pointer = objects;
--

1.7.10

#16 lore raw

Re: [PATCH 00/07] ACPICA 20130418 Release

In reply to Lv Zheng
Quoted 12 lines · Lv Zheng

The 20130418 ACPICA kernel resident system updates is linuxized based on the pm/linux-next branch.
The patch set has passed basic build/boot tests on i386/x86-64 machines.

Bob Moore (5):
ACPICA: Change an exception code for the ASL UnLoad() operator
ACPICA: Add BIOS error interface for predefined name validation
support
ACPICA: Add argument typechecking for all predefined ACPI names
ACPICA: Predefined name support: Remove unused local variable
ACPICA: Update version to 20130418

Quoted 5 lines

Lv Zheng (1):
ACPICA: Remove unused macros, no functional change

Zhang Rui (1):
ACPICA: Update for "orphan" embedded controller _REG method support

Applied, thanks Lv!

Rafael

Quoted 31 lines
 drivers/acpi/acpica/Makefile      |    1 +
 drivers/acpi/acpica/aclocal.h     |   17 ---
 drivers/acpi/acpica/acmacros.h    |   10 +-
 drivers/acpi/acpica/acnamesp.h    |   43 ++++--
 drivers/acpi/acpica/acpredef.h    |    4 +-
 drivers/acpi/acpica/acstruct.h    |   40 +++--
 drivers/acpi/acpica/acutils.h     |    6 +
 drivers/acpi/acpica/evgpe.c       |    1 -
 drivers/acpi/acpica/evregion.c    |   63 +++-----
 drivers/acpi/acpica/exconfig.c    |    2 +-
 drivers/acpi/acpica/hwxface.c     |    6 +-
 drivers/acpi/acpica/nsarguments.c |  294 +++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/nseval.c      |  247 ++++++++++++++++++-------------
 drivers/acpi/acpica/nsinit.c      |    7 +-
 drivers/acpi/acpica/nspredef.c    |  202 ++++++-------------------
 drivers/acpi/acpica/nsprepkg.c    |   76 +++++-----
 drivers/acpi/acpica/nsrepair.c    |   50 +++----
 drivers/acpi/acpica/nsrepair2.c   |   87 +++++------
 drivers/acpi/acpica/nsxfeval.c    |  162 ++++++++++++++++----
 drivers/acpi/acpica/psxface.c     |   14 +-
 drivers/acpi/acpica/rsutils.c     |    2 +-
 drivers/acpi/acpica/uteval.c      |    2 +-
 drivers/acpi/acpica/utpredef.c    |   16 +-
 drivers/acpi/acpica/utxferror.c   |   51 ++++++-
 include/acpi/acconfig.h           |    4 +-
 include/acpi/acoutput.h           |    8 +-
 include/acpi/acpixf.h             |    2 +-
 27 files changed, 882 insertions(+), 535 deletions(-)
 create mode 100644 drivers/acpi/acpica/nsarguments.c
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.