Skip to contentSkip to conversation

ACPICA 20130328 Release

PATCH Applied Lv Zheng 2 participants 14 messages Apr 12, 2013 – Apr 15, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Lv Zheng

author
#1 lore raw

cover ACPICA 20130328 Release

In reply to a message not in the archive

The 20130328 ACPICA kernel resident system updates is linuxized based on the pm/linux-next branch.
The patch set has passed a basic build/boot test on z530.

Fixed several possible race conditions with the internal object reference counting mechanism. Some of the external ACPICA interfaces update object reference counts without holding the interpreter or namespace lock. This change adds a spinlock to protect reference count updates on the internal ACPICA objects. Reported by and with assistance from Andriy Gapon ([email protected]).

FADT support: Removed an extraneous warning for very large GPE register sets. This change removes a size mismatch warning if the legacy length field for a GPE register set is larger than the 64-bit GAS structure can accommodate. GPE register sets can be larger than the 255-bit width limitation of the GAS structure. Linn Crosetto ([email protected]).

_OSI Support: handle any errors from AcpiOsAcquireMutex. Check for error return from this interface. Handles a possible timeout case if ACPI_WAIT_FOREVER is modified by the host to be a value less than "forever". Jung-uk Kim.

Predefined name support: Add allowed/required argument type information to the master predefined info table. This change adds the infrastructure to enable typechecking on incoming arguments for all predefined methods/objects. It does not actually contain the code that will fully utilize this information, this is still under development. Also condenses some duplicate code for the predefined names into a new module, utilities/utpredef.c

Example Code and Data Size: These are the sizes for the OS-independent acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size.

Previous Release:

    Non-Debug Version:  95.0K Code, 25.9K Data, 120.9K Total
    Debug Version:     182.9K Code, 75.6K Data, 258.5K Total
  Current Release:
    Non-Debug Version:  95.2K Code, 26.4K Data, 121.6K Total
    Debug Version:     183.0K Code, 76.0K Data, 259.0K Total

Bob Moore (6):
ACPICA: Predefine names: Add allowed argument types to master info
table
ACPICA: Improve error message for Index() operator
ACPICA: Remove FORCE_DELETE option for global reference count
mechanism
ACPICA: Fix a format string for 64-bit generation
ACPICA: Update version to 20130328
ACPICA: Add a lock to the internal object reference count mechanism

Colin Ian King (2):
ACPICA: Fix a typo in an error message
ACPICA: Fix a typo in a function header, no functional change

Jung-uk Kim (1):
ACPICA: _OSI Support: handle any errors from AcpiOsAcquireMutex

Linn Crosetto (1):
ACPICA: FADT: Remove extraneous warning for very large GPE registers

Tang Chen (1):
ACPICA: Fix for some comments/headers

 drivers/acpi/acpica/Makefile   |    1 +
 drivers/acpi/acpica/acglobal.h |    1 +
 drivers/acpi/acpica/aclocal.h  |   13 +-
 drivers/acpi/acpica/acnamesp.h |    4 -
 drivers/acpi/acpica/acpredef.h | 1305 ++++++++++++++++++++++++++++------------
 drivers/acpi/acpica/acutils.h  |   25 +-
 drivers/acpi/acpica/dswexec.c  |    2 +-
 drivers/acpi/acpica/evevent.c  |    2 +-
 drivers/acpi/acpica/exoparg2.c |   11 +-
 drivers/acpi/acpica/nseval.c   |   26 +-
 drivers/acpi/acpica/nspredef.c |  106 +---
 drivers/acpi/acpica/tbfadt.c   |    4 +
 drivers/acpi/acpica/tbxface.c  |   22 +-
 drivers/acpi/acpica/utdelete.c |   96 +--
 drivers/acpi/acpica/utmutex.c  |    9 +-
 drivers/acpi/acpica/utosi.c    |   26 +-
 drivers/acpi/acpica/utpredef.c |  399 ++++++++++++
 drivers/acpi/acpica/utxface.c  |   17 +-
 include/acpi/acpixf.h          |    2 +-
 19 files changed, 1481 insertions(+), 590 deletions(-)
 create mode 100644 drivers/acpi/acpica/utpredef.c
Signature · 1 line
1.7.10
author
#3 lore raw

PATCH 2/11 ACPICA: _OSI Support: handle any errors from AcpiOsAcquireMutex

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

Check for any errors. Handles possible timeout case if ACPI_WAIT_FOREVER is changed to be less than "forever". Jung-uk Kim.

---
 drivers/acpi/acpica/acutils.h |    2 +-
 drivers/acpi/acpica/utosi.c   |   26 ++++++++++++++++++++------
 drivers/acpi/acpica/utxface.c |   17 +++++++++++++----
 3 files changed, 34 insertions(+), 11 deletions(-)
drivers/acpi/acpica/acutils.h +1 -1
index 8c25bb0..bbeb961 100644
@@ -421,7 +421,7 @@ acpi_ut_get_object_size(union acpi_operand_object *obj, acpi_size * obj_length);
  */
 acpi_status acpi_ut_initialize_interfaces(void);
 
-void acpi_ut_interface_terminate(void);
+acpi_status acpi_ut_interface_terminate(void);
 
 acpi_status acpi_ut_install_interface(acpi_string interface_name);
 
drivers/acpi/acpica/utosi.c +20 -6
index 36a7d36..b15aceb 100644
@@ -108,9 +108,14 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = {
 
 acpi_status acpi_ut_initialize_interfaces(void)
 {
+	acpi_status status;
 	u32 i;
 
-	(void)acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
+	status = acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
+	if (ACPI_FAILURE(status)) {
+		return (status);
+	}
+
 	acpi_gbl_supported_interfaces = acpi_default_supported_interfaces;
 
 	/* Link the static list of supported interfaces */
@@ -132,20 +137,24 @@ acpi_status acpi_ut_initialize_interfaces(void)
  *
  * PARAMETERS:  None
  *
- * RETURN:      None
+ * RETURN:      Status
  *
  * DESCRIPTION: Delete all interfaces in the global list. Sets
  *              acpi_gbl_supported_interfaces to NULL.
  *
  ******************************************************************************/
 
-void acpi_ut_interface_terminate(void)
+acpi_status acpi_ut_interface_terminate(void)
 {
+	acpi_status status;
 	struct acpi_interface_info *next_interface;
 
-	(void)acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
-	next_interface = acpi_gbl_supported_interfaces;
+	status = acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
+	if (ACPI_FAILURE(status)) {
+		return (status);
+	}
 
+	next_interface = acpi_gbl_supported_interfaces;
 	while (next_interface) {
 		acpi_gbl_supported_interfaces = next_interface->next;
 
@@ -160,6 +169,7 @@ void acpi_ut_interface_terminate(void)
 	}
 
 	acpi_os_release_mutex(acpi_gbl_osi_mutex);
+	return (AE_OK);
 }
 
 /*******************************************************************************
@@ -315,6 +325,7 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state * walk_state)
 	union acpi_operand_object *return_desc;
 	struct acpi_interface_info *interface_info;
 	acpi_interface_handler interface_handler;
+	acpi_status status;
 	u32 return_value;
 
 	ACPI_FUNCTION_TRACE(ut_osi_implementation);
@@ -336,7 +347,10 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state * walk_state)
 	/* Default return value is 0, NOT SUPPORTED */
 
 	return_value = 0;
-	(void)acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
+	status = acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
+	if (ACPI_FAILURE(status)) {
+		return (status);
+	}
 
 	/* Lookup the interface in the global _OSI list */
 
drivers/acpi/acpica/utxface.c +13 -4
index 48efb44..6505774 100644
@@ -287,7 +287,10 @@ acpi_status acpi_install_interface(acpi_string interface_name)
 		return (AE_BAD_PARAMETER);
 	}
 
-	(void)acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
+	status = acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
+	if (ACPI_FAILURE(status)) {
+		return (status);
+	}
 
 	/* Check if the interface name is already in the global list */
 
@@ -336,7 +339,10 @@ acpi_status acpi_remove_interface(acpi_string interface_name)
 		return (AE_BAD_PARAMETER);
 	}
 
-	(void)acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
+	status = acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
+	if (ACPI_FAILURE(status)) {
+		return (status);
+	}
 
 	status = acpi_ut_remove_interface(interface_name);
 
@@ -362,9 +368,12 @@ ACPI_EXPORT_SYMBOL(acpi_remove_interface)
  ****************************************************************************/
 acpi_status acpi_install_interface_handler(acpi_interface_handler handler)
 {
-	acpi_status status = AE_OK;
+	acpi_status status;
 
-	(void)acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
+	status = acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
+	if (ACPI_FAILURE(status)) {
+		return (status);
+	}
 
 	if (handler && acpi_gbl_interface_handler) {
 		status = AE_ALREADY_EXISTS;
Signature · 1 line
1.7.10
author
#2 lore raw

PATCH 1/11 ACPICA: Predefine names: Add allowed argument types to master info table

In reply to Lv Zheng

From: Bob Moore <[email protected]>

This change adds the infrastructure to enable typechecking on incoming arguments for the predefined methods/objects. It does not actually contain the code that will fully utilize this information. Also condenses some duplicate code for the predefined names into a new module, utilities/utpredef.c

---
 drivers/acpi/acpica/Makefile   |    1 +
 drivers/acpi/acpica/aclocal.h  |   13 +-
 drivers/acpi/acpica/acnamesp.h |    4 -
 drivers/acpi/acpica/acpredef.h | 1305 ++++++++++++++++++++++++++++------------
 drivers/acpi/acpica/acutils.h  |   20 +
 drivers/acpi/acpica/nseval.c   |   26 +-
 drivers/acpi/acpica/nspredef.c |  106 +---
 drivers/acpi/acpica/utpredef.c |  399 ++++++++++++
 8 files changed, 1361 insertions(+), 513 deletions(-)
 create mode 100644 drivers/acpi/acpica/utpredef.c
drivers/acpi/acpica/Makefile +1 -0
index 5a542c8..7ddf29e 100644
@@ -161,6 +161,7 @@ acpi-y +=		\
 	utobject.o	\
 	utosi.o		\
 	utownerid.o	\
+	utpredef.o	\
 	utresrc.o	\
 	utstate.o	\
 	utstring.o	\
drivers/acpi/acpica/aclocal.h +10 -3
index 636658f..d5bfbd3 100644
@@ -294,6 +294,8 @@ acpi_status(*acpi_internal_method) (struct acpi_walk_state * walk_state);
 #define ACPI_BTYPE_OBJECTS_AND_REFS     0x0001FFFF	/* ARG or LOCAL */
 #define ACPI_BTYPE_ALL_OBJECTS          0x0000FFFF
 
+#pragma pack(1)
+
 /*
  * Information structure for ACPI predefined names.
  * Each entry in the table contains the following items:
@@ -304,7 +306,7 @@ acpi_status(*acpi_internal_method) (struct acpi_walk_state * walk_state);
  */
 struct acpi_name_info {
 	char name[ACPI_NAME_SIZE];
-	u8 param_count;
+	u16 argument_list;
 	u8 expected_btypes;
 };
 
@@ -327,7 +329,7 @@ struct acpi_package_info {
 	u8 count1;
 	u8 object_type2;
 	u8 count2;
-	u8 reserved;
+	u16 reserved;
 };
 
 /* Used for ACPI_PTYPE2_FIXED */
@@ -336,6 +338,7 @@ struct acpi_package_info2 {
 	u8 type;
 	u8 count;
 	u8 object_type[4];
+	u8 reserved;
 };
 
 /* Used for ACPI_PTYPE1_OPTION */
@@ -345,7 +348,7 @@ struct acpi_package_info3 {
 	u8 count;
 	u8 object_type[2];
 	u8 tail_object_type;
-	u8 reserved;
+	u16 reserved;
 };
 
 union acpi_predefined_info {
@@ -355,6 +358,10 @@ union acpi_predefined_info {
 	struct acpi_package_info3 ret_info3;
 };
 
+/* Reset to default packing */
+
+#pragma pack()
+
 /* Data block used during object validation */
 
 struct acpi_predefined_data {
drivers/acpi/acpica/acnamesp.h +0 -4
index 6475962..d2e4918 100644
@@ -231,10 +231,6 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
 			       acpi_status return_status,
 			       union acpi_operand_object **return_object);
 
-const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct
-								    acpi_namespace_node
-								    *node);
-
 void
 acpi_ns_check_parameter_count(char *pathname,
 			      struct acpi_namespace_node *node,
drivers/acpi/acpica/acpredef.h +910 -395

1,393 lines not on this page · raw message

drivers/acpi/acpica/acutils.h +20 -0
index c01f1a1..8c25bb0 100644
@@ -432,6 +432,26 @@ struct acpi_interface_info *acpi_ut_get_interface(acpi_string interface_name);
 acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state);
 
 /*
+ * utpredef - support for predefined names
+ */
+const union acpi_predefined_info *acpi_ut_get_next_predefined_method(const union
+								     acpi_predefined_info
+								     *this_name);
+
+const union acpi_predefined_info *acpi_ut_match_predefined_method(char *name);
+
+const union acpi_predefined_info *acpi_ut_match_resource_name(char *name);
+
+void
+acpi_ut_display_predefined_method(char *buffer,
+				  const union acpi_predefined_info *this_name,
+				  u8 multi_line);
+
+void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes);
+
+u32 acpi_ut_get_resource_bit_width(char *buffer, u16 types);
+
+/*
  * utstate - Generic state creation/cache routines
  */
 void
drivers/acpi/acpica/nseval.c +15 -11
index 1538f3e..b61db69 100644
@@ -98,17 +98,21 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
 	info->return_object = NULL;
 	info->param_count = 0;
 
-	/*
-	 * Get the actual namespace node for the target object. Handles these cases:
-	 *
-	 * 1) Null node, Pathname (absolute path)
-	 * 2) Node, Pathname (path relative to Node)
-	 * 3) Node, Null Pathname
-	 */
-	status = acpi_ns_get_node(info->prefix_node, info->pathname,
-				  ACPI_NS_NO_UPSEARCH, &info->resolved_node);
-	if (ACPI_FAILURE(status)) {
-		return_ACPI_STATUS(status);
+	if (!info->resolved_node) {
+		/*
+		 * Get the actual namespace node for the target object if we need to.
+		 * Handles these cases:
+		 *
+		 * 1) Null node, Pathname (absolute path)
+		 * 2) Node, Pathname (path relative to Node)
+		 * 3) Node, Null Pathname
+		 */
+		status = acpi_ns_get_node(info->prefix_node, info->pathname,
+					  ACPI_NS_NO_UPSEARCH,
+					  &info->resolved_node);
+		if (ACPI_FAILURE(status)) {
+			return_ACPI_STATUS(status);
+		}
 	}
 
 	/*
drivers/acpi/acpica/nspredef.c +6 -100

141 lines not on this page · raw message

drivers/acpi/acpica/utpredef.c new file +399 -0

399 lines not on this page · raw message

Signature · 1 line
1.7.10
author
#4 lore raw

PATCH 3/11 ACPICA: Fix for some comments/headers

In reply to Lv Zheng

From: Tang Chen <[email protected]>

No functional change. Includes parameter rename from Tang Chen.

---
 drivers/acpi/acpica/tbxface.c |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/acpi/acpica/tbxface.c +12 -10
index b35a5e6..ad11162 100644
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Module Name: tbxface - ACPI table oriented external interfaces
+ * Module Name: tbxface - ACPI table-oriented external interfaces
  *
  *****************************************************************************/
 
@@ -80,7 +80,7 @@ acpi_status acpi_allocate_root_table(u32 initial_table_count)
  *                                    array is dynamically allocated.
  *              initial_table_count - Size of initial_table_array, in number of
  *                                    struct acpi_table_desc structures
- *              allow_realloc       - Flag to tell Table Manager if resize of
+ *              allow_resize        - Flag to tell Table Manager if resize of
  *                                    pre-allocated array is allowed. Ignored
  *                                    if initial_table_array is NULL.
  *
@@ -107,8 +107,8 @@ acpi_initialize_tables(struct acpi_table_desc * initial_table_array,
 	ACPI_FUNCTION_TRACE(acpi_initialize_tables);
 
 	/*
-	 * Set up the Root Table Array
-	 * Allocate the table array if requested
+	 * Setup the Root Table Array and allocate the table array
+	 * if requested
 	 */
 	if (!initial_table_array) {
 		status = acpi_allocate_root_table(initial_table_count);
@@ -305,9 +305,10 @@ ACPI_EXPORT_SYMBOL(acpi_unload_table_id)
  *              instance            - Which instance (for SSDTs)
  *              out_table           - Where the pointer to the table is returned
  *
- * RETURN:      Status and pointer to table
+ * RETURN:      Status and pointer to the requested table
  *
- * DESCRIPTION: Finds and verifies an ACPI table.
+ * DESCRIPTION: Finds and verifies an ACPI table. Table must be in the
+ *              RSDT/XSDT.
  *
  ******************************************************************************/
 acpi_status
@@ -375,9 +376,10 @@ ACPI_EXPORT_SYMBOL(acpi_get_table)
  * PARAMETERS:  table_index         - Table index
  *              table               - Where the pointer to the table is returned
  *
- * RETURN:      Status and pointer to the table
+ * RETURN:      Status and pointer to the requested table
  *
- * DESCRIPTION: Obtain a table by an index into the global table list.
+ * DESCRIPTION: Obtain a table by an index into the global table list. Used
+ *              internally also.
  *
  ******************************************************************************/
 acpi_status
@@ -432,7 +434,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_table_by_index)
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Install table event handler
+ * DESCRIPTION: Install a global table event handler.
  *
  ******************************************************************************/
 acpi_status
@@ -479,7 +481,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_table_handler)
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Remove table event handler
+ * DESCRIPTION: Remove a table event handler
  *
  ******************************************************************************/
 acpi_status acpi_remove_table_handler(acpi_table_handler handler)
Signature · 1 line
1.7.10
author
#6 lore raw

PATCH 5/11 ACPICA: Fix a typo in a function header, no functional change

In reply to Lv Zheng

From: Colin Ian King <[email protected]>

Reported by Colin King.

---
 drivers/acpi/acpica/evevent.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpica/evevent.c +1 -1
index 02219ff..83cd45f 100644
@@ -258,7 +258,7 @@ u32 acpi_ev_fixed_event_detect(void)
  * DESCRIPTION: Clears the status bit for the requested event, calls the
  *              handler that previously registered for the event.
  *              NOTE: If there is no handler for the event, the event is
- *              disabled to prevent futher interrupts.
+ *              disabled to prevent further interrupts.
  *
  ******************************************************************************/
 
Signature · 1 line
1.7.10
author
#7 lore raw

PATCH 6/11 ACPICA: FADT: Remove extraneous warning for very large GPE registers

In reply to Lv Zheng

From: Linn Crosetto <[email protected]>

This change removes a size mismatch warning if the legacy length field for a GPE register set is larger than the 64-bit GAS structure can accomodate. GPE register sets can be larger than the 255 bit limitation of the GAS structure. Linn Crosetto ([email protected]).

---
 drivers/acpi/acpica/tbfadt.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/acpi/acpica/tbfadt.c +4 -0
index 74181bf..33b00d2 100644
@@ -559,8 +559,12 @@ static void acpi_tb_validate_fadt(void)
 		/*
 		 * For each extended field, check for length mismatch between the
 		 * legacy length field and the corresponding 64-bit X length field.
+		 * Note: If the legacy length field is > 0xFF bits, ignore this
+		 * check. (GPE registers can be larger than the 64-bit GAS structure
+		 * can accomodate, 0xFF bits).
 		 */
 		if (address64->address &&
+		    (ACPI_MUL_8(length) <= ACPI_UINT8_MAX) &&
 		    (address64->bit_width != ACPI_MUL_8(length))) {
 			ACPI_BIOS_WARNING((AE_INFO,
 					   "32/64X length mismatch in FADT/%s: %u/%u",
Signature · 1 line
1.7.10
author
#5 lore raw

PATCH 4/11 ACPICA: Fix a typo in an error message

In reply to Lv Zheng

From: Colin Ian King <[email protected]>

Remove an extraneous minus/dash. Reported by Colin Ian King.

---
 drivers/acpi/acpica/dswexec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpica/dswexec.c +1 -1
index 44f8325..e2199a9 100644
@@ -693,7 +693,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 		default:
 
 			ACPI_ERROR((AE_INFO,
-				    "Unimplemented opcode, class=0x%X type=0x%X Opcode=-0x%X Op=%p",
+				    "Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p",
 				    op_class, op_type, op->common.aml_opcode,
 				    op));
 
Signature · 1 line
1.7.10
author
#8 lore raw

PATCH 7/11 ACPICA: Improve error message for Index() operator

In reply to Lv Zheng

From: Bob Moore <[email protected]>

For the case where an attempt is made to take an Index() beyond the end of a String, Buffer, or Package, emit the actual length of the object to the error message. Helpful for debugging.

---
 drivers/acpi/acpica/exoparg2.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/acpi/acpica/exoparg2.c +6 -4
index e491e46..4a34d6d 100644
@@ -257,7 +257,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 	union acpi_operand_object *return_desc = NULL;
 	u64 index;
 	acpi_status status = AE_OK;
-	acpi_size length;
+	acpi_size length = 0;
 
 	ACPI_FUNCTION_TRACE_STR(ex_opcode_2A_1T_1R,
 				acpi_ps_get_opcode_name(walk_state->opcode));
@@ -320,7 +320,6 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 		 * NOTE: A length of zero is ok, and will create a zero-length, null
 		 *       terminated string.
 		 */
-		length = 0;
 		while ((length < operand[0]->buffer.length) &&
 		       (length < operand[1]->integer.value) &&
 		       (operand[0]->buffer.pointer[length])) {
@@ -376,6 +375,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 		case ACPI_TYPE_STRING:
 
 			if (index >= operand[0]->string.length) {
+				length = operand[0]->string.length;
 				status = AE_AML_STRING_LIMIT;
 			}
 
@@ -386,6 +386,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 		case ACPI_TYPE_BUFFER:
 
 			if (index >= operand[0]->buffer.length) {
+				length = operand[0]->buffer.length;
 				status = AE_AML_BUFFER_LIMIT;
 			}
 
@@ -396,6 +397,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 		case ACPI_TYPE_PACKAGE:
 
 			if (index >= operand[0]->package.count) {
+				length = operand[0]->package.count;
 				status = AE_AML_PACKAGE_LIMIT;
 			}
 
@@ -414,8 +416,8 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 
 		if (ACPI_FAILURE(status)) {
 			ACPI_EXCEPTION((AE_INFO, status,
-					"Index (0x%8.8X%8.8X) is beyond end of object",
-					ACPI_FORMAT_UINT64(index)));
+					"Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
+					ACPI_FORMAT_UINT64(index), length));
 			goto cleanup;
 		}
 
Signature · 1 line
1.7.10
author
#9 lore raw

PATCH 8/11 ACPICA: Remove FORCE_DELETE option for global reference count mechanism

In reply to Lv Zheng

From: Bob Moore <[email protected]>

This option is not used and is obsolete.

---
 drivers/acpi/acpica/acutils.h  |    3 ++-
 drivers/acpi/acpica/utdelete.c |   14 +-------------
 2 files changed, 3 insertions(+), 14 deletions(-)
drivers/acpi/acpica/acutils.h +2 -1
index bbeb961..202f4f1 100644
@@ -113,9 +113,10 @@ struct acpi_pkg_info {
 	u32 num_packages;
 };
 
+/* Object reference counts */
+
 #define REF_INCREMENT       (u16) 0
 #define REF_DECREMENT       (u16) 1
-#define REF_FORCE_DELETE    (u16) 2
 
 /* acpi_ut_dump_buffer */
 
drivers/acpi/acpica/utdelete.c +1 -13
index 2541de4..fc11ad1 100644
@@ -424,17 +424,6 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action)
 		}
 		break;
 
-	case REF_FORCE_DELETE:
-
-		ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
-				  "Obj %p Refs=%X, Force delete! (Set to 0)\n",
-				  object, count));
-
-		new_count = 0;
-		object->common.reference_count = new_count;
-		acpi_ut_delete_internal_obj(object);
-		break;
-
 	default:
 
 		ACPI_ERROR((AE_INFO, "Unknown action (0x%X)", action));
@@ -458,8 +447,7 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action)
  *
  * PARAMETERS:  object              - Increment ref count for this object
  *                                    and all sub-objects
- *              action              - Either REF_INCREMENT or REF_DECREMENT or
- *                                    REF_FORCE_DELETE
+ *              action              - Either REF_INCREMENT or REF_DECREMENT
  *
  * RETURN:      Status
  *
Signature · 1 line
1.7.10
author
#10 lore raw

PATCH 9/11 ACPICA: Fix a format string for 64-bit generation

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Fix a warning on 64-bit for a length value. Cast to 32-bit since the length is related to an ACPI table.

---
 drivers/acpi/acpica/exoparg2.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/acpica/exoparg2.c +2 -1
index 4a34d6d..b0838a4 100644
@@ -417,7 +417,8 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 		if (ACPI_FAILURE(status)) {
 			ACPI_EXCEPTION((AE_INFO, status,
 					"Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
-					ACPI_FORMAT_UINT64(index), length));
+					ACPI_FORMAT_UINT64(index),
+					(u32)length));
 			goto cleanup;
 		}
 
Signature · 1 line
1.7.10
author
#12 lore raw

PATCH 11/11 ACPICA: Update version to 20130328

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Version 20130328.

---
 include/acpi/acpixf.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
index 7aa231b..454881e 100644
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20130214
+#define ACPI_CA_VERSION                 0x20130328
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
Signature · 1 line
1.7.10
author
#11 lore raw

PATCH 10/11 ACPICA: Add a lock to the internal object reference count mechanism

In reply to Lv Zheng

From: Bob Moore <[email protected]>

Certain external interfaces need to update object references without holding the interpreter or namespace mutex objects. To prevent race conditions, add a spinlock around the increment and decrement of the reference counts for internal ACPI objects. Reported by Andriy Gapon ([email protected]).

---
 drivers/acpi/acpica/acglobal.h |    1 +
 drivers/acpi/acpica/utdelete.c |   82 +++++++++++++++++++++++-----------------
 drivers/acpi/acpica/utmutex.c  |    9 ++++-
 3 files changed, 57 insertions(+), 35 deletions(-)
drivers/acpi/acpica/acglobal.h +1 -0
index 833fbc5..0716092 100644
@@ -224,6 +224,7 @@ ACPI_EXTERN u8 acpi_gbl_global_lock_pending;
  */
 ACPI_EXTERN acpi_spinlock acpi_gbl_gpe_lock;	/* For GPE data structs and registers */
 ACPI_EXTERN acpi_spinlock acpi_gbl_hardware_lock;	/* For ACPI H/W except GPE registers */
+ACPI_EXTERN acpi_spinlock acpi_gbl_reference_count_lock;
 
 /* Mutex for _OSI support */
 
drivers/acpi/acpica/utdelete.c +48 -34

138 lines not on this page · raw message

drivers/acpi/acpica/utmutex.c +8 -1
index 22feb99..08c3232 100644
@@ -81,7 +81,7 @@ acpi_status acpi_ut_mutex_initialize(void)
 		}
 	}
 
-	/* Create the spinlocks for use at interrupt level */
+	/* Create the spinlocks for use at interrupt level or for speed */
 
 	status = acpi_os_create_lock (&acpi_gbl_gpe_lock);
 	if (ACPI_FAILURE (status)) {
@@ -93,7 +93,13 @@ acpi_status acpi_ut_mutex_initialize(void)
 		return_ACPI_STATUS (status);
 	}
 
+	status = acpi_os_create_lock(&acpi_gbl_reference_count_lock);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
 	/* Mutex for _OSI support */
+
 	status = acpi_os_create_mutex(&acpi_gbl_osi_mutex);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
@@ -136,6 +142,7 @@ void acpi_ut_mutex_terminate(void)
 
 	acpi_os_delete_lock(acpi_gbl_gpe_lock);
 	acpi_os_delete_lock(acpi_gbl_hardware_lock);
+	acpi_os_delete_lock(acpi_gbl_reference_count_lock);
 
 	/* Delete the reader/writer lock */
 
Signature · 1 line
1.7.10
#13 lore raw
In reply to Lv Zheng
Quoted 77 lines · Lv Zheng

The 20130328 ACPICA kernel resident system updates is linuxized based on the pm/linux-next branch.
The patch set has passed a basic build/boot test on z530.

Fixed several possible race conditions with the internal object reference counting mechanism. Some of the external ACPICA interfaces update object reference counts without holding the interpreter or namespace lock. This change adds a spinlock to protect reference count updates on the internal ACPICA objects. Reported by and with assistance from Andriy Gapon ([email protected]).

FADT support: Removed an extraneous warning for very large GPE register sets. This change removes a size mismatch warning if the legacy length field for a GPE register set is larger than the 64-bit GAS structure can accommodate. GPE register sets can be larger than the 255-bit width limitation of the GAS structure. Linn Crosetto ([email protected]).

_OSI Support: handle any errors from AcpiOsAcquireMutex. Check for error return from this interface. Handles a possible timeout case if ACPI_WAIT_FOREVER is modified by the host to be a value less than "forever". Jung-uk Kim.

Predefined name support: Add allowed/required argument type information to the master predefined info table. This change adds the infrastructure to enable typechecking on incoming arguments for all predefined methods/objects. It does not actually contain the code that will fully utilize this information, this is still under development. Also condenses some duplicate code for the predefined names into a new module, utilities/utpredef.c

Example Code and Data Size: These are the sizes for the OS-independent acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size.

Previous Release:

    Non-Debug Version:  95.0K Code, 25.9K Data, 120.9K Total
    Debug Version:     182.9K Code, 75.6K Data, 258.5K Total
  Current Release:
    Non-Debug Version:  95.2K Code, 26.4K Data, 121.6K Total
    Debug Version:     183.0K Code, 76.0K Data, 259.0K Total

Bob Moore (6):
ACPICA: Predefine names: Add allowed argument types to master info
table
ACPICA: Improve error message for Index() operator
ACPICA: Remove FORCE_DELETE option for global reference count
mechanism
ACPICA: Fix a format string for 64-bit generation
ACPICA: Update version to 20130328
ACPICA: Add a lock to the internal object reference count mechanism

Colin Ian King (2):
ACPICA: Fix a typo in an error message
ACPICA: Fix a typo in a function header, no functional change

Jung-uk Kim (1):
ACPICA: _OSI Support: handle any errors from AcpiOsAcquireMutex

Linn Crosetto (1):
ACPICA: FADT: Remove extraneous warning for very large GPE registers

Tang Chen (1):
ACPICA: Fix for some comments/headers

 drivers/acpi/acpica/Makefile   |    1 +
 drivers/acpi/acpica/acglobal.h |    1 +
 drivers/acpi/acpica/aclocal.h  |   13 +-
 drivers/acpi/acpica/acnamesp.h |    4 -
 drivers/acpi/acpica/acpredef.h | 1305 ++++++++++++++++++++++++++++------------
 drivers/acpi/acpica/acutils.h  |   25 +-
 drivers/acpi/acpica/dswexec.c  |    2 +-
 drivers/acpi/acpica/evevent.c  |    2 +-
 drivers/acpi/acpica/exoparg2.c |   11 +-
 drivers/acpi/acpica/nseval.c   |   26 +-
 drivers/acpi/acpica/nspredef.c |  106 +---
 drivers/acpi/acpica/tbfadt.c   |    4 +
 drivers/acpi/acpica/tbxface.c  |   22 +-
Quoted 8 lines
 drivers/acpi/acpica/utdelete.c |   96 +--
 drivers/acpi/acpica/utmutex.c  |    9 +-
 drivers/acpi/acpica/utosi.c    |   26 +-
 drivers/acpi/acpica/utpredef.c |  399 ++++++++++++
 drivers/acpi/acpica/utxface.c  |   17 +-
 include/acpi/acpixf.h          |    2 +-
 19 files changed, 1481 insertions(+), 590 deletions(-)
 create mode 100644 drivers/acpi/acpica/utpredef.c

Applied, thanks Lv!

Rafael

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
author
#14 lore raw
Quoted 91 lines
Quoted 4 lines

The 20130328 ACPICA kernel resident system updates is linuxized based on the pm/linux-next branch.
The patch set has passed a basic build/boot test on z530.

Quoted 8 lines

Fixed several possible race conditions with the internal object reference counting mechanism. Some of the external ACPICA interfaces update object reference counts without holding the interpreter or namespace lock. This change adds a spinlock to protect reference count updates on the internal ACPICA objects. Reported by and with assistance from Andriy Gapon ([email protected]).

FADT support: Removed an extraneous warning for very large GPE register

sets.

Quoted 8 lines

This change removes a size mismatch warning if the legacy length field for a GPE register set is larger than the 64-bit GAS structure can accommodate. GPE register sets can be larger than the 255-bit width limitation of the GAS structure. Linn Crosetto ([email protected]).

_OSI Support: handle any errors from AcpiOsAcquireMutex. Check for error return from this interface. Handles a possible timeout case if ACPI_WAIT_FOREVER is modified by the host to be a value less than

"forever".

Quoted 5 lines

Jung-uk Kim.

Predefined name support: Add allowed/required argument type information to the master predefined info table. This change adds the infrastructure to enable typechecking on incoming arguments for all

predefined methods/objects.

Quoted 37 lines

It does not actually contain the code that will fully utilize this information, this is still under development. Also condenses some duplicate code for the predefined names into a new module, utilities/utpredef.c

Example Code and Data Size: These are the sizes for the OS-independent acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size.

Previous Release:

    Non-Debug Version:  95.0K Code, 25.9K Data, 120.9K Total
    Debug Version:     182.9K Code, 75.6K Data, 258.5K Total
  Current Release:
    Non-Debug Version:  95.2K Code, 26.4K Data, 121.6K Total
    Debug Version:     183.0K Code, 76.0K Data, 259.0K Total

Bob Moore (6):
ACPICA: Predefine names: Add allowed argument types to master info
table
ACPICA: Improve error message for Index() operator
ACPICA: Remove FORCE_DELETE option for global reference count
mechanism
ACPICA: Fix a format string for 64-bit generation
ACPICA: Update version to 20130328
ACPICA: Add a lock to the internal object reference count mechanism

Colin Ian King (2):
ACPICA: Fix a typo in an error message
ACPICA: Fix a typo in a function header, no functional change

Jung-uk Kim (1):
ACPICA: _OSI Support: handle any errors from AcpiOsAcquireMutex

Linn Crosetto (1):
ACPICA: FADT: Remove extraneous warning for very large GPE registers

Quoted 8 lines

Tang Chen (1):
ACPICA: Fix for some comments/headers

 drivers/acpi/acpica/Makefile   |    1 +
 drivers/acpi/acpica/acglobal.h |    1 +
 drivers/acpi/acpica/aclocal.h  |   13 +-
 drivers/acpi/acpica/acnamesp.h |    4 -
 drivers/acpi/acpica/acpredef.h | 1305

++++++++++++++++++++++++++++------------

Quoted 15 lines
 drivers/acpi/acpica/acutils.h  |   25 +-
 drivers/acpi/acpica/dswexec.c  |    2 +-
 drivers/acpi/acpica/evevent.c  |    2 +-
 drivers/acpi/acpica/exoparg2.c |   11 +-
 drivers/acpi/acpica/nseval.c   |   26 +-
 drivers/acpi/acpica/nspredef.c |  106 +---
 drivers/acpi/acpica/tbfadt.c   |    4 +
 drivers/acpi/acpica/tbxface.c  |   22 +-
 drivers/acpi/acpica/utdelete.c |   96 +--
 drivers/acpi/acpica/utmutex.c  |    9 +-
 drivers/acpi/acpica/utosi.c    |   26 +-
 drivers/acpi/acpica/utpredef.c |  399 ++++++++++++
 drivers/acpi/acpica/utxface.c  |   17 +-
 include/acpi/acpixf.h          |    2 +-
 19 files changed, 1481 insertions(+), 590 deletions(-)  create mode
Quoted 1 line

100644 drivers/acpi/acpica/utpredef.c

Quoted 1 line

Applied, thanks Lv!

Thanks!
-Lv