Skip to contentSkip to conversation

ACPICA: 20151218 Release

PATCH In review Lv Zheng 3 participants 50 messages Dec 29, 2015 – Jan 4, 2016

Subsystems (2)
lore
Share & tools
lore

Lv Zheng

author
#0 lore raw

cover ACPICA: 20151218 Release

The 20151218 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. i386 + default + ACPI_DEBUGGER=y
2. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20150930 Release):
517 lines
After applying (20151218 Release):
506 lines

Bob Moore (25):
ACPICA: exmutex: General cleanup, restructured some code
ACPICA: Core: Major update for code formatting, no functional changes
ACPICA: Split interpreter tracing functions to a new file
ACPICA: acpiexec: Add support for AML files containing multiple
tables
ACPICA: Disassembler/tools: Support for multiple ACPI tables in one
file
ACPICA: iasl/acpiexec: Update input file handling and verification
ACPICA: Revert "acpi_get_object_info: Add support for ACPI 5.0 _SUB
method."
ACPICA: Add comment explaining _SUB removal
ACPICA: acpiexec/acpinames: Update for error checking macros
ACPICA: Concatenate operator: Add extensions to support all ACPI
objects
ACPICA: Debug Object: Cleanup output
ACPICA: Debug object: Fix output for a NULL object
ACPICA: Update for output of the Debug Object
ACPICA: getopt: Comment update, no functional change
ACPICA: Add new exception code, AE_IO_ERROR
ACPICA: iasl/Disassembler: Support ASL ElseIf operator
ACPICA: Parser: Add constants for internal namepath function
ACPICA: Parser: Fix for SuperName method invocation
ACPICA: Update parameter type for ObjectType operator
ACPICA: Update internal #defines for ObjectType operator. No
functional change
ACPICA: Update for CondRefOf and RefOf operators
ACPICA: Cleanup code related to the per-table module level
improvement
ACPICA: Add "root node" case to the ACPI name repair code
ACPICA: Add per-table execution of module-level code
ACPICA: Update version to 20151218

Colin Ian King (1):
ACPICA: Tools: Add spacing and missing options in acpibin tool

David E. Box (1):
ACPICA: Fix SyncLevel support interaction with method
auto-serialization

LABBE Corentin (1):
ACPICA: Add "const" to some functions that return fixed strings

Lv Zheng (12):
ACPICA: Linuxize: reduce divergences for 20151218 release
ACPICA: Namespace: Fix wrong error log
ACPICA: Debugger: reduce old external path format
ACPICA: Namespace: Add scope information to the simple object repair
mechanism
ACPICA: Namespace: Add String -> ObjectReference conversion support
ACPICA: Events: Deploys acpi_ev_find_region_handler()
ACPICA: Events: Uses common_notify for address space handlers
ACPICA: Utilities: Reorder initialization code
ACPICA: Events: Fix an issue that region object is re-attached to
another scope when it is already attached
ACPICA: Events: Split acpi_ev_associate_reg_method() from region
initialization code
ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no
_REG evaluations can happen during OS early boot stages
ACPICA: Events: Introduce ACPI_REG_DISCONNECT invocation to
acpi_ev_execute_reg_methods()

Markus Elfring (1):
ACPICA: Debugger: Remove some unecessary NULL checks

Prarit Bhargava (1):
ACPICA: acpi_get_sleep_type_data: Reduce warnings

 drivers/acpi/acpica/Makefile                       |    4 +-
 drivers/acpi/acpica/acapps.h                       |   58 +-
 drivers/acpi/acpica/acdebug.h                      |    5 +-
 drivers/acpi/acpica/acevents.h                     |   11 +-
 drivers/acpi/acpica/acglobal.h                     |    3 +-
 drivers/acpi/acpica/aclocal.h                      |   12 +-
 drivers/acpi/acpica/acnamesp.h                     |   12 +-
 drivers/acpi/acpica/acobject.h                     |    7 +-
 drivers/acpi/acpica/acopcode.h                     |   10 +-
 drivers/acpi/acpica/acparser.h                     |    8 +-
 drivers/acpi/acpica/acutils.h                      |   26 +-
 drivers/acpi/acpica/amlcode.h                      |    5 +-
 drivers/acpi/acpica/dbcmds.c                       |   11 +-
 drivers/acpi/acpica/dbdisply.c                     |   84 ++-
 drivers/acpi/acpica/dbfileio.c                     |  123 +---
 drivers/acpi/acpica/dbinput.c                      |   22 +-
 drivers/acpi/acpica/dbnames.c                      |    2 +-
 drivers/acpi/acpica/dbstats.c                      |    1 +
 drivers/acpi/acpica/dbtest.c                       |    2 +-
 drivers/acpi/acpica/dbutils.c                      |    1 +
 drivers/acpi/acpica/dsargs.c                       |    7 +-
 drivers/acpi/acpica/dsdebug.c                      |    5 +-
 drivers/acpi/acpica/dsfield.c                      |   39 +-
 drivers/acpi/acpica/dsinit.c                       |    2 +-
 drivers/acpi/acpica/dsmethod.c                     |   39 +-
 drivers/acpi/acpica/dsmthdat.c                     |   20 +-
 drivers/acpi/acpica/dsobject.c                     |   19 +-
 drivers/acpi/acpica/dsopcode.c                     |   21 +-
 drivers/acpi/acpica/dsutils.c                      |   29 +-
 drivers/acpi/acpica/dswexec.c                      |   19 +-
 drivers/acpi/acpica/dswload.c                      |   10 +-
 drivers/acpi/acpica/dswload2.c                     |   10 +-
 drivers/acpi/acpica/dswscope.c                     |    1 +
 drivers/acpi/acpica/evgpe.c                        |    2 +-
 drivers/acpi/acpica/evgpeblk.c                     |    1 +
 drivers/acpi/acpica/evgpeutil.c                    |    1 +
 drivers/acpi/acpica/evhandler.c                    |  165 +++---
 drivers/acpi/acpica/evmisc.c                       |    5 +-
 drivers/acpi/acpica/evregion.c                     |  114 +++-
 drivers/acpi/acpica/evrgnini.c                     |  115 ++--
 drivers/acpi/acpica/evxface.c                      |    9 +-
 drivers/acpi/acpica/evxfregn.c                     |   38 +-
 drivers/acpi/acpica/exconfig.c                     |    8 +-
 drivers/acpi/acpica/exconvrt.c                     |    9 +-
 drivers/acpi/acpica/excreate.c                     |   20 +-
 drivers/acpi/acpica/exdebug.c                      |  403 ++-----------
 drivers/acpi/acpica/exdump.c                       |    6 +-
 drivers/acpi/acpica/exfield.c                      |   74 +--
 drivers/acpi/acpica/exfldio.c                      |   35 +-
 drivers/acpi/acpica/exmisc.c                       |   49 +-
 drivers/acpi/acpica/exmutex.c                      |   82 ++-
 drivers/acpi/acpica/exnames.c                      |    4 +-
 drivers/acpi/acpica/exoparg1.c                     |   33 +-
 drivers/acpi/acpica/exoparg2.c                     |   12 +-
 drivers/acpi/acpica/exoparg3.c                     |   25 +-
 drivers/acpi/acpica/exoparg6.c                     |    1 +
 drivers/acpi/acpica/exprep.c                       |   25 +-
 drivers/acpi/acpica/exregion.c                     |   13 +-
 drivers/acpi/acpica/exresnte.c                     |    2 +-
 drivers/acpi/acpica/exresolv.c                     |   10 +-
 drivers/acpi/acpica/exresop.c                      |   43 +-
 drivers/acpi/acpica/exstore.c                      |   17 +-
 drivers/acpi/acpica/exstorob.c                     |    7 +-
 drivers/acpi/acpica/exsystem.c                     |    6 +-
 drivers/acpi/acpica/extrace.c                      |  377 ++++++++++++
 drivers/acpi/acpica/exutils.c                      |    7 +-
 drivers/acpi/acpica/hwesleep.c                     |    4 +-
 drivers/acpi/acpica/hwgpe.c                        |    6 +-
 drivers/acpi/acpica/hwsleep.c                      |    4 +-
 drivers/acpi/acpica/hwxface.c                      |   24 +-
 drivers/acpi/acpica/hwxfsleep.c                    |    1 +
 drivers/acpi/acpica/nsconvert.c                    |  105 +++-
 drivers/acpi/acpica/nsdump.c                       |    5 +-
 drivers/acpi/acpica/nseval.c                       |    2 +-
 drivers/acpi/acpica/nsinit.c                       |    3 +-
 drivers/acpi/acpica/nsload.c                       |   18 +-
 drivers/acpi/acpica/nsnames.c                      |    6 +-
 drivers/acpi/acpica/nsparse.c                      |    5 +-
 drivers/acpi/acpica/nsprepkg.c                     |   10 +-
 drivers/acpi/acpica/nsrepair.c                     |   19 +-
 drivers/acpi/acpica/nsrepair2.c                    |   24 +-
 drivers/acpi/acpica/nssearch.c                     |    2 +-
 drivers/acpi/acpica/nsutils.c                      |    8 +-
 drivers/acpi/acpica/nsxfeval.c                     |    4 +-
 drivers/acpi/acpica/nsxfname.c                     |   39 +-
 drivers/acpi/acpica/nsxfobj.c                      |    6 +-
 drivers/acpi/acpica/psargs.c                       |   19 +-
 drivers/acpi/acpica/psloop.c                       |   12 +-
 drivers/acpi/acpica/psopcode.c                     |  606 ++++++++++----------
 drivers/acpi/acpica/psparse.c                      |    8 +-
 drivers/acpi/acpica/psutils.c                      |    4 +-
 drivers/acpi/acpica/pswalk.c                       |    1 +
 drivers/acpi/acpica/rsaddr.c                       |    4 +-
 drivers/acpi/acpica/rscalc.c                       |   81 +--
 drivers/acpi/acpica/rscreate.c                     |   32 +-
 drivers/acpi/acpica/rsdump.c                       |    6 +
 drivers/acpi/acpica/rslist.c                       |    9 +-
 drivers/acpi/acpica/rsmisc.c                       |   22 +-
 drivers/acpi/acpica/rsutils.c                      |   42 +-
 drivers/acpi/acpica/rsxface.c                      |    2 +-
 drivers/acpi/acpica/tbdata.c                       |    1 +
 drivers/acpi/acpica/tbinstal.c                     |    4 +-
 drivers/acpi/acpica/tbprint.c                      |    1 +
 drivers/acpi/acpica/tbutils.c                      |   10 +-
 drivers/acpi/acpica/tbxfload.c                     |    3 +-
 drivers/acpi/acpica/utaddress.c                    |    5 +-
 drivers/acpi/acpica/utcopy.c                       |   23 +-
 drivers/acpi/acpica/utdecode.c                     |   32 +-
 drivers/acpi/acpica/utdelete.c                     |    5 +-
 drivers/acpi/acpica/uterror.c                      |   10 +-
 drivers/acpi/acpica/utfileio.c                     |  334 -----------
 drivers/acpi/acpica/uthex.c                        |    2 +-
 drivers/acpi/acpica/utids.c                        |   67 ---
 drivers/acpi/acpica/utinit.c                       |    1 -
 drivers/acpi/acpica/utmath.c                       |   10 +-
 drivers/acpi/acpica/utmisc.c                       |   11 +-
 drivers/acpi/acpica/utmutex.c                      |    5 +-
 drivers/acpi/acpica/utnonansi.c                    |    4 +-
 drivers/acpi/acpica/utobject.c                     |   24 +-
 drivers/acpi/acpica/utosi.c                        |   11 +-
 drivers/acpi/acpica/utownerid.c                    |   12 +-
 drivers/acpi/acpica/utpredef.c                     |    6 +-
 drivers/acpi/acpica/utprint.c                      |   15 +-
 drivers/acpi/acpica/utresrc.c                      |    8 +-
 drivers/acpi/acpica/utstate.c                      |    3 +
 drivers/acpi/acpica/utstring.c                     |    9 +
 drivers/acpi/acpica/uttrack.c                      |   50 +-
 drivers/acpi/acpica/utxface.c                      |    2 -
 drivers/acpi/acpica/utxferror.c                    |    1 +
 drivers/acpi/acpica/utxfinit.c                     |   47 +-
 drivers/acpi/acpica/utxfmutex.c                    |    6 +-
 include/acpi/acexcep.h                             |    6 +-
 include/acpi/acpixf.h                              |   11 +-
 include/acpi/actypes.h                             |    6 +-
 include/acpi/platform/aclinuxex.h                  |    1 +
 tools/power/acpi/common/getopt.c                   |    2 +
 .../acpi/os_specific/service_layers/oslibcfs.c     |    3 +
 tools/power/acpi/tools/acpidump/apfiles.c          |   13 +
 138 files changed, 2113 insertions(+), 2140 deletions(-)
 create mode 100644 drivers/acpi/acpica/extrace.c
 delete mode 100644 drivers/acpi/acpica/utfileio.c
Signature · 1 line
1.7.10
author
#1 lore raw

PATCH 1/42 ACPICA: Linuxize: reduce divergences for 20151218 release

The patch reduces source code differences between the Linux kernel and the ACPICA upstream so that the linuxized ACPICA 20151218 release can be applied with reduced human intervention.

The pscode.c has already been out of sync for months, and it becomes more and more difficult to merge pscode.c changes, so instead of update the affected lines of pscode.c, this patch synchronizes entire pscode.c file.

---
 drivers/acpi/acpica/dsfield.c     |    8 +-
 drivers/acpi/acpica/dsutils.c     |    4 +-
 drivers/acpi/acpica/exconvrt.c    |    4 +-
 drivers/acpi/acpica/excreate.c    |    5 +-
 drivers/acpi/acpica/exfield.c     |    2 +-
 drivers/acpi/acpica/exmutex.c     |    2 +-
 drivers/acpi/acpica/exoparg3.c    |    6 +-
 drivers/acpi/acpica/hwgpe.c       |    1 +
 drivers/acpi/acpica/nsrepair2.c   |    2 +-
 drivers/acpi/acpica/psopcode.c    |  604 ++++++++++++++++++-------------------
 drivers/acpi/acpica/rsmisc.c      |    6 +-
 drivers/acpi/acpica/utobject.c    |    4 +-
 include/acpi/platform/aclinuxex.h |    1 +
 13 files changed, 325 insertions(+), 324 deletions(-)
drivers/acpi/acpica/dsfield.c +4 -4
index 20de148..37e11a3 100644
@@ -310,8 +310,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
 		switch (arg->common.aml_opcode) {
 		case AML_INT_RESERVEDFIELD_OP:
 
-			position = (u64) info->field_bit_position
-			    + (u64) arg->common.value.size;
+			position = (u64)info->field_bit_position
+			    + (u64)arg->common.value.size;
 
 			if (position > ACPI_UINT32_MAX) {
 				ACPI_ERROR((AE_INFO,
@@ -425,8 +425,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
 
 			/* Keep track of bit position for the next field */
 
-			position = (u64) info->field_bit_position
-			    + (u64) arg->common.value.size;
+			position = (u64)info->field_bit_position
+			    + (u64)arg->common.value.size;
 
 			if (position > ACPI_UINT32_MAX) {
 				ACPI_ERROR((AE_INFO,
drivers/acpi/acpica/dsutils.c +2 -2
index e4293a8..cecba39 100644
@@ -504,8 +504,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
 		if ((walk_state->deferred_node) &&
 		    (walk_state->deferred_node->type == ACPI_TYPE_BUFFER_FIELD)
 		    && (arg_index ==
-			(u32) ((walk_state->opcode ==
-				AML_CREATE_FIELD_OP) ? 3 : 2))) {
+			(u32)((walk_state->opcode ==
+			       AML_CREATE_FIELD_OP) ? 3 : 2))) {
 			obj_desc =
 			    ACPI_CAST_PTR(union acpi_operand_object,
 					  walk_state->deferred_node);
drivers/acpi/acpica/exconvrt.c +2 -2
index 1e4c5b6..145de28 100644
@@ -355,8 +355,8 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width)
 			/* Get one hex digit, most significant digits first */
 
 			string[k] =
-			    (u8) acpi_ut_hex_to_ascii_char(integer,
-							   ACPI_MUL_4(j));
+			    (u8)acpi_ut_hex_to_ascii_char(integer,
+							  ACPI_MUL_4(j));
 			k++;
 		}
 		break;
drivers/acpi/acpica/excreate.c +2 -3
index ccb7219..95fe464 100644
@@ -492,10 +492,9 @@ acpi_ex_create_method(u8 * aml_start,
 	 * Disassemble the method flags. Split off the arg_count, Serialized
 	 * flag, and sync_level for efficiency.
 	 */
-	method_flags = (u8) operand[1]->integer.value;
-
+	method_flags = (u8)operand[1]->integer.value;
 	obj_desc->method.param_count =
-	    (u8) (method_flags & AML_METHOD_ARG_COUNT);
+	    (u8)(method_flags & AML_METHOD_ARG_COUNT);
 
 	/*
 	 * Get the sync_level. If method is serialized, a mutex will be
drivers/acpi/acpica/exfield.c +1 -1
index 61fd9c7..c95fd18 100644
@@ -439,7 +439,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 		 * same buffer)
 		 */
 		status = acpi_ex_access_region(obj_desc, 0,
-					       (u64 *) buffer, function);
+					       (u64 *)buffer, function);
 		acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
 
 		*result_desc = buffer_desc;
drivers/acpi/acpica/exmutex.c +1 -1
index 472030f..a97f520 100644
@@ -254,7 +254,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 		return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
 	}
 
-	status = acpi_ex_acquire_mutex_object((u16) time_desc->integer.value,
+	status = acpi_ex_acquire_mutex_object((u16)time_desc->integer.value,
 					      obj_desc,
 					      walk_state->thread->thread_id);
 	if (ACPI_SUCCESS(status) && obj_desc->mutex.acquisition_depth == 1) {
drivers/acpi/acpica/exoparg3.c +3 -3
index fa100b3..351b82a 100644
@@ -96,9 +96,9 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
 
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 				  "FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
-				  (u32) operand[0]->integer.value,
-				  (u32) operand[1]->integer.value,
-				  (u32) operand[2]->integer.value));
+				  (u32)operand[0]->integer.value,
+				  (u32)operand[1]->integer.value,
+				  (u32)operand[2]->integer.value));
 
 		fatal = ACPI_ALLOCATE(sizeof(struct acpi_signal_fatal_info));
 		if (fatal) {
drivers/acpi/acpica/hwgpe.c +1 -0
index 73cfa59..da4a923 100644
@@ -298,6 +298,7 @@ acpi_hw_gpe_enable_write(u8 enable_mask,
 
 	gpe_register_info->enable_mask = enable_mask;
 	status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
+
 	return (status);
 }
 
drivers/acpi/acpica/nsrepair2.c +1 -1
index 0515a70..7ca8f2b 100644
@@ -710,7 +710,7 @@ acpi_ns_repair_PSS(struct acpi_evaluate_info *info,
 		elements = (*outer_elements)->package.elements;
 		obj_desc = elements[1];	/* Index1 = power_dissipation */
 
-		if ((u32) obj_desc->integer.value > previous_value) {
+		if ((u32)obj_desc->integer.value > previous_value) {
 			ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
 					      info->node_flags,
 					      "SubPackage[%u,%u] - suspicious power dissipation values",
drivers/acpi/acpica/psopcode.c +302 -302

760 lines not on this page · raw message

drivers/acpi/acpica/rsmisc.c +3 -3
index ac37852..b528ed90 100644
@@ -446,7 +446,7 @@ exit:
 		/* Round the resource struct length up to the next boundary (32 or 64) */
 
 		resource->length =
-		    (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(resource->length);
+		    (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(resource->length);
 	}
 	return_ACPI_STATUS(AE_OK);
 }
@@ -551,8 +551,8 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			ACPI_SET8(destination, item_count);
 
 			aml_length =
-			    (u16) (aml_length +
-				   (info->value * (item_count - 1)));
+			    (u16)(aml_length +
+				  (info->value * (item_count - 1)));
 			break;
 
 		case ACPI_RSC_COUNT16:
drivers/acpi/acpica/utobject.c +2 -2
index 7d83efe..c7e11cc 100644
@@ -253,7 +253,7 @@ union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size)
 		buffer = ACPI_ALLOCATE_ZEROED(buffer_size);
 		if (!buffer) {
 			ACPI_ERROR((AE_INFO, "Could not allocate size %u",
-				    (u32) buffer_size));
+				    (u32)buffer_size));
 			acpi_ut_remove_reference(buffer_desc);
 			return_PTR(NULL);
 		}
@@ -305,7 +305,7 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size)
 	string = ACPI_ALLOCATE_ZEROED(string_size + 1);
 	if (!string) {
 		ACPI_ERROR((AE_INFO, "Could not allocate size %u",
-			    (u32) string_size));
+			    (u32)string_size));
 		acpi_ut_remove_reference(string_desc);
 		return_PTR(NULL);
 	}
include/acpi/platform/aclinuxex.h +1 -0
index ceea026..f903fe6 100644
@@ -136,6 +136,7 @@ static inline acpi_status acpi_os_initialize_command_signals(void)
 
 static inline void acpi_os_terminate_command_signals(void)
 {
+	return;
 }
 
 /*
Signature · 1 line
1.7.10
author
#2 lore raw

PATCH 2/42 ACPICA: acpi_get_sleep_type_data: Reduce warnings

In reply to Lv Zheng

From: Prarit Bhargava <[email protected]>

ACPICA commit 7bb77313091e52a846df4c9c2bea90be31bfb9d8

Eliminate warnings for "not found" _Sx errors, since these are optional. Original NOT_FOUND status is still returned.

Original changes by Prarit Bhargava.
ACPICA BZ 1208.

---
 drivers/acpi/acpica/hwxface.c |   24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/acpi/acpica/hwxface.c +17 -7
index 5f97468..b2e50d8 100644
@@ -504,11 +504,20 @@ 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->relative_pathname =
-	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
+	info->relative_pathname = ACPI_CAST_PTR(char,
+						acpi_gbl_sleep_state_names
+						[sleep_state]);
+
 	status = acpi_ns_evaluate(info);
 	if (ACPI_FAILURE(status)) {
-		goto cleanup;
+		if (status == AE_NOT_FOUND) {
+
+			/* The _Sx states are optional, ignore NOT_FOUND */
+
+			goto final_cleanup;
+		}
+
+		goto warning_cleanup;
 	}
 
 	/* Must have a return object */
@@ -517,7 +526,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]",
 			    info->relative_pathname));
 		status = AE_AML_NO_RETURN_VALUE;
-		goto cleanup;
+		goto warning_cleanup;
 	}
 
 	/* Return object must be of type Package */
@@ -526,7 +535,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		ACPI_ERROR((AE_INFO,
 			    "Sleep State return object is not a Package"));
 		status = AE_AML_OPERAND_TYPE;
-		goto cleanup1;
+		goto return_value_cleanup;
 	}
 
 	/*
@@ -570,16 +579,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		break;
 	}
 
-cleanup1:
+return_value_cleanup:
 	acpi_ut_remove_reference(info->return_object);
 
-cleanup:
+warning_cleanup:
 	if (ACPI_FAILURE(status)) {
 		ACPI_EXCEPTION((AE_INFO, status,
 				"While evaluating Sleep State [%s]",
 				info->relative_pathname));
 	}
 
+final_cleanup:
 	ACPI_FREE(info);
 	return_ACPI_STATUS(status);
 }
Signature · 1 line
1.7.10
author
#3 lore raw

PATCH 3/42 ACPICA: Namespace: Fix wrong error log

In reply to Lv Zheng

ACPICA commit 20228e39e125d92f9d80c6e07d3767b225d0536e

The Info->Node in acpi_ns_init_one_device() may not be initialized. Even it is initialized, the redundant "._INI" can be seen for this log entry. This patch fixes this issue by using device_node instead. Lv Zheng.

---
 drivers/acpi/acpica/nsinit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpica/nsinit.c +1 -1
index b744a53..656eacf 100644
@@ -582,7 +582,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->node);
+		char *scope_name = acpi_ns_get_external_pathname(device_node);
 
 		ACPI_EXCEPTION((AE_INFO, status, "during %s._INI execution",
 				scope_name));
Signature · 1 line
1.7.10
author
#4 lore raw

PATCH 4/42 ACPICA: Debugger: reduce old external path format

In reply to Lv Zheng

ACPICA commit 75c0da9e796bdf9bdd46d75f028a3e1779903214

In the error logs and debugger outputs, use new external path format that does not contain a trailing underscore.
This patch takes care of acpi_ns_get_external_pathname() invocations, chaning them into acpi_ns_get_normalized_pathname(TRUE) where possible. Along with some error log fixes, the following debugger commands are fixed: resources, handlers, paths. Lv Zheng.

---
 drivers/acpi/acpica/dbcmds.c    |    2 +-
 drivers/acpi/acpica/dbdisply.c  |    2 +-
 drivers/acpi/acpica/dbnames.c   |    2 +-
 drivers/acpi/acpica/dbtest.c    |    2 +-
 drivers/acpi/acpica/nsdump.c    |    2 +-
 drivers/acpi/acpica/nseval.c    |    2 +-
 drivers/acpi/acpica/nsinit.c    |    3 ++-
 drivers/acpi/acpica/nssearch.c  |    2 +-
 drivers/acpi/acpica/utaddress.c |    5 +++--
 9 files changed, 12 insertions(+), 10 deletions(-)
drivers/acpi/acpica/dbcmds.c +1 -1
index 30414b3..84ab1c2 100644
@@ -798,7 +798,7 @@ acpi_db_device_resources(acpi_handle obj_handle,
 	acpi_status status;
 
 	node = ACPI_CAST_PTR(struct acpi_namespace_node, obj_handle);
-	parent_path = acpi_ns_get_external_pathname(node);
+	parent_path = acpi_ns_get_normalized_pathname(node, TRUE);
 	if (!parent_path) {
 		return (AE_NO_MEMORY);
 	}
drivers/acpi/acpica/dbdisply.c +1 -1
index c42ce8a..3acc3a5 100644
@@ -1091,7 +1091,7 @@ acpi_db_display_non_root_handlers(acpi_handle obj_handle,
 		return (AE_OK);
 	}
 
-	pathname = acpi_ns_get_external_pathname(node);
+	pathname = acpi_ns_get_normalized_pathname(node, TRUE);
 	if (!pathname) {
 		return (AE_OK);
 	}
drivers/acpi/acpica/dbnames.c +1 -1
index 04ff1eb..4f68dfc 100644
@@ -438,7 +438,7 @@ acpi_db_walk_for_predefined_names(acpi_handle obj_handle,
 		return (AE_OK);
 	}
 
-	pathname = acpi_ns_get_external_pathname(node);
+	pathname = acpi_ns_get_normalized_pathname(node, TRUE);
 	if (!pathname) {
 		return (AE_OK);
 	}
drivers/acpi/acpica/dbtest.c +1 -1
index 10ea8bf..68b4e8d 100644
@@ -953,7 +953,7 @@ acpi_db_evaluate_one_predefined_name(acpi_handle obj_handle,
 		return (AE_OK);
 	}
 
-	pathname = acpi_ns_get_external_pathname(node);
+	pathname = acpi_ns_get_normalized_pathname(node, TRUE);
 	if (!pathname) {
 		return (AE_OK);
 	}
drivers/acpi/acpica/nsdump.c +1 -1
index 37aa5c4..e071956 100644
@@ -717,7 +717,7 @@ acpi_ns_dump_one_object_path(acpi_handle obj_handle,
 		return (AE_OK);
 	}
 
-	pathname = acpi_ns_get_external_pathname(node);
+	pathname = acpi_ns_get_normalized_pathname(node, TRUE);
 
 	path_indent = 1;
 	if (level <= max_level) {
drivers/acpi/acpica/nseval.c +1 -1
index 7eba578..15e0b2e 100644
@@ -135,7 +135,7 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
 
 	/* Get the full pathname to the object, for use in warning messages */
 
-	info->full_pathname = acpi_ns_get_external_pathname(info->node);
+	info->full_pathname = acpi_ns_get_normalized_pathname(info->node, TRUE);
 	if (!info->full_pathname) {
 		return_ACPI_STATUS(AE_NO_MEMORY);
 	}
drivers/acpi/acpica/nsinit.c +2 -1
index 656eacf..ac59929 100644
@@ -582,7 +582,8 @@ 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(device_node);
+		char *scope_name =
+		    acpi_ns_get_normalized_pathname(device_node, TRUE);
 
 		ACPI_EXCEPTION((AE_INFO, status, "during %s._INI execution",
 				scope_name));
drivers/acpi/acpica/nssearch.c +1 -1
index d739040..9cc3564d 100644
@@ -105,7 +105,7 @@ acpi_ns_search_one_scope(u32 target_name,
 	if (ACPI_LV_NAMES & acpi_dbg_level) {
 		char *scope_name;
 
-		scope_name = acpi_ns_get_external_pathname(parent_node);
+		scope_name = acpi_ns_get_normalized_pathname(parent_node, TRUE);
 		if (scope_name) {
 			ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
 					  "Searching %s (%p) For [%4.4s] (%s)\n",
drivers/acpi/acpica/utaddress.c +3 -2
index 911ea8e..38a29e2 100644
@@ -239,8 +239,9 @@ acpi_ut_check_address_range(acpi_adr_space_type space_id,
 			overlap_count++;
 			if (warn) {	/* Optional warning message */
 				pathname =
-				    acpi_ns_get_external_pathname(range_info->
-								  region_node);
+				    acpi_ns_get_normalized_pathname(range_info->
+								    region_node,
+								    TRUE);
 
 				ACPI_WARNING((AE_INFO,
 					      "%s range 0x%8.8X%8.8X-0x%8.8X%8.8X conflicts with OpRegion 0x%8.8X%8.8X-0x%8.8X%8.8X (%s)",
Signature · 1 line
1.7.10
author
#5 lore raw

PATCH 5/42 ACPICA: Fix SyncLevel support interaction with method auto-serialization

In reply to Lv Zheng

From: "David E. Box" <[email protected]>

ACPICA commit 253e3c03efc1a495d2aa61eee09ab1d0842a3dce

The control method auto-serialization can interfere with existing ASL code that makes use of Mutex/Method SyncLevel support. This change makes the auto-serialization transparent to the SyncLevel support and management. David Box.

---
 drivers/acpi/acpica/dsmethod.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/acpi/acpica/dsmethod.c +13 -2
index bc32f31..49ba082 100644
@@ -411,8 +411,19 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
 
 				obj_desc->method.mutex->mutex.thread_id =
 				    walk_state->thread->thread_id;
-				walk_state->thread->current_sync_level =
-				    obj_desc->method.sync_level;
+
+				/*
+				 * Update the current sync_level only if this is not an auto-
+				 * serialized method. In the auto case, we have to ignore
+				 * the sync level for the method mutex (created for the
+				 * auto-serialization) because we have no idea of what the
+				 * sync level should be. Therefore, just ignore it.
+				 */
+				if (!(obj_desc->method.info_flags &
+				      ACPI_METHOD_IGNORE_SYNC_LEVEL)) {
+					walk_state->thread->current_sync_level =
+					    obj_desc->method.sync_level;
+				}
 			} else {
 				obj_desc->method.mutex->mutex.
 				    original_sync_level =
Signature · 1 line
1.7.10
author
#6 lore raw

PATCH 6/42 ACPICA: Add "const" to some functions that return fixed strings

In reply to Lv Zheng

From: LABBE Corentin <[email protected]>

ACPICA commit 28645f8a113f346c8db103a4f7565fcba88c746f

Most of the "get_name" - style functions can return "const char *" with no ill side-effects. Original linux patch from LABBE Corentin <[email protected]> and backported to ACPICA.

---
 drivers/acpi/acpica/acutils.h  |   14 +++++++-------
 drivers/acpi/acpica/nsxfname.c |    2 +-
 drivers/acpi/acpica/utdecode.c |   29 +++++++++++++----------------
 drivers/acpi/acpica/uthex.c    |    2 +-
 4 files changed, 22 insertions(+), 25 deletions(-)
drivers/acpi/acpica/acutils.h +7 -7
index 8b8fef6..7495421 100644
@@ -184,24 +184,24 @@ acpi_status acpi_ut_init_globals(void);
 
 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
 
-char *acpi_ut_get_mutex_name(u32 mutex_id);
+const char *acpi_ut_get_mutex_name(u32 mutex_id);
 
 const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type);
 #endif
 
-char *acpi_ut_get_type_name(acpi_object_type type);
+const char *acpi_ut_get_type_name(acpi_object_type type);
 
-char *acpi_ut_get_node_name(void *object);
+const char *acpi_ut_get_node_name(void *object);
 
-char *acpi_ut_get_descriptor_name(void *object);
+const char *acpi_ut_get_descriptor_name(void *object);
 
 const char *acpi_ut_get_reference_name(union acpi_operand_object *object);
 
-char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc);
+const char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc);
 
-char *acpi_ut_get_region_name(u8 space_id);
+const char *acpi_ut_get_region_name(u8 space_id);
 
-char *acpi_ut_get_event_name(u32 event_id);
+const char *acpi_ut_get_event_name(u32 event_id);
 
 char acpi_ut_hex_to_ascii_char(u64 integer, u32 position);
 
drivers/acpi/acpica/nsxfname.c +1 -1
index 4b4d2f4..138cf5e 100644
@@ -159,7 +159,7 @@ acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer * buffer)
 {
 	acpi_status status;
 	struct acpi_namespace_node *node;
-	char *node_name;
+	const char *node_name;
 
 	/* Parameter validation */
 
drivers/acpi/acpica/utdecode.c +13 -16
index ecaaaff..7e14400 100644
@@ -114,7 +114,7 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = {
 	"PCC"			/* 0x0A */
 };
 
-char *acpi_ut_get_region_name(u8 space_id)
+const char *acpi_ut_get_region_name(u8 space_id)
 {
 
 	if (space_id >= ACPI_USER_REGION_BEGIN) {
@@ -127,7 +127,7 @@ char *acpi_ut_get_region_name(u8 space_id)
 		return ("InvalidSpaceId");
 	}
 
-	return (ACPI_CAST_PTR(char, acpi_gbl_region_types[space_id]));
+	return (acpi_gbl_region_types[space_id]);
 }
 
 /*******************************************************************************
@@ -152,14 +152,14 @@ static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = {
 	"RealTimeClock",
 };
 
-char *acpi_ut_get_event_name(u32 event_id)
+const char *acpi_ut_get_event_name(u32 event_id)
 {
 
 	if (event_id > ACPI_EVENT_MAX) {
 		return ("InvalidEventID");
 	}
 
-	return (ACPI_CAST_PTR(char, acpi_gbl_event_types[event_id]));
+	return (acpi_gbl_event_types[event_id]);
 }
 
 /*******************************************************************************
@@ -220,17 +220,17 @@ static const char *acpi_gbl_ns_type_names[] = {
 	/* 30 */ "Invalid"
 };
 
-char *acpi_ut_get_type_name(acpi_object_type type)
+const char *acpi_ut_get_type_name(acpi_object_type type)
 {
 
 	if (type > ACPI_TYPE_INVALID) {
-		return (ACPI_CAST_PTR(char, acpi_gbl_bad_type));
+		return (acpi_gbl_bad_type);
 	}
 
-	return (ACPI_CAST_PTR(char, acpi_gbl_ns_type_names[type]));
+	return (acpi_gbl_ns_type_names[type]);
 }
 
-char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc)
+const char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc)
 {
 	ACPI_FUNCTION_TRACE(ut_get_object_type_name);
 
@@ -267,7 +267,7 @@ char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc)
  *
  ******************************************************************************/
 
-char *acpi_ut_get_node_name(void *object)
+const char *acpi_ut_get_node_name(void *object)
 {
 	struct acpi_namespace_node *node = (struct acpi_namespace_node *)object;
 
@@ -333,7 +333,7 @@ static const char *acpi_gbl_desc_type_names[] = {
 	/* 15 */ "Node"
 };
 
-char *acpi_ut_get_descriptor_name(void *object)
+const char *acpi_ut_get_descriptor_name(void *object)
 {
 
 	if (!object) {
@@ -344,10 +344,7 @@ char *acpi_ut_get_descriptor_name(void *object)
 		return ("Not a Descriptor");
 	}
 
-	return (ACPI_CAST_PTR(char,
-			      acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE
-						       (object)]));
-
+	return (acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE(object)]);
 }
 
 /*******************************************************************************
@@ -415,7 +412,7 @@ const char *acpi_ut_get_reference_name(union acpi_operand_object *object)
 
 /* Names for internal mutex objects, used for debug output */
 
-static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
+static const char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
 	"ACPI_MTX_Interpreter",
 	"ACPI_MTX_Namespace",
 	"ACPI_MTX_Tables",
@@ -424,7 +421,7 @@ static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
 	"ACPI_MTX_Memory",
 };
 
-char *acpi_ut_get_mutex_name(u32 mutex_id)
+const char *acpi_ut_get_mutex_name(u32 mutex_id)
 {
 
 	if (mutex_id > ACPI_MAX_MUTEX) {
drivers/acpi/acpica/uthex.c +1 -1
index fda8b3d..8ad086e 100644
@@ -48,7 +48,7 @@
 ACPI_MODULE_NAME("uthex")
 
 /* Hex to ASCII conversion table */
-static char acpi_gbl_hex_to_ascii[] = {
+static const char acpi_gbl_hex_to_ascii[] = {
 	'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D',
 	    'E', 'F'
 };
Signature · 1 line
1.7.10
author
#7 lore raw

PATCH 7/42 ACPICA: exmutex: General cleanup, restructured some code

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit c2a7d000b6be34313b1c50c8a718df16113f0f32

Should be no functional change.

---
 drivers/acpi/acpica/exmutex.c |   80 ++++++++++++++++++++++++++++++-----------
 1 file changed, 59 insertions(+), 21 deletions(-)
drivers/acpi/acpica/exmutex.c +59 -21
index a97f520..843c60a 100644
@@ -185,8 +185,9 @@ acpi_ex_acquire_mutex_object(u16 timeout,
 	if (obj_desc == acpi_gbl_global_lock_mutex) {
 		status = acpi_ev_acquire_global_lock(timeout);
 	} else {
-		status = acpi_ex_system_wait_mutex(obj_desc->mutex.os_mutex,
-						   timeout);
+		status =
+		    acpi_ex_system_wait_mutex(obj_desc->mutex.os_mutex,
+					      timeout);
 	}
 
 	if (ACPI_FAILURE(status)) {
@@ -243,20 +244,30 @@ 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
-	 * mutex. This mechanism provides some deadlock prevention
+	 * 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) {
 		ACPI_ERROR((AE_INFO,
-			    "Cannot acquire Mutex [%4.4s], current SyncLevel is too large (%u)",
+			    "Cannot acquire Mutex [%4.4s], "
+			    "current SyncLevel is too large (%u)",
 			    acpi_ut_get_node_name(obj_desc->mutex.node),
 			    walk_state->thread->current_sync_level));
 		return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
 	}
 
+	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+			  "Acquiring: Mutex SyncLevel %u, Thread SyncLevel %u, "
+			  "Depth %u TID %p\n",
+			  obj_desc->mutex.sync_level,
+			  walk_state->thread->current_sync_level,
+			  obj_desc->mutex.acquisition_depth,
+			  walk_state->thread));
+
 	status = acpi_ex_acquire_mutex_object((u16)time_desc->integer.value,
 					      obj_desc,
 					      walk_state->thread->thread_id);
+
 	if (ACPI_SUCCESS(status) && obj_desc->mutex.acquisition_depth == 1) {
 
 		/* Save Thread object, original/current sync levels */
@@ -272,6 +283,12 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 		acpi_ex_link_mutex(obj_desc, walk_state->thread);
 	}
 
+	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+			  "Acquired: Mutex SyncLevel %u, Thread SyncLevel %u, Depth %u\n",
+			  obj_desc->mutex.sync_level,
+			  walk_state->thread->current_sync_level,
+			  obj_desc->mutex.acquisition_depth));
+
 	return_ACPI_STATUS(status);
 }
 
@@ -356,9 +373,9 @@ acpi_status
 acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 		      struct acpi_walk_state *walk_state)
 {
-	acpi_status status = AE_OK;
 	u8 previous_sync_level;
 	struct acpi_thread_state *owner_thread;
+	acpi_status status = AE_OK;
 
 	ACPI_FUNCTION_TRACE(ex_release_mutex);
 
@@ -409,7 +426,8 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 	 */
 	if (obj_desc->mutex.sync_level != owner_thread->current_sync_level) {
 		ACPI_ERROR((AE_INFO,
-			    "Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %u current %u",
+			    "Cannot release Mutex [%4.4s], SyncLevel mismatch: "
+			    "mutex %u current %u",
 			    acpi_ut_get_node_name(obj_desc->mutex.node),
 			    obj_desc->mutex.sync_level,
 			    walk_state->thread->current_sync_level));
@@ -424,6 +442,15 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 	previous_sync_level =
 	    owner_thread->acquired_mutex_list->mutex.original_sync_level;
 
+	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+			  "Releasing: Object SyncLevel %u, Thread SyncLevel %u, "
+			  "Prev SyncLevel %u, Depth %u TID %p\n",
+			  obj_desc->mutex.sync_level,
+			  walk_state->thread->current_sync_level,
+			  previous_sync_level,
+			  obj_desc->mutex.acquisition_depth,
+			  walk_state->thread));
+
 	status = acpi_ex_release_mutex_object(obj_desc);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
@@ -436,6 +463,14 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 		owner_thread->current_sync_level = previous_sync_level;
 	}
 
+	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+			  "Released: Object SyncLevel %u, Thread SyncLevel, %u, "
+			  "Prev SyncLevel %u, Depth %u\n",
+			  obj_desc->mutex.sync_level,
+			  walk_state->thread->current_sync_level,
+			  previous_sync_level,
+			  obj_desc->mutex.acquisition_depth));
+
 	return_ACPI_STATUS(status);
 }
 
@@ -462,21 +497,17 @@ void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread)
 	union acpi_operand_object *next = thread->acquired_mutex_list;
 	union acpi_operand_object *obj_desc;
 
-	ACPI_FUNCTION_NAME(ex_release_all_mutexes);
+	ACPI_FUNCTION_TRACE(ex_release_all_mutexes);
 
 	/* Traverse the list of owned mutexes, releasing each one */
 
 	while (next) {
 		obj_desc = next;
-		next = obj_desc->mutex.next;
-
-		obj_desc->mutex.prev = NULL;
-		obj_desc->mutex.next = NULL;
-		obj_desc->mutex.acquisition_depth = 0;
-
 		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "Force-releasing held mutex: %p\n",
-				  obj_desc));
+				  "Mutex [%4.4s] force-release, SyncLevel %u Depth %u\n",
+				  obj_desc->mutex.node->name.ascii,
+				  obj_desc->mutex.sync_level,
+				  obj_desc->mutex.acquisition_depth));
 
 		/* Release the mutex, special case for Global Lock */
 
@@ -489,14 +520,21 @@ void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread)
 			acpi_os_release_mutex(obj_desc->mutex.os_mutex);
 		}
 
-		/* Mark mutex unowned */
-
-		obj_desc->mutex.owner_thread = NULL;
-		obj_desc->mutex.thread_id = 0;
-
 		/* Update Thread sync_level (Last mutex is the important one) */
 
 		thread->current_sync_level =
 		    obj_desc->mutex.original_sync_level;
+
+		/* Mark mutex unowned */
+
+		next = obj_desc->mutex.next;
+
+		obj_desc->mutex.prev = NULL;
+		obj_desc->mutex.next = NULL;
+		obj_desc->mutex.acquisition_depth = 0;
+		obj_desc->mutex.owner_thread = NULL;
+		obj_desc->mutex.thread_id = 0;
 	}
+
+	return_VOID;
 }
Signature · 1 line
1.7.10
author
#8 lore raw

PATCH 8/42 ACPICA: Core: Major update for code formatting, no functional changes

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit dfa394471f6c01b2ee9433dbc143ec70cb9bca72

Mostly indentation inconsistencies across the code. Split some long lines, etc.

---
 drivers/acpi/acpica/dbstats.c                      |    1 +
 drivers/acpi/acpica/dbutils.c                      |    1 +
 drivers/acpi/acpica/dsargs.c                       |    7 +-
 drivers/acpi/acpica/dsdebug.c                      |    5 +-
 drivers/acpi/acpica/dsfield.c                      |   39 +++++-----
 drivers/acpi/acpica/dsinit.c                       |    2 +-
 drivers/acpi/acpica/dsmethod.c                     |   24 +++---
 drivers/acpi/acpica/dsmthdat.c                     |   20 ++---
 drivers/acpi/acpica/dsobject.c                     |   19 +++--
 drivers/acpi/acpica/dsopcode.c                     |   21 ++---
 drivers/acpi/acpica/dsutils.c                      |   29 ++++---
 drivers/acpi/acpica/dswexec.c                      |   19 ++---
 drivers/acpi/acpica/dswload.c                      |   10 +--
 drivers/acpi/acpica/dswload2.c                     |   10 +--
 drivers/acpi/acpica/dswscope.c                     |    1 +
 drivers/acpi/acpica/evgpe.c                        |    2 +-
 drivers/acpi/acpica/evgpeblk.c                     |    1 +
 drivers/acpi/acpica/evgpeutil.c                    |    1 +
 drivers/acpi/acpica/evmisc.c                       |    5 +-
 drivers/acpi/acpica/evxface.c                      |    9 +--
 drivers/acpi/acpica/evxfregn.c                     |    1 +
 drivers/acpi/acpica/exconfig.c                     |    8 +-
 drivers/acpi/acpica/exconvrt.c                     |    9 +--
 drivers/acpi/acpica/excreate.c                     |   10 +--
 drivers/acpi/acpica/exdebug.c                      |    1 +
 drivers/acpi/acpica/exfield.c                      |   74 ++++++++++--------
 drivers/acpi/acpica/exfldio.c                      |   35 +++++----
 drivers/acpi/acpica/exmisc.c                       |   10 ++-
 drivers/acpi/acpica/exnames.c                      |    4 +-
 drivers/acpi/acpica/exoparg1.c                     |   31 +++++---
 drivers/acpi/acpica/exoparg2.c                     |   12 ++-
 drivers/acpi/acpica/exoparg3.c                     |   19 +++--
 drivers/acpi/acpica/exoparg6.c                     |    1 +
 drivers/acpi/acpica/exprep.c                       |   25 +++---
 drivers/acpi/acpica/exregion.c                     |   13 ++--
 drivers/acpi/acpica/exresnte.c                     |    2 +-
 drivers/acpi/acpica/exresolv.c                     |   10 +--
 drivers/acpi/acpica/exresop.c                      |   43 ++++++-----
 drivers/acpi/acpica/exstore.c                      |   17 ++--
 drivers/acpi/acpica/exstorob.c                     |    7 +-
 drivers/acpi/acpica/exsystem.c                     |    6 +-
 drivers/acpi/acpica/exutils.c                      |    7 +-
 drivers/acpi/acpica/hwesleep.c                     |    4 +-
 drivers/acpi/acpica/hwgpe.c                        |    7 +-
 drivers/acpi/acpica/hwsleep.c                      |    4 +-
 drivers/acpi/acpica/hwxfsleep.c                    |    1 +
 drivers/acpi/acpica/nsconvert.c                    |   18 ++---
 drivers/acpi/acpica/nsdump.c                       |    3 +
 drivers/acpi/acpica/nsload.c                       |    1 -
 drivers/acpi/acpica/nsnames.c                      |    6 +-
 drivers/acpi/acpica/nsparse.c                      |    5 +-
 drivers/acpi/acpica/nsprepkg.c                     |   10 ++-
 drivers/acpi/acpica/nsrepair.c                     |    6 +-
 drivers/acpi/acpica/nsrepair2.c                    |   22 ++++--
 drivers/acpi/acpica/nsutils.c                      |    8 +-
 drivers/acpi/acpica/nsxfeval.c                     |    4 +-
 drivers/acpi/acpica/nsxfname.c                     |    1 +
 drivers/acpi/acpica/nsxfobj.c                      |    6 +-
 drivers/acpi/acpica/psargs.c                       |    1 +
 drivers/acpi/acpica/psloop.c                       |    4 +-
 drivers/acpi/acpica/psparse.c                      |    8 +-
 drivers/acpi/acpica/psutils.c                      |    4 +-
 drivers/acpi/acpica/pswalk.c                       |    1 +
 drivers/acpi/acpica/rsaddr.c                       |    4 +-
 drivers/acpi/acpica/rscalc.c                       |   81 ++++++++++----------
 drivers/acpi/acpica/rscreate.c                     |   32 ++++----
 drivers/acpi/acpica/rsdump.c                       |    6 ++
 drivers/acpi/acpica/rslist.c                       |    9 ++-
 drivers/acpi/acpica/rsmisc.c                       |   22 +++---
 drivers/acpi/acpica/rsutils.c                      |   42 +++++-----
 drivers/acpi/acpica/rsxface.c                      |    2 +-
 drivers/acpi/acpica/tbdata.c                       |    1 +
 drivers/acpi/acpica/tbinstal.c                     |    4 +-
 drivers/acpi/acpica/tbprint.c                      |    1 +
 drivers/acpi/acpica/tbutils.c                      |    2 +-
 drivers/acpi/acpica/tbxfload.c                     |    1 +
 drivers/acpi/acpica/utcopy.c                       |   23 +++---
 drivers/acpi/acpica/utdecode.c                     |    3 +-
 drivers/acpi/acpica/utdelete.c                     |    5 +-
 drivers/acpi/acpica/uterror.c                      |   10 +--
 drivers/acpi/acpica/utfileio.c                     |    2 +
 drivers/acpi/acpica/utmath.c                       |   10 ++-
 drivers/acpi/acpica/utmisc.c                       |   11 +--
 drivers/acpi/acpica/utmutex.c                      |    5 +-
 drivers/acpi/acpica/utnonansi.c                    |    4 +-
 drivers/acpi/acpica/utobject.c                     |   20 +++--
 drivers/acpi/acpica/utosi.c                        |   11 +--
 drivers/acpi/acpica/utownerid.c                    |   12 +--
 drivers/acpi/acpica/utpredef.c                     |    6 +-
 drivers/acpi/acpica/utprint.c                      |   15 ++--
 drivers/acpi/acpica/utresrc.c                      |    8 +-
 drivers/acpi/acpica/utstate.c                      |    3 +
 drivers/acpi/acpica/utstring.c                     |    1 +
 drivers/acpi/acpica/uttrack.c                      |   50 ++++++------
 drivers/acpi/acpica/utxface.c                      |    2 -
 drivers/acpi/acpica/utxferror.c                    |    1 +
 drivers/acpi/acpica/utxfmutex.c                    |    6 +-
 tools/power/acpi/common/getopt.c                   |    1 +
 .../acpi/os_specific/service_layers/oslibcfs.c     |    3 +
 tools/power/acpi/tools/acpidump/apfiles.c          |   13 ++++
 100 files changed, 634 insertions(+), 493 deletions(-)
drivers/acpi/acpica/dbstats.c +1 -0
index 4ba0a20..de255d9 100644
@@ -382,6 +382,7 @@ acpi_status acpi_db_display_statistics(char *type_arg)
 				       acpi_gbl_node_type_count[i],
 				       acpi_gbl_obj_type_count[i]);
 		}
+
 		acpi_os_printf("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
 			       acpi_gbl_node_type_count_misc,
 			       acpi_gbl_obj_type_count_misc);
drivers/acpi/acpica/dbutils.c +1 -0
index 86790e0..8c85d85 100644
@@ -173,6 +173,7 @@ void acpi_db_dump_external_object(union acpi_object *obj_desc, u32 level)
 			if (obj_desc->buffer.length > 16) {
 				acpi_os_printf("\n");
 			}
+
 			acpi_ut_debug_dump_buffer(ACPI_CAST_PTR
 						  (u8,
 						   obj_desc->buffer.pointer),
drivers/acpi/acpica/dsargs.c +4 -3
index e2ab59e..76cfced 100644
@@ -194,8 +194,8 @@ acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc)
 	extra_desc = acpi_ns_get_secondary_object(obj_desc);
 	node = obj_desc->buffer_field.node;
 
-	ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname(ACPI_TYPE_BUFFER_FIELD,
-						      node, NULL));
+	ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
+			(ACPI_TYPE_BUFFER_FIELD, node, NULL));
 
 	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
 			  acpi_ut_get_node_name(node)));
@@ -385,7 +385,8 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc)
 	ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
 			(ACPI_TYPE_REGION, node, NULL));
 
-	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n",
+	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+			  "[%4.4s] OpRegion Arg Init at AML %p\n",
 			  acpi_ut_get_node_name(node),
 			  extra_desc->extra.aml_start));
 
drivers/acpi/acpica/dsdebug.c +3 -2
index 309556e..1eb82bd 100644
@@ -161,6 +161,7 @@ acpi_ds_dump_method_stack(acpi_status status,
 	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
 			  "\n**** Exception %s during execution of method ",
 			  acpi_format_exception(status)));
+
 	acpi_ds_print_node_pathname(walk_state->method_node, NULL);
 
 	/* Display stack of executing methods */
@@ -203,8 +204,8 @@ acpi_ds_dump_method_stack(acpi_status status,
 		} else {
 			/*
 			 * This method has called another method
-			 * NOTE: the method call parse subtree is already deleted at this
-			 * point, so we cannot disassemble the method invocation.
+			 * NOTE: the method call parse subtree is already deleted at
+			 * this point, so we cannot disassemble the method invocation.
 			 */
 			ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH,
 					      "Call to method "));
drivers/acpi/acpica/dsfield.c +20 -19
index 37e11a3..6bca0ec 100644
@@ -106,6 +106,7 @@ acpi_ds_create_external_region(acpi_status lookup_status,
 	 * insert the name into the namespace.
 	 */
 	acpi_dm_add_op_to_external_list(op, path, ACPI_TYPE_REGION, 0, 0);
+
 	status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION,
 				ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
 				walk_state, node);
@@ -202,11 +203,10 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
 
 		/* 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);
+		status = acpi_ns_lookup(walk_state->scope_info,
+					arg->common.value.string, ACPI_TYPE_ANY,
+					ACPI_IMODE_LOAD_PASS1, flags,
+					walk_state, &node);
 		if (ACPI_FAILURE(status)) {
 			ACPI_ERROR_NAMESPACE(arg->common.value.string, status);
 			return_ACPI_STATUS(status);
@@ -244,8 +244,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;
@@ -310,8 +310,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
 		switch (arg->common.aml_opcode) {
 		case AML_INT_RESERVEDFIELD_OP:
 
-			position = (u64)info->field_bit_position
-			    + (u64)arg->common.value.size;
+			position = (u64)info->field_bit_position +
+			    (u64)arg->common.value.size;
 
 			if (position > ACPI_UINT32_MAX) {
 				ACPI_ERROR((AE_INFO,
@@ -344,13 +344,13 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
 
 			/* access_attribute (attrib_quick, attrib_byte, etc.) */
 
-			info->attribute =
-			    (u8)((arg->common.value.integer >> 8) & 0xFF);
+			info->attribute = (u8)
+			    ((arg->common.value.integer >> 8) & 0xFF);
 
 			/* access_length (for serial/buffer protocols) */
 
-			info->access_length =
-			    (u8)((arg->common.value.integer >> 16) & 0xFF);
+			info->access_length = (u8)
+			    ((arg->common.value.integer >> 16) & 0xFF);
 			break;
 
 		case AML_INT_CONNECTION_OP:
@@ -425,8 +425,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
 
 			/* Keep track of bit position for the next field */
 
-			position = (u64)info->field_bit_position
-			    + (u64)arg->common.value.size;
+			position = (u64)info->field_bit_position +
+			    (u64)arg->common.value.size;
 
 			if (position > ACPI_UINT32_MAX) {
 				ACPI_ERROR((AE_INFO,
@@ -716,11 +716,12 @@ acpi_ds_create_bank_field(union acpi_parse_object *op,
 
 	/*
 	 * 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)
+	 * 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"?
+	 * 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;
 
drivers/acpi/acpica/dsinit.c +1 -1
index 920f1b1..c1d8af8 100644
@@ -247,7 +247,7 @@ acpi_ds_initialize_objects(u32 table_index,
 	/* Summary of objects initialized */
 
 	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
-			      "Table [%4.4s:%8.8s] (id %.2X) - %4u Objects with %3u Devices, "
+			      "Table [%4.4s: %-8.8s] (id %.2X) - %4u Objects with %3u Devices, "
 			      "%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n",
 			      table->signature, table->oem_table_id, owner_id,
 			      info.object_count, info.device_count,
drivers/acpi/acpica/dsmethod.c +14 -10
index 49ba082..6585e8e 100644
@@ -118,10 +118,9 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
 		return_ACPI_STATUS(AE_NO_MEMORY);
 	}
 
-	status =
-	    acpi_ds_init_aml_walk(walk_state, op, node,
-				  obj_desc->method.aml_start,
-				  obj_desc->method.aml_length, NULL, 0);
+	status = acpi_ds_init_aml_walk(walk_state, op, node,
+				       obj_desc->method.aml_start,
+				       obj_desc->method.aml_length, NULL, 0);
 	if (ACPI_FAILURE(status)) {
 		acpi_ds_delete_walk_state(walk_state);
 		acpi_ps_free_op(op);
@@ -375,7 +374,8 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
 		    && (walk_state->thread->current_sync_level >
 			obj_desc->method.mutex->mutex.sync_level)) {
 			ACPI_ERROR((AE_INFO,
-				    "Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%u)",
+				    "Cannot acquire Mutex for method [%4.4s]"
+				    ", current SyncLevel is too large (%u)",
 				    acpi_ut_get_node_name(method_node),
 				    walk_state->thread->current_sync_level));
 
@@ -512,16 +512,18 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
 
 	/* Init for new method, possibly wait on method mutex */
 
-	status = acpi_ds_begin_method_execution(method_node, obj_desc,
-						this_walk_state);
+	status =
+	    acpi_ds_begin_method_execution(method_node, obj_desc,
+					   this_walk_state);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
 
 	/* Begin method parse/execution. Create a new walk state */
 
-	next_walk_state = acpi_ds_create_walk_state(obj_desc->method.owner_id,
-						    NULL, obj_desc, thread);
+	next_walk_state =
+	    acpi_ds_create_walk_state(obj_desc->method.owner_id, NULL, obj_desc,
+				      thread);
 	if (!next_walk_state) {
 		status = AE_NO_MEMORY;
 		goto cleanup;
@@ -808,7 +810,8 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 		    info_flags & ACPI_METHOD_SERIALIZED_PENDING) {
 			if (walk_state) {
 				ACPI_INFO((AE_INFO,
-					   "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
+					   "Marking method %4.4s as Serialized "
+					   "because of AE_ALREADY_EXISTS error",
 					   walk_state->method_node->name.
 					   ascii));
 			}
@@ -826,6 +829,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 			 */
 			method_desc->method.info_flags &=
 			    ~ACPI_METHOD_SERIALIZED_PENDING;
+
 			method_desc->method.info_flags |=
 			    (ACPI_METHOD_SERIALIZED |
 			     ACPI_METHOD_IGNORE_SYNC_LEVEL);
drivers/acpi/acpica/dsmthdat.c +11 -9
index 2e4c42b..03c44f2 100644
@@ -99,6 +99,7 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state)
 	for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) {
 		ACPI_MOVE_32_TO_32(&walk_state->arguments[i].name,
 				   NAMEOF_ARG_NTE);
+
 		walk_state->arguments[i].name.integer |= (i << 24);
 		walk_state->arguments[i].descriptor_type = ACPI_DESC_TYPE_NAMED;
 		walk_state->arguments[i].type = ACPI_TYPE_ANY;
@@ -201,7 +202,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
 
 	if (!params) {
 		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "No param list passed to method\n"));
+				  "No parameter list passed to method\n"));
 		return_ACPI_STATUS(AE_OK);
 	}
 
@@ -214,9 +215,9 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
 		 * Store the argument in the method/walk descriptor.
 		 * Do not copy the arg in order to implement call by reference
 		 */
-		status = acpi_ds_method_data_set_value(ACPI_REFCLASS_ARG, index,
-						       params[index],
-						       walk_state);
+		status =
+		    acpi_ds_method_data_set_value(ACPI_REFCLASS_ARG, index,
+						  params[index], walk_state);
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
 		}
@@ -610,11 +611,11 @@ acpi_ds_store_object_to_local(u8 type,
 			 * do the indirect store
 			 */
 			if ((ACPI_GET_DESCRIPTOR_TYPE(current_obj_desc) ==
-			     ACPI_DESC_TYPE_OPERAND)
-			    && (current_obj_desc->common.type ==
-				ACPI_TYPE_LOCAL_REFERENCE)
-			    && (current_obj_desc->reference.class ==
-				ACPI_REFCLASS_REFOF)) {
+			     ACPI_DESC_TYPE_OPERAND) &&
+			    (current_obj_desc->common.type ==
+			     ACPI_TYPE_LOCAL_REFERENCE) &&
+			    (current_obj_desc->reference.class ==
+			     ACPI_REFCLASS_REFOF)) {
 				ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
 						  "Arg (%p) is an ObjRef(Node), storing in node %p\n",
 						  new_obj_desc,
@@ -638,6 +639,7 @@ acpi_ds_store_object_to_local(u8 type,
 				if (new_obj_desc != obj_desc) {
 					acpi_ut_remove_reference(new_obj_desc);
 				}
+
 				return_ACPI_STATUS(status);
 			}
 		}
drivers/acpi/acpica/dsobject.c +11 -8
index 2beb7fd..302c91f 100644
@@ -463,10 +463,10 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 						  arg->common.node);
 			}
 		} else {
-			status = acpi_ds_build_internal_object(walk_state, arg,
-							       &obj_desc->
-							       package.
-							       elements[i]);
+			status =
+			    acpi_ds_build_internal_object(walk_state, arg,
+							  &obj_desc->package.
+							  elements[i]);
 		}
 
 		if (*obj_desc_ptr) {
@@ -525,7 +525,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 		}
 
 		ACPI_INFO((AE_INFO,
-			   "Actual Package length (%u) is larger than NumElements field (%u), truncated",
+			   "Actual Package length (%u) is larger than "
+			   "NumElements field (%u), truncated",
 			   i, element_count));
 	} else if (i < element_count) {
 		/*
@@ -533,7 +534,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 		 * Note: this is not an error, the package is padded out with NULLs.
 		 */
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "Package List length (%u) smaller than NumElements count (%u), padded with null elements\n",
+				  "Package List length (%u) smaller than NumElements "
+				  "count (%u), padded with null elements\n",
 				  i, element_count));
 	}
 
@@ -584,8 +586,9 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state,
 
 	/* Build an internal object for the argument(s) */
 
-	status = acpi_ds_build_internal_object(walk_state, op->common.value.arg,
-					       &obj_desc);
+	status =
+	    acpi_ds_build_internal_object(walk_state, op->common.value.arg,
+					  &obj_desc);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
drivers/acpi/acpica/dsopcode.c +12 -9
index 81d7b986..1edd66f 100644
@@ -243,8 +243,9 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
 	 * For field_flags, use LOCK_RULE = 0 (NO_LOCK),
 	 * UPDATE_RULE = 0 (UPDATE_PRESERVE)
 	 */
-	status = acpi_ex_prep_common_field_object(obj_desc, field_flags, 0,
-						  bit_offset, bit_count);
+	status =
+	    acpi_ex_prep_common_field_object(obj_desc, field_flags, 0,
+					     bit_offset, bit_count);
 	if (ACPI_FAILURE(status)) {
 		goto cleanup;
 	}
@@ -330,8 +331,9 @@ acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state,
 
 	/* Resolve the operands */
 
-	status = acpi_ex_resolve_operands(op->common.aml_opcode,
-					  ACPI_WALK_OPERANDS, walk_state);
+	status =
+	    acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
+				     walk_state);
 	if (ACPI_FAILURE(status)) {
 		ACPI_ERROR((AE_INFO, "(%s) bad operand(s), status 0x%X",
 			    acpi_ps_get_opcode_name(op->common.aml_opcode),
@@ -414,8 +416,9 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
 
 	/* Resolve the length and address operands to numbers */
 
-	status = acpi_ex_resolve_operands(op->common.aml_opcode,
-					  ACPI_WALK_OPERANDS, walk_state);
+	status =
+	    acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
+				     walk_state);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
@@ -452,7 +455,6 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
 	/* Now the address and length are valid for this opregion */
 
 	obj_desc->region.flags |= AOPOBJ_DATA_VALID;
-
 	return_ACPI_STATUS(status);
 }
 
@@ -510,8 +512,9 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
 	 * Resolve the Signature string, oem_id string,
 	 * and oem_table_id string operands
 	 */
-	status = acpi_ex_resolve_operands(op->common.aml_opcode,
-					  ACPI_WALK_OPERANDS, walk_state);
+	status =
+	    acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
+				     walk_state);
 	if (ACPI_FAILURE(status)) {
 		goto cleanup;
 	}
drivers/acpi/acpica/dsutils.c +14 -15
index cecba39..fa8e292 100644
@@ -245,9 +245,9 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
 			 * we will use the return value
 			 */
 			if ((walk_state->control_state->common.state ==
-			     ACPI_CONTROL_PREDICATE_EXECUTING)
-			    && (walk_state->control_state->control.
-				predicate_op == op)) {
+			     ACPI_CONTROL_PREDICATE_EXECUTING) &&
+			    (walk_state->control_state->control.predicate_op ==
+			     op)) {
 				goto result_used;
 			}
 			break;
@@ -481,10 +481,9 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
 
 		/* Get the entire name string from the AML stream */
 
-		status =
-		    acpi_ex_get_name_string(ACPI_TYPE_ANY,
-					    arg->common.value.buffer,
-					    &name_string, &name_length);
+		status = acpi_ex_get_name_string(ACPI_TYPE_ANY,
+						 arg->common.value.buffer,
+						 &name_string, &name_length);
 
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
@@ -503,9 +502,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
 		 */
 		if ((walk_state->deferred_node) &&
 		    (walk_state->deferred_node->type == ACPI_TYPE_BUFFER_FIELD)
-		    && (arg_index ==
-			(u32)((walk_state->opcode ==
-			       AML_CREATE_FIELD_OP) ? 3 : 2))) {
+		    && (arg_index == (u32)
+			((walk_state->opcode == AML_CREATE_FIELD_OP) ? 3 : 2))) {
 			obj_desc =
 			    ACPI_CAST_PTR(union acpi_operand_object,
 					  walk_state->deferred_node);
@@ -522,9 +520,10 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
 			op_info =
 			    acpi_ps_get_opcode_info(parent_op->common.
 						    aml_opcode);
-			if ((op_info->flags & AML_NSNODE)
-			    && (parent_op->common.aml_opcode !=
-				AML_INT_METHODCALL_OP)
+
+			if ((op_info->flags & AML_NSNODE) &&
+			    (parent_op->common.aml_opcode !=
+			     AML_INT_METHODCALL_OP)
 			    && (parent_op->common.aml_opcode != AML_REGION_OP)
 			    && (parent_op->common.aml_opcode !=
 				AML_INT_NAMEPATH_OP)) {
@@ -633,8 +632,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
 			return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
 		}
 
-		if ((op_info->flags & AML_HAS_RETVAL)
-		    || (arg->common.flags & ACPI_PARSEOP_IN_STACK)) {
+		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"));
 
drivers/acpi/acpica/dswexec.c +10 -9
index 9cc5761..ed2f1d3 100644
@@ -172,7 +172,8 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
 
 cleanup:
 
-	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
+	ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+			  "Completed a predicate eval=%X Op=%p\n",
 			  walk_state->control_state->common.value,
 			  walk_state->op));
 
@@ -263,8 +264,8 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
 	    (walk_state->control_state->common.state ==
 	     ACPI_CONTROL_CONDITIONAL_EXECUTING)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "Exec predicate Op=%p State=%p\n", op,
-				  walk_state));
+				  "Exec predicate Op=%p State=%p\n",
+				  op, walk_state));
 
 		walk_state->control_state->common.state =
 		    ACPI_CONTROL_PREDICATE_EXECUTING;
@@ -500,9 +501,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 						  "Method Reference in a Package, Op=%p\n",
 						  op));
 
-				op->common.node =
-				    (struct acpi_namespace_node *)op->asl.value.
-				    arg->asl.node;
+				op->common.node = (struct acpi_namespace_node *)
+				    op->asl.value.arg->asl.node;
 				acpi_ut_add_reference(op->asl.value.arg->asl.
 						      node->object);
 				return_ACPI_STATUS(AE_OK);
@@ -584,8 +584,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 				 * Put the Node on the object stack (Contains the ACPI Name
 				 * of this object)
 				 */
-				walk_state->operands[0] =
-				    (void *)op->common.parent->common.node;
+				walk_state->operands[0] = (void *)
+				    op->common.parent->common.node;
 				walk_state->num_operands = 1;
 
 				status = acpi_ds_create_node(walk_state,
@@ -690,7 +690,8 @@ 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));
 
drivers/acpi/acpica/dswload.c +3 -7
index 097188a..b325474 100644
@@ -476,13 +476,9 @@ acpi_status acpi_ds_load1_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),
+						  (acpi_adr_space_type)
+						  ((op->common.value.arg)->
+						   common.value.integer),
 						  walk_state);
 			if (ACPI_FAILURE(status)) {
 				return_ACPI_STATUS(status);
drivers/acpi/acpica/dswload2.c +5 -5
index e2c08cd..8a32153 100644
@@ -598,11 +598,10 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
 				 * Executing a method: initialize the region and unlock
 				 * the interpreter
 				 */
-				status =
-				    acpi_ex_create_region(op->named.data,
-							  op->named.length,
-							  region_space,
-							  walk_state);
+				status = acpi_ex_create_region(op->named.data,
+							       op->named.length,
+							       region_space,
+							       walk_state);
 				if (ACPI_FAILURE(status)) {
 					return_ACPI_STATUS(status);
 				}
@@ -664,6 +663,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
 								  length,
 								  walk_state);
 				}
+
 				walk_state->operands[0] = NULL;
 				walk_state->num_operands = 0;
 
drivers/acpi/acpica/dswscope.c +1 -0
index 43b3ea4..2d7a044 100644
@@ -77,6 +77,7 @@ void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state)
 				  "Popped object type (%s)\n",
 				  acpi_ut_get_type_name(scope_info->common.
 							value)));
+
 		acpi_ut_delete_generic_state(scope_info);
 	}
 }
drivers/acpi/acpica/evgpe.c +1 -1
index ccf7932..112e821 100644
@@ -92,8 +92,8 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info)
 		ACPI_SET_BIT(gpe_register_info->enable_for_run,
 			     (u8)register_bit);
 	}
-	gpe_register_info->enable_mask = gpe_register_info->enable_for_run;
 
+	gpe_register_info->enable_mask = gpe_register_info->enable_for_run;
 	return_ACPI_STATUS(AE_OK);
 }
 
drivers/acpi/acpica/evgpeblk.c +1 -0
index e0f24c5..c00a9f2 100644
@@ -167,6 +167,7 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
 		if (gpe_block->next) {
 			gpe_block->next->previous = gpe_block->previous;
 		}
+
 		acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
 	}
 
drivers/acpi/acpica/evgpeutil.c +1 -0
index 3a958f3..fd5ab90 100644
@@ -346,6 +346,7 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
 					ACPI_FREE(notify);
 					notify = next;
 				}
+
 				gpe_event_info->dispatch.notify_list = NULL;
 				gpe_event_info->flags &=
 				    ~ACPI_GPE_DISPATCH_MASK;
drivers/acpi/acpica/evmisc.c +3 -2
index f7c9dfe..8866f50 100644
@@ -68,6 +68,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context);
 
 u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node)
 {
+
 	switch (node->type) {
 	case ACPI_TYPE_DEVICE:
 	case ACPI_TYPE_PROCESSOR:
@@ -170,8 +171,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
 			  acpi_ut_get_notify_name(notify_value, ACPI_TYPE_ANY),
 			  node));
 
-	status = acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch,
-				 info);
+	status = acpi_os_execute(OSL_NOTIFY_HANDLER,
+				 acpi_ev_notify_dispatch, info);
 	if (ACPI_FAILURE(status)) {
 		acpi_ut_delete_generic_state(info);
 	}
drivers/acpi/acpica/evxface.c +4 -5
index 07d22bf..012b9de 100644
@@ -879,9 +879,8 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 
 	ACPI_FUNCTION_TRACE(acpi_install_gpe_handler);
 
-	status =
-	    acpi_ev_install_gpe_handler(gpe_device, gpe_number, type, FALSE,
-					address, context);
+	status = acpi_ev_install_gpe_handler(gpe_device, gpe_number, type,
+					     FALSE, address, context);
 
 	return_ACPI_STATUS(status);
 }
@@ -914,8 +913,8 @@ acpi_install_gpe_raw_handler(acpi_handle gpe_device,
 
 	ACPI_FUNCTION_TRACE(acpi_install_gpe_raw_handler);
 
-	status = acpi_ev_install_gpe_handler(gpe_device, gpe_number, type, TRUE,
-					     address, context);
+	status = acpi_ev_install_gpe_handler(gpe_device, gpe_number, type,
+					     TRUE, address, context);
 
 	return_ACPI_STATUS(status);
 }
drivers/acpi/acpica/evxfregn.c +1 -0
index f21afba..dbd9f16 100644
@@ -135,6 +135,7 @@ acpi_install_address_space_handler(acpi_handle device,
 		if (!acpi_gbl_reg_methods_executed) {
 
 			/* We will defer execution of the _REG methods for this space */
+
 			goto unlock_and_exit;
 		}
 		break;
drivers/acpi/acpica/exconfig.c +4 -4
index b540913..adcb9c7 100644
@@ -358,8 +358,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 		}
 
 		/*
-		 * If the Region Address and Length have not been previously evaluated,
-		 * evaluate them now and save the results.
+		 * If the Region Address and Length have not been previously
+		 * evaluated, evaluate them now and save the results.
 		 */
 		if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) {
 			status = acpi_ds_get_region_arguments(obj_desc);
@@ -454,8 +454,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 		}
 
 		/*
-		 * Copy the table from the buffer because the buffer could be modified
-		 * or even deleted in the future
+		 * Copy the table from the buffer because the buffer could be
+		 * modified or even deleted in the future
 		 */
 		table = ACPI_ALLOCATE(length);
 		if (!table) {
drivers/acpi/acpica/exconvrt.c +4 -5
index 145de28..73c2e82 100644
@@ -227,8 +227,8 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
 		/* Copy the integer to the buffer, LSB first */
 
 		new_buf = return_desc->buffer.pointer;
-		memcpy(new_buf,
-		       &obj_desc->integer.value, acpi_gbl_integer_byte_width);
+		memcpy(new_buf, &obj_desc->integer.value,
+		       acpi_gbl_integer_byte_width);
 		break;
 
 	case ACPI_TYPE_STRING:
@@ -354,9 +354,8 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width)
 
 			/* Get one hex digit, most significant digits first */
 
-			string[k] =
-			    (u8)acpi_ut_hex_to_ascii_char(integer,
-							  ACPI_MUL_4(j));
+			string[k] = (u8)
+			    acpi_ut_hex_to_ascii_char(integer, ACPI_MUL_4(j));
 			k++;
 		}
 		break;
drivers/acpi/acpica/excreate.c +5 -5
index 95fe464..0f34446 100644
@@ -189,9 +189,9 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state)
 
 	/* Attach object to the Node */
 
-	status =
-	    acpi_ns_attach_object((struct acpi_namespace_node *)walk_state->
-				  operands[0], obj_desc, ACPI_TYPE_EVENT);
+	status = acpi_ns_attach_object((struct acpi_namespace_node *)
+				       walk_state->operands[0], obj_desc,
+				       ACPI_TYPE_EVENT);
 
 cleanup:
 	/*
@@ -493,8 +493,8 @@ acpi_ex_create_method(u8 * aml_start,
 	 * flag, and sync_level for efficiency.
 	 */
 	method_flags = (u8)operand[1]->integer.value;
-	obj_desc->method.param_count =
-	    (u8)(method_flags & AML_METHOD_ARG_COUNT);
+	obj_desc->method.param_count = (u8)
+	    (method_flags & AML_METHOD_ARG_COUNT);
 
 	/*
 	 * Get the sync_level. If method is serialized, a mutex will be
drivers/acpi/acpica/exdebug.c +1 -0
index de92458..665a4b9 100644
@@ -491,6 +491,7 @@ acpi_ex_start_trace_method(struct acpi_namespace_node *method_node,
 			acpi_dbg_layer = acpi_gbl_trace_dbg_layer;
 		}
 	}
+
 	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 
 exit:
drivers/acpi/acpica/exfield.c +42 -32

155 lines not on this page · raw message

drivers/acpi/acpica/exfldio.c +20 -15
index 70b7bbb..0337191 100644
@@ -180,7 +180,8 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
 			 * byte, and a field with Dword access specified.
 			 */
 			ACPI_ERROR((AE_INFO,
-				    "Field [%4.4s] access width (%u bytes) too large for region [%4.4s] (length %u)",
+				    "Field [%4.4s] access width (%u bytes) "
+				    "too large for region [%4.4s] (length %u)",
 				    acpi_ut_get_node_name(obj_desc->
 							  common_field.node),
 				    obj_desc->common_field.access_byte_width,
@@ -194,7 +195,8 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
 		 * exceeds region length, indicate an error
 		 */
 		ACPI_ERROR((AE_INFO,
-			    "Field [%4.4s] Base+Offset+Width %u+%u+%u is beyond end of region [%4.4s] (length %u)",
+			    "Field [%4.4s] Base+Offset+Width %u+%u+%u "
+			    "is beyond end of region [%4.4s] (length %u)",
 			    acpi_ut_get_node_name(obj_desc->common_field.node),
 			    obj_desc->common_field.base_byte_offset,
 			    field_datum_byte_offset,
@@ -638,15 +640,15 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
 
 			ACPI_ERROR((AE_INFO,
 				    "Unknown UpdateRule value: 0x%X",
-				    (obj_desc->common_field.
-				     field_flags &
+				    (obj_desc->common_field.field_flags &
 				     AML_FIELD_UPDATE_RULE_MASK)));
 			return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
 		}
 	}
 
 	ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
-			  "Mask %8.8X%8.8X, DatumOffset %X, Width %X, Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n",
+			  "Mask %8.8X%8.8X, DatumOffset %X, Width %X, "
+			  "Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n",
 			  ACPI_FORMAT_UINT64(mask),
 			  field_datum_byte_offset,
 			  obj_desc->common_field.access_byte_width,
@@ -655,8 +657,9 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
 
 	/* Write the merged value */
 
-	status = acpi_ex_field_datum_io(obj_desc, field_datum_byte_offset,
-					&merged_value, ACPI_WRITE);
+	status =
+	    acpi_ex_field_datum_io(obj_desc, field_datum_byte_offset,
+				   &merged_value, ACPI_WRITE);
 
 	return_ACPI_STATUS(status);
 }
@@ -764,8 +767,9 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
 		/* Get next input datum from the field */
 
 		field_offset += obj_desc->common_field.access_byte_width;
-		status = acpi_ex_field_datum_io(obj_desc, field_offset,
-						&raw_datum, ACPI_READ);
+		status =
+		    acpi_ex_field_datum_io(obj_desc, field_offset, &raw_datum,
+					   ACPI_READ);
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
 		}
@@ -858,6 +862,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
 	new_buffer = NULL;
 	required_length =
 	    ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length);
+
 	/*
 	 * We must have a buffer that is at least as long as the field
 	 * we are writing to. This is because individual fields are
@@ -932,9 +937,9 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
 		/* Write merged datum to the target field */
 
 		merged_datum &= mask;
-		status = acpi_ex_write_with_update_rule(obj_desc, mask,
-							merged_datum,
-							field_offset);
+		status =
+		    acpi_ex_write_with_update_rule(obj_desc, mask, merged_datum,
+						   field_offset);
 		if (ACPI_FAILURE(status)) {
 			goto exit;
 		}
@@ -990,9 +995,9 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
 	/* Write the last datum to the field */
 
 	merged_datum &= mask;
-	status = acpi_ex_write_with_update_rule(obj_desc,
-						mask, merged_datum,
-						field_offset);
+	status =
+	    acpi_ex_write_with_update_rule(obj_desc, mask, merged_datum,
+					   field_offset);
 
 exit:
 	/* Free temporary buffer if we used one */
drivers/acpi/acpica/exmisc.c +6 -4
index d02afec..b5413bb 100644
@@ -267,8 +267,9 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
 
 	case ACPI_TYPE_STRING:
 
-		status = acpi_ex_convert_to_string(operand1, &local_operand1,
-						   ACPI_IMPLICIT_CONVERT_HEX);
+		status =
+		    acpi_ex_convert_to_string(operand1, &local_operand1,
+					      ACPI_IMPLICIT_CONVERT_HEX);
 		break;
 
 	case ACPI_TYPE_BUFFER:
@@ -591,8 +592,9 @@ acpi_ex_do_logical_op(u16 opcode,
 
 	case ACPI_TYPE_STRING:
 
-		status = acpi_ex_convert_to_string(operand1, &local_operand1,
-						   ACPI_IMPLICIT_CONVERT_HEX);
+		status =
+		    acpi_ex_convert_to_string(operand1, &local_operand1,
+					      ACPI_IMPLICIT_CONVERT_HEX);
 		break;
 
 	case ACPI_TYPE_BUFFER:
drivers/acpi/acpica/exnames.c +2 -2
index 20e8781..b2e911a 100644
@@ -164,8 +164,8 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
 	ACPI_FUNCTION_TRACE(ex_name_segment);
 
 	/*
-	 * If first character is a digit, then we know that we aren't looking at a
-	 * valid name segment
+	 * If first character is a digit, then we know that we aren't looking
+	 * at a valid name segment
 	 */
 	char_buf[0] = *aml_address;
 
drivers/acpi/acpica/exoparg1.c +21 -10
index 7793068..bcdf43c 100644
@@ -484,22 +484,26 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
 
 	case AML_TO_DECSTRING_OP:	/* to_decimal_string (Data, Result) */
 
-		status = acpi_ex_convert_to_string(operand[0], &return_desc,
-						   ACPI_EXPLICIT_CONVERT_DECIMAL);
+		status =
+		    acpi_ex_convert_to_string(operand[0], &return_desc,
+					      ACPI_EXPLICIT_CONVERT_DECIMAL);
 		if (return_desc == operand[0]) {
 
 			/* No conversion performed, add ref to handle return value */
+
 			acpi_ut_add_reference(return_desc);
 		}
 		break;
 
 	case AML_TO_HEXSTRING_OP:	/* to_hex_string (Data, Result) */
 
-		status = acpi_ex_convert_to_string(operand[0], &return_desc,
-						   ACPI_EXPLICIT_CONVERT_HEX);
+		status =
+		    acpi_ex_convert_to_string(operand[0], &return_desc,
+					      ACPI_EXPLICIT_CONVERT_HEX);
 		if (return_desc == operand[0]) {
 
 			/* No conversion performed, add ref to handle return value */
+
 			acpi_ut_add_reference(return_desc);
 		}
 		break;
@@ -510,17 +514,20 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
 		if (return_desc == operand[0]) {
 
 			/* No conversion performed, add ref to handle return value */
+
 			acpi_ut_add_reference(return_desc);
 		}
 		break;
 
 	case AML_TO_INTEGER_OP:	/* to_integer (Data, Result) */
 
-		status = acpi_ex_convert_to_integer(operand[0], &return_desc,
-						    ACPI_ANY_BASE);
+		status =
+		    acpi_ex_convert_to_integer(operand[0], &return_desc,
+					       ACPI_ANY_BASE);
 		if (return_desc == operand[0]) {
 
 			/* No conversion performed, add ref to handle return value */
+
 			acpi_ut_add_reference(return_desc);
 		}
 		break;
@@ -713,9 +720,9 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 
 		/* Get the base object */
 
-		status = acpi_ex_resolve_multiple(walk_state,
-						  operand[0], &type,
-						  &temp_desc);
+		status =
+		    acpi_ex_resolve_multiple(walk_state, operand[0], &type,
+					     &temp_desc);
 		if (ACPI_FAILURE(status)) {
 			goto cleanup;
 		}
@@ -759,8 +766,10 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 		default:
 
 			ACPI_ERROR((AE_INFO,
-				    "Operand must be Buffer/Integer/String/Package - 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;
 		}
@@ -981,6 +990,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 						    "Unknown Index TargetType 0x%X in reference object %p",
 						    operand[0]->reference.
 						    target_type, operand[0]));
+
 					status = AE_AML_OPERAND_TYPE;
 					goto cleanup;
 				}
@@ -1050,6 +1060,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 
 		ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
 			    walk_state->opcode));
+
 		status = AE_AML_BAD_OPCODE;
 		goto cleanup;
 	}
drivers/acpi/acpica/exoparg2.c +8 -4
index b8944eb..6dad2ca 100644
@@ -199,6 +199,7 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state)
 
 		ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
 			    walk_state->opcode));
+
 		status = AE_AML_BAD_OPCODE;
 		goto cleanup;
 	}
@@ -299,8 +300,9 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 
 	case AML_CONCAT_OP:	/* Concatenate (Data1, Data2, Result) */
 
-		status = acpi_ex_do_concatenate(operand[0], operand[1],
-						&return_desc, walk_state);
+		status =
+		    acpi_ex_do_concatenate(operand[0], operand[1], &return_desc,
+					   walk_state);
 		break;
 
 	case AML_TO_STRING_OP:	/* to_string (Buffer, Length, Result) (ACPI 2.0) */
@@ -345,8 +347,9 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
 
 		/* concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */
 
-		status = acpi_ex_concat_template(operand[0], operand[1],
-						 &return_desc, walk_state);
+		status =
+		    acpi_ex_concat_template(operand[0], operand[1],
+					    &return_desc, walk_state);
 		break;
 
 	case AML_INDEX_OP:	/* Index (Source Index Result) */
@@ -553,6 +556,7 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
 
 		ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
 			    walk_state->opcode));
+
 		status = AE_AML_BAD_OPCODE;
 		goto cleanup;
 	}
drivers/acpi/acpica/exoparg3.c +11 -8
index 351b82a..27fb017 100644
@@ -95,7 +95,8 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
 	case AML_FATAL_OP:	/* Fatal (fatal_type fatal_code fatal_arg) */
 
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
+				  "FatalOp: Type %X Code %X Arg %X "
+				  "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
 				  (u32)operand[0]->integer.value,
 				  (u32)operand[1]->integer.value,
 				  (u32)operand[2]->integer.value));
@@ -131,6 +132,7 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
 
 		ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
 			    walk_state->opcode));
+
 		status = AE_AML_BAD_OPCODE;
 		goto cleanup;
 	}
@@ -193,7 +195,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
 		/* Truncate request if larger than the actual String/Buffer */
 
 		else if ((index + length) > operand[0]->string.length) {
-			length = (acpi_size) operand[0]->string.length -
+			length =
+			    (acpi_size) operand[0]->string.length -
 			    (acpi_size) index;
 		}
 
@@ -237,8 +240,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
 
 			/* We have a buffer, copy the portion requested */
 
-			memcpy(buffer, operand[0]->string.pointer + index,
-			       length);
+			memcpy(buffer,
+			       operand[0]->string.pointer + index, length);
 		}
 
 		/* Set the length of the new String/Buffer */
@@ -255,6 +258,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
 
 		ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
 			    walk_state->opcode));
+
 		status = AE_AML_BAD_OPCODE;
 		goto cleanup;
 	}
@@ -270,12 +274,11 @@ cleanup:
 	if (ACPI_FAILURE(status) || walk_state->result_obj) {
 		acpi_ut_remove_reference(return_desc);
 		walk_state->result_obj = NULL;
-	}
+	} else {
+		/* Set the return object and exit */
 
-	/* Set the return object and exit */
-
-	else {
 		walk_state->result_obj = return_desc;
 	}
+
 	return_ACPI_STATUS(status);
 }
drivers/acpi/acpica/exoparg6.c +1 -0
index c930edd..7efc9f4 100644
@@ -310,6 +310,7 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
 
 		ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
 			    walk_state->opcode));
+
 		status = AE_AML_BAD_OPCODE;
 		goto cleanup;
 	}
drivers/acpi/acpica/exprep.c +16 -9
index 4c2836d..1f111cc 100644
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
+ * Module Name: exprep - ACPI AML field prep utilities
  *
  *****************************************************************************/
 
@@ -103,8 +103,10 @@ acpi_ex_generate_access(u32 field_bit_offset,
 	/* Round Field start offset and length to "minimal" byte boundaries */
 
 	field_byte_offset = ACPI_DIV_8(ACPI_ROUND_DOWN(field_bit_offset, 8));
-	field_byte_end_offset = ACPI_DIV_8(ACPI_ROUND_UP(field_bit_length +
-							 field_bit_offset, 8));
+
+	field_byte_end_offset =
+	    ACPI_DIV_8(ACPI_ROUND_UP(field_bit_length + field_bit_offset, 8));
+
 	field_byte_length = field_byte_end_offset - field_byte_offset;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
@@ -159,7 +161,8 @@ acpi_ex_generate_access(u32 field_bit_offset,
 
 			if (accesses <= 1) {
 				ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
-						  "Entire field can be accessed with one operation of size %u\n",
+						  "Entire field can be accessed "
+						  "with one operation of size %u\n",
 						  access_byte_width));
 				return_VALUE(access_byte_width);
 			}
@@ -202,6 +205,7 @@ acpi_ex_generate_access(u32 field_bit_offset,
 	 */
 	ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
 			  "Cannot access field in one operation, using width 8\n"));
+
 	return_VALUE(8);
 }
 #endif				/* ACPI_UNDER_DEVELOPMENT */
@@ -281,6 +285,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
 		/* Invalid field access type */
 
 		ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access));
+
 		return_UINT32(0);
 	}
 
@@ -354,8 +359,8 @@ acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc,
 	 * For all other access types (Byte, Word, Dword, Qword), the Bitwidth is
 	 * the same (equivalent) as the byte_alignment.
 	 */
-	access_bit_width = acpi_ex_decode_field_access(obj_desc, field_flags,
-						       &byte_alignment);
+	access_bit_width =
+	    acpi_ex_decode_field_access(obj_desc, field_flags, &byte_alignment);
 	if (!access_bit_width) {
 		return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
 	}
@@ -595,7 +600,8 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
 					  access_byte_width);
 
 		ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
-				  "IndexField: BitOff %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n",
+				  "IndexField: BitOff %X, Off %X, Value %X, "
+				  "Gran %X, Index %p, Data %p\n",
 				  obj_desc->index_field.start_field_bit_offset,
 				  obj_desc->index_field.base_byte_offset,
 				  obj_desc->index_field.value,
@@ -615,8 +621,9 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
 	 * Store the constructed descriptor (obj_desc) into the parent Node,
 	 * preserving the current type of that named_obj.
 	 */
-	status = acpi_ns_attach_object(info->field_node, obj_desc,
-				       acpi_ns_get_type(info->field_node));
+	status =
+	    acpi_ns_attach_object(info->field_node, obj_desc,
+				  acpi_ns_get_type(info->field_node));
 
 	ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
 			  "Set NamedObj %p [%4.4s], ObjDesc %p\n",
drivers/acpi/acpica/exregion.c +8 -5
index b4a5e44..1851a30 100644
@@ -392,7 +392,8 @@ acpi_ex_pci_config_space_handler(u32 function,
 	pci_register = (u16) (u32) address;
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-			  "Pci-Config %u (%u) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
+			  "Pci-Config %u (%u) Seg(%04x) Bus(%04x) "
+			  "Dev(%04x) Func(%04x) Reg(%04x)\n",
 			  function, bit_width, pci_id->segment, pci_id->bus,
 			  pci_id->device, pci_id->function, pci_register));
 
@@ -400,14 +401,16 @@ acpi_ex_pci_config_space_handler(u32 function,
 	case ACPI_READ:
 
 		*value = 0;
-		status = acpi_os_read_pci_configuration(pci_id, pci_register,
-							value, bit_width);
+		status =
+		    acpi_os_read_pci_configuration(pci_id, pci_register, value,
+						   bit_width);
 		break;
 
 	case ACPI_WRITE:
 
-		status = acpi_os_write_pci_configuration(pci_id, pci_register,
-							 *value, bit_width);
+		status =
+		    acpi_os_write_pci_configuration(pci_id, pci_register,
+						    *value, bit_width);
 		break;
 
 	default:
drivers/acpi/acpica/exresnte.c +1 -1
index 1b372ef..6793dcc 100644
@@ -112,7 +112,7 @@ 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
+	 * 1) Device/Thermal objects don't have a "real" subobject, return Node
 	 * 2) Method locals and arguments have a pseudo-Node
 	 * 3) 10/2007: Added method type to assist with Package construction.
 	 */
drivers/acpi/acpica/exresolv.c +5 -5
index a1afe1a..7f9260b 100644
@@ -217,7 +217,8 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
 					 * the package, can't dereference it
 					 */
 					ACPI_ERROR((AE_INFO,
-						    "Attempt to dereference an Index to NULL package element Idx=%p",
+						    "Attempt to dereference an Index to "
+						    "NULL package element Idx=%p",
 						    stack_desc));
 					status = AE_AML_UNINITIALIZED_ELEMENT;
 				}
@@ -361,10 +362,9 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
 
 		if (type == ACPI_TYPE_LOCAL_ALIAS) {
 			type = ((struct acpi_namespace_node *)obj_desc)->type;
-			obj_desc =
-			    acpi_ns_get_attached_object((struct
-							 acpi_namespace_node *)
-							obj_desc);
+			obj_desc = acpi_ns_get_attached_object((struct
+								acpi_namespace_node
+								*)obj_desc);
 		}
 
 		if (!obj_desc) {
drivers/acpi/acpica/exresop.c +24 -19

91 lines not on this page · raw message

drivers/acpi/acpica/exstore.c +10 -7
index c076e91..d3afbcb 100644
@@ -467,7 +467,8 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
 		case ACPI_TYPE_THERMAL:
 
 			ACPI_ERROR((AE_INFO,
-				    "Target must be [Buffer/Integer/String/Reference], found [%s] (%4.4s)",
+				    "Target must be [Buffer/Integer/String/Reference]"
+				    ", found [%s] (%4.4s)",
 				    acpi_ut_get_type_name(node->type),
 				    node->name.ascii));
 
@@ -504,8 +505,9 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
 			 * an implicit conversion, as per the ACPI specification.
 			 * A direct store is performed instead.
 			 */
-			status = acpi_ex_store_direct_to_node(source_desc, node,
-							      walk_state);
+			status =
+			    acpi_ex_store_direct_to_node(source_desc, node,
+							 walk_state);
 			break;
 		}
 
@@ -528,8 +530,9 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
 			 * store has been performed such that the node/object type
 			 * has been changed.
 			 */
-			status = acpi_ns_attach_object(node, new_desc,
-						       new_desc->common.type);
+			status =
+			    acpi_ns_attach_object(node, new_desc,
+						  new_desc->common.type);
 
 			ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
 					  "Store type [%s] into [%s] via Convert/Attach\n",
@@ -563,8 +566,8 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
 		 * operator. (Note, for this default case, all normal
 		 * Store/Target operations exited above with an error).
 		 */
-		status = acpi_ex_store_direct_to_node(source_desc, node,
-						      walk_state);
+		status =
+		    acpi_ex_store_direct_to_node(source_desc, node, walk_state);
 		break;
 	}
 
drivers/acpi/acpica/exstorob.c +4 -3
index e1d4f4d..ad3bc92 100644
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Module Name: exstorob - AML Interpreter object store support, store to object
+ * Module Name: exstorob - AML object store support, store to object
  *
  *****************************************************************************/
 
@@ -203,8 +203,9 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc,
 			ACPI_FREE(target_desc->string.pointer);
 		}
 
-		target_desc->string.pointer = ACPI_ALLOCATE_ZEROED((acpi_size)
-								   length + 1);
+		target_desc->string.pointer =
+		    ACPI_ALLOCATE_ZEROED((acpi_size) length + 1);
+
 		if (!target_desc->string.pointer) {
 			return_ACPI_STATUS(AE_NO_MEMORY);
 		}
drivers/acpi/acpica/exsystem.c +2 -4
index 0545065..7c91c1f 100644
@@ -78,7 +78,6 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
 		/* We must wait, so unlock the interpreter */
 
 		acpi_ex_exit_interpreter();
-
 		status = acpi_os_wait_semaphore(semaphore, 1, timeout);
 
 		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
@@ -124,7 +123,6 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
 		/* We must wait, so unlock the interpreter */
 
 		acpi_ex_exit_interpreter();
-
 		status = acpi_os_acquire_mutex(mutex, timeout);
 
 		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
@@ -169,8 +167,8 @@ acpi_status acpi_ex_system_do_stall(u32 how_long)
 		 * (ACPI specifies 100 usec as max, but this gives some slack in
 		 * order to support existing BIOSs)
 		 */
-		ACPI_ERROR((AE_INFO, "Time parameter is too large (%u)",
-			    how_long));
+		ACPI_ERROR((AE_INFO,
+			    "Time parameter is too large (%u)", how_long));
 		status = AE_AML_OPERAND_VALUE;
 	} else {
 		acpi_os_stall(how_long);
drivers/acpi/acpica/exutils.c +4 -3
index 30c3f46..8ae7634 100644
@@ -167,8 +167,8 @@ u8 acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc)
 	if ((acpi_gbl_integer_byte_width == 4) &&
 	    (obj_desc->integer.value > (u64)ACPI_UINT32_MAX)) {
 		/*
-		 * We are executing in a 32-bit ACPI table.
-		 * Truncate the value to 32 bits by zeroing out the upper 32-bit field
+		 * We are executing in a 32-bit ACPI table. Truncate
+		 * the value to 32 bits by zeroing out the upper 32-bit field
 		 */
 		obj_desc->integer.value &= (u64)ACPI_UINT32_MAX;
 		return (TRUE);
@@ -323,7 +323,8 @@ void acpi_ex_eisa_id_to_string(char *out_string, u64 compressed_id)
 
 	if (compressed_id > ACPI_UINT32_MAX) {
 		ACPI_WARNING((AE_INFO,
-			      "Expected EISAID is larger than 32 bits: 0x%8.8X%8.8X, truncating",
+			      "Expected EISAID is larger than 32 bits: "
+			      "0x%8.8X%8.8X, truncating",
 			      ACPI_FORMAT_UINT64(compressed_id)));
 	}
 
drivers/acpi/acpica/hwesleep.c +2 -2
index e5599f6..d0319a2 100644
@@ -117,8 +117,8 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state)
 
 	/* Clear wake status (WAK_STS) */
 
-	status =
-	    acpi_write((u64)ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status);
+	status = acpi_write((u64)ACPI_X_WAKE_STATUS,
+			    &acpi_gbl_FADT.sleep_status);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
drivers/acpi/acpica/hwgpe.c +3 -4
index da4a923..8272f96 100644
@@ -187,9 +187,8 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
 	 */
 	register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);
 
-	status = acpi_hw_write(register_bit,
-			       &gpe_register_info->status_address);
-
+	status =
+	    acpi_hw_write(register_bit, &gpe_register_info->status_address);
 	return (status);
 }
 
@@ -297,8 +296,8 @@ acpi_hw_gpe_enable_write(u8 enable_mask,
 	acpi_status status;
 
 	gpe_register_info->enable_mask = enable_mask;
-	status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
 
+	status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
 	return (status);
 }
 
drivers/acpi/acpica/hwsleep.c +2 -2
index 7d21cae..ac5b7f7 100644
@@ -80,8 +80,8 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state)
 
 	/* Clear wake status */
 
-	status =
-	    acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
+	status = acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS,
+					 ACPI_CLEAR_STATUS);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
drivers/acpi/acpica/hwxfsleep.c +1 -0
index d62a616..f8af1ab 100644
@@ -286,6 +286,7 @@ acpi_status acpi_enter_sleep_state_s4bios(void)
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
 		}
+
 	} while (!in_value);
 
 	return_ACPI_STATUS(AE_OK);
drivers/acpi/acpica/nsconvert.c +8 -10
index da55a1c..749a189 100644
@@ -96,9 +96,9 @@ acpi_ns_convert_to_integer(union acpi_operand_object *original_object,
 		/* Extract each buffer byte to create the integer */
 
 		for (i = 0; i < original_object->buffer.length; i++) {
-			value |=
-			    ((u64)original_object->buffer.
-			     pointer[i] << (i * 8));
+			value |= ((u64)
+				  original_object->buffer.pointer[i] << (i *
+									 8));
 		}
 		break;
 
@@ -153,10 +153,9 @@ acpi_ns_convert_to_string(union acpi_operand_object *original_object,
 				return (AE_NO_MEMORY);
 			}
 		} else {
-			status =
-			    acpi_ex_convert_to_string(original_object,
-						      &new_object,
-						      ACPI_IMPLICIT_CONVERT_HEX);
+			status = acpi_ex_convert_to_string(original_object,
+							   &new_object,
+							   ACPI_IMPLICIT_CONVERT_HEX);
 			if (ACPI_FAILURE(status)) {
 				return (status);
 			}
@@ -244,9 +243,8 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
 
 		/* String-to-Buffer conversion. Simple data copy */
 
-		new_object =
-		    acpi_ut_create_buffer_object(original_object->string.
-						 length);
+		new_object = acpi_ut_create_buffer_object
+		    (original_object->string.length);
 		if (!new_object) {
 			return (AE_NO_MEMORY);
 		}
drivers/acpi/acpica/nsdump.c +3 -0
index e071956..bc5ff35 100644
@@ -539,11 +539,13 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
 				acpi_os_printf
 				    ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
 				     obj_type);
+
 				bytes_to_dump = 32;
 			} else {
 				acpi_os_printf
 				    ("(Pointer to ACPI Object type %.2X [%s])\n",
 				     obj_type, acpi_ut_get_type_name(obj_type));
+
 				bytes_to_dump =
 				    sizeof(union acpi_operand_object);
 			}
@@ -573,6 +575,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
 			 */
 			bytes_to_dump = obj_desc->string.length;
 			obj_desc = (void *)obj_desc->string.pointer;
+
 			acpi_os_printf("(Buffer/String pointer %p length %X)\n",
 				       obj_desc, bytes_to_dump);
 			ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
drivers/acpi/acpica/nsload.c +0 -1
index 14ab836..c106916 100644
@@ -321,7 +321,6 @@ acpi_status acpi_ns_unload_namespace(acpi_handle handle)
 	/* This function does the real work */
 
 	status = acpi_ns_delete_subtree(handle);
-
 	return_ACPI_STATUS(status);
 }
 #endif
drivers/acpi/acpica/nsnames.c +4 -2
index 8934b4e..521031f 100644
@@ -70,7 +70,6 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
 	ACPI_FUNCTION_TRACE_PTR(ns_get_external_pathname, node);
 
 	name_buffer = acpi_ns_get_normalized_pathname(node, FALSE);
-
 	return_PTR(name_buffer);
 }
 
@@ -93,7 +92,6 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node)
 	ACPI_FUNCTION_ENTRY();
 
 	size = acpi_ns_build_normalized_path(node, NULL, 0, FALSE);
-
 	return (size);
 }
 
@@ -217,6 +215,7 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
 			ACPI_PATH_PUT8(full_path, path_size,
 				       AML_DUAL_NAME_PREFIX, length);
 		}
+
 		ACPI_MOVE_32_TO_32(name, &next_node->name);
 		do_no_trailing = no_trailing;
 		for (i = 0; i < 4; i++) {
@@ -228,8 +227,10 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
 				ACPI_PATH_PUT8(full_path, path_size, c, length);
 			}
 		}
+
 		next_node = next_node->parent;
 	}
+
 	ACPI_PATH_PUT8(full_path, path_size, AML_ROOT_PREFIX, length);
 
 	/* Reverse the path string */
@@ -237,6 +238,7 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
 	if (length <= path_size) {
 		left = full_path;
 		right = full_path + length - 1;
+
 		while (left < right) {
 			c = *left;
 			*left++ = *right;
drivers/acpi/acpica/nsparse.c +3 -2
index 3736d43b..43b45a8 100644
@@ -141,8 +141,8 @@ acpi_ns_one_complete_parse(u32 pass_number,
 
 	/* Parse the AML */
 
-	ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "*PARSE* pass %u parse\n",
-			  pass_number));
+	ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
+			  "*PARSE* pass %u parse\n", pass_number));
 	status = acpi_ps_parse_aml(walk_state);
 
 cleanup:
@@ -181,6 +181,7 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
 	 * 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, start_node);
 	if (ACPI_FAILURE(status)) {
drivers/acpi/acpica/nsprepkg.c +6 -4
index 9bb2519..c05a83b 100644
@@ -233,8 +233,9 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
 
 		/* First element is the (Integer) revision */
 
-		status = acpi_ns_check_object_type(info, elements,
-						   ACPI_RTYPE_INTEGER, 0);
+		status =
+		    acpi_ns_check_object_type(info, elements,
+					      ACPI_RTYPE_INTEGER, 0);
 		if (ACPI_FAILURE(status)) {
 			return (status);
 		}
@@ -252,8 +253,9 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
 
 		/* First element is the (Integer) count of subpackages to follow */
 
-		status = acpi_ns_check_object_type(info, elements,
-						   ACPI_RTYPE_INTEGER, 0);
+		status =
+		    acpi_ns_check_object_type(info, elements,
+					      ACPI_RTYPE_INTEGER, 0);
 		if (ACPI_FAILURE(status)) {
 			return (status);
 		}
drivers/acpi/acpica/nsrepair.c +4 -2
index 77d8103..360e3ab 100644
@@ -366,6 +366,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct
 
 			return (NULL);
 		}
+
 		this_name++;
 	}
 
@@ -521,6 +522,7 @@ acpi_ns_remove_null_elements(struct acpi_evaluate_info *info,
 			*dest = *source;
 			dest++;
 		}
+
 		source++;
 	}
 
@@ -572,8 +574,8 @@ acpi_ns_wrap_with_package(struct acpi_evaluate_info *info,
 	ACPI_FUNCTION_NAME(ns_wrap_with_package);
 
 	/*
-	 * Create the new outer package and populate it. The new package will
-	 * have a single element, the lone sub-object.
+	 * Create the new outer package and populate it. The new
+	 * package will have a single element, the lone sub-object.
 	 */
 	pkg_obj_desc = acpi_ut_create_package_object(1);
 	if (!pkg_obj_desc) {
drivers/acpi/acpica/nsrepair2.c +14 -8
index 7ca8f2b..f6dd2a8 100644
@@ -225,6 +225,7 @@ static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct
 		if (ACPI_COMPARE_NAME(node->name.ascii, this_name->name)) {
 			return (this_name);
 		}
+
 		this_name++;
 	}
 
@@ -301,7 +302,8 @@ acpi_ns_repair_FDE(struct acpi_evaluate_info *info,
 		/* We can only repair if we have exactly 5 BYTEs */
 
 		if (return_object->buffer.length != ACPI_FDE_BYTE_BUFFER_SIZE) {
-			ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
+			ACPI_WARN_PREDEFINED((AE_INFO,
+					      info->full_pathname,
 					      info->node_flags,
 					      "Incorrect return buffer length %u, expected %u",
 					      return_object->buffer.length,
@@ -321,8 +323,8 @@ acpi_ns_repair_FDE(struct acpi_evaluate_info *info,
 		/* Expand each byte to a DWORD */
 
 		byte_buffer = return_object->buffer.pointer;
-		dword_buffer =
-		    ACPI_CAST_PTR(u32, buffer_object->buffer.pointer);
+		dword_buffer = ACPI_CAST_PTR(u32,
+					     buffer_object->buffer.pointer);
 
 		for (i = 0; i < ACPI_FDE_FIELD_COUNT; i++) {
 			*dword_buffer = (u32) *byte_buffer;
@@ -461,7 +463,8 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info,
 		removing = FALSE;
 
 		if ((*outer_elements)->package.count == 0) {
-			ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
+			ACPI_WARN_PREDEFINED((AE_INFO,
+					      info->full_pathname,
 					      info->node_flags,
 					      "SubPackage[%u] - removing entry due to zero count",
 					      i));
@@ -471,7 +474,8 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info,
 
 		obj_desc = (*outer_elements)->package.elements[1];	/* Index1 = Type */
 		if ((u32)obj_desc->integer.value == 0) {
-			ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
+			ACPI_WARN_PREDEFINED((AE_INFO,
+					      info->full_pathname,
 					      info->node_flags,
 					      "SubPackage[%u] - removing entry due to invalid Type(0)",
 					      i));
@@ -538,8 +542,8 @@ acpi_ns_repair_HID(struct acpi_evaluate_info *info,
 	}
 
 	if (return_object->string.length == 0) {
-		ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
-				      info->node_flags,
+		ACPI_WARN_PREDEFINED((AE_INFO,
+				      info->full_pathname, info->node_flags,
 				      "Invalid zero-length _HID or _CID string"));
 
 		/* Return AE_OK anyway, let driver handle it */
@@ -711,7 +715,8 @@ acpi_ns_repair_PSS(struct acpi_evaluate_info *info,
 		obj_desc = elements[1];	/* Index1 = power_dissipation */
 
 		if ((u32)obj_desc->integer.value > previous_value) {
-			ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
+			ACPI_WARN_PREDEFINED((AE_INFO,
+					      info->full_pathname,
 					      info->node_flags,
 					      "SubPackage[%u,%u] - suspicious power dissipation values",
 					      i - 1, i));
@@ -969,6 +974,7 @@ acpi_ns_remove_element(union acpi_operand_object *obj_desc, u32 index)
 			*dest = *source;
 			dest++;
 		}
+
 		source++;
 	}
 
drivers/acpi/acpica/nsutils.c +5 -3
index de325ae..32f1d95 100644
@@ -173,9 +173,10 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)
 	info->fully_qualified = FALSE;
 
 	/*
-	 * For the internal name, the required length is 4 bytes per segment, plus
-	 * 1 each for root_prefix, multi_name_prefix_op, segment count, trailing null
-	 * (which is not really needed, but no there's harm in putting it there)
+	 * For the internal name, the required length is 4 bytes per segment,
+	 * plus 1 each for root_prefix, multi_name_prefix_op, segment count,
+	 * trailing null (which is not really needed, but no there's harm in
+	 * putting it there)
 	 *
 	 * strlen() + 1 covers the first name_seg, which has no path separator
 	 */
@@ -699,6 +700,7 @@ acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
 		if (!prefix_node) {
 			*return_node = acpi_gbl_root_node;
 		}
+
 		return_ACPI_STATUS(AE_OK);
 	}
 
drivers/acpi/acpica/nsxfeval.c +2 -2
index 6ee1e52..429f0d2 100644
@@ -750,8 +750,8 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
 
 	/* We have a valid device, invoke the user function */
 
-	status = info->user_function(obj_handle, nesting_level, info->context,
-				     return_value);
+	status = info->user_function(obj_handle, nesting_level,
+				     info->context, return_value);
 	return (status);
 }
 
drivers/acpi/acpica/nsxfname.c +1 -0
index 138cf5e..c19d86c 100644
@@ -591,6 +591,7 @@ acpi_status acpi_install_method(u8 *buffer)
 	parser_state.aml += acpi_ps_get_opcode_size(opcode);
 	parser_state.pkg_end = acpi_ps_get_next_package_end(&parser_state);
 	path = acpi_ps_get_next_namestring(&parser_state);
+
 	method_flags = *parser_state.aml++;
 	aml_start = parser_state.aml;
 	aml_length = ACPI_PTR_DIFF(parser_state.pkg_end, aml_start);
drivers/acpi/acpica/nsxfobj.c +2 -4
index 7933835..6e1389b 100644
@@ -74,10 +74,8 @@ acpi_status acpi_get_type(acpi_handle handle, acpi_object_type * ret_type)
 		return (AE_BAD_PARAMETER);
 	}
 
-	/*
-	 * Special case for the predefined Root Node
-	 * (return type ANY)
-	 */
+	/* Special case for the predefined Root Node (return type ANY) */
+
 	if (handle == ACPI_ROOT_OBJECT) {
 		*ret_type = ACPI_TYPE_ANY;
 		return (AE_OK);
drivers/acpi/acpica/psargs.c +1 -0
index 29d8b7b..3f0ffee 100644
@@ -733,6 +733,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 		if (!arg) {
 			return_ACPI_STATUS(AE_NO_MEMORY);
 		}
+
 		acpi_ps_get_next_simple_arg(parser_state, arg_type, arg);
 		break;
 
drivers/acpi/acpica/psloop.c +2 -2
index 03ac8c9..c660006 100644
@@ -124,8 +124,8 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
 		/*
 		 * Op is not a constant or string, append each argument to the Op
 		 */
-		while (GET_CURRENT_ARG_TYPE(walk_state->arg_types)
-		       && !walk_state->arg_count) {
+		while (GET_CURRENT_ARG_TYPE(walk_state->arg_types) &&
+		       !walk_state->arg_count) {
 			walk_state->aml = walk_state->parser_state.aml;
 
 			status =
drivers/acpi/acpica/psparse.c +4 -4
index 98001d7..b729d9b 100644
@@ -526,8 +526,8 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
 			}
 
 			/*
-			 * If the transfer to the new method method call worked, a new walk
-			 * state was created -- get it
+			 * If the transfer to the new method method call worked
+			 *, a new walk state was created -- get it
 			 */
 			walk_state = acpi_ds_get_current_walk_state(thread);
 			continue;
@@ -544,8 +544,8 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
 			/* Check for possible multi-thread reentrancy problem */
 
 			if ((status == AE_ALREADY_EXISTS) &&
-			    (!(walk_state->method_desc->method.
-			       info_flags & ACPI_METHOD_SERIALIZED))) {
+			    (!(walk_state->method_desc->method.info_flags &
+			       ACPI_METHOD_SERIALIZED))) {
 				/*
 				 * Method is not serialized and tried to create an object
 				 * twice. The probable cause is that the method cannot
drivers/acpi/acpica/psutils.c +2 -2
index 71d2877..6cb02a2 100644
@@ -175,8 +175,8 @@ void acpi_ps_free_op(union acpi_parse_object *op)
 	ACPI_FUNCTION_NAME(ps_free_op);
 
 	if (op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Free retval op: %p\n",
-				  op));
+		ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
+				  "Free retval op: %p\n", op));
 	}
 
 	if (op->common.flags & ACPI_PARSEOP_GENERIC) {
drivers/acpi/acpica/pswalk.c +1 -0
index ba5f691..f620d43 100644
@@ -99,6 +99,7 @@ void acpi_ps_delete_parse_tree(union acpi_parse_object *subtree_root)
 		if (op == subtree_root) {
 			return_VOID;
 		}
+
 		if (next) {
 			op = next;
 		} else {
drivers/acpi/acpica/rsaddr.c +2 -2
index 66d406e..bdb7e73 100644
@@ -312,8 +312,8 @@ acpi_rs_get_address_common(struct acpi_resource *resource,
 
 	/* Validate the Resource Type */
 
-	if ((aml->address.resource_type > 2)
-	    && (aml->address.resource_type < 0xC0)) {
+	if ((aml->address.resource_type > 2) &&
+	    (aml->address.resource_type < 0xC0)) {
 		return (FALSE);
 	}
 
drivers/acpi/acpica/rscalc.c +42 -39

125 lines not on this page · raw message

drivers/acpi/acpica/rscreate.c +15 -17
index a534442..603e544 100644
@@ -81,8 +81,9 @@ acpi_buffer_to_resource(u8 *aml_buffer,
 
 	/* Get the required length for the converted resource */
 
-	status = acpi_rs_get_list_length(aml_buffer, aml_buffer_length,
-					 &list_size_needed);
+	status =
+	    acpi_rs_get_list_length(aml_buffer, aml_buffer_length,
+				    &list_size_needed);
 	if (status == AE_AML_NO_RESOURCE_END_TAG) {
 		status = AE_OK;
 	}
@@ -232,8 +233,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
 
 	/* Get the required buffer length */
 
-	status = acpi_rs_get_pci_routing_table_length(package_object,
-						      &buffer_size_needed);
+	status =
+	    acpi_rs_get_pci_routing_table_length(package_object,
+						 &buffer_size_needed);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
@@ -270,9 +272,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
 		user_prt = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
 
 		/*
-		 * Fill in the Length field with the information we have at this point.
-		 * The minus four is to subtract the size of the u8 Source[4] member
-		 * because it is added below.
+		 * Fill in the Length field with the information we have at this
+		 * point. The minus four is to subtract the size of the u8
+		 * Source[4] member because it is added below.
 		 */
 		user_prt->length = (sizeof(struct acpi_pci_routing_table) - 4);
 
@@ -345,11 +347,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
 					   (u8 *) output_buffer->pointer);
 				path_buffer.pointer = user_prt->source;
 
-				status =
-				    acpi_ns_handle_to_pathname((acpi_handle)
-							       node,
-							       &path_buffer,
-							       FALSE);
+				status = acpi_ns_handle_to_pathname((acpi_handle) node, &path_buffer, FALSE);
 
 				/* +1 to include null terminator */
 
@@ -371,8 +369,8 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
 
 			case ACPI_TYPE_INTEGER:
 				/*
-				 * If this is a number, then the Source Name is NULL, since the
-				 * entire buffer was zeroed out, we can leave this alone.
+				 * If this is a number, then the Source Name is NULL, since
+				 * the entire buffer was zeroed out, we can leave this alone.
 				 *
 				 * Add to the Length field the length of the u32 NULL
 				 */
@@ -451,9 +449,9 @@ acpi_rs_create_aml_resources(struct acpi_buffer *resource_list,
 
 	/* Get the buffer size needed for the AML byte stream */
 
-	status = acpi_rs_get_aml_length(resource_list->pointer,
-					resource_list->length,
-					&aml_size_needed);
+	status =
+	    acpi_rs_get_aml_length(resource_list->pointer,
+				   resource_list->length, &aml_size_needed);
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
 			  (u32)aml_size_needed, acpi_format_exception(status)));
drivers/acpi/acpica/rsdump.c +6 -0
index 2a09288..05cc560 100644
@@ -483,6 +483,7 @@ static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
 
 static void acpi_rs_out_string(char *title, char *value)
 {
+
 	acpi_os_printf("%27s : %s", title, value);
 	if (!*value) {
 		acpi_os_printf("[NULL NAMESTRING]");
@@ -497,21 +498,25 @@ static void acpi_rs_out_integer8(char *title, u8 value)
 
 static void acpi_rs_out_integer16(char *title, u16 value)
 {
+
 	acpi_os_printf("%27s : %4.4X\n", title, value);
 }
 
 static void acpi_rs_out_integer32(char *title, u32 value)
 {
+
 	acpi_os_printf("%27s : %8.8X\n", title, value);
 }
 
 static void acpi_rs_out_integer64(char *title, u64 value)
 {
+
 	acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
 }
 
 static void acpi_rs_out_title(char *title)
 {
+
 	acpi_os_printf("%27s : ", title);
 }
 
@@ -544,6 +549,7 @@ static void acpi_rs_dump_short_byte_list(u8 length, u8 * data)
 	for (i = 0; i < length; i++) {
 		acpi_os_printf("%X ", data[i]);
 	}
+
 	acpi_os_printf("\n");
 }
 
drivers/acpi/acpica/rslist.c +5 -4
index 50d5be2..286ccb461 100644
@@ -89,6 +89,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
 	/* Get the appropriate conversion info table */
 
 	aml_resource = ACPI_CAST_PTR(union aml_resource, aml);
+
 	if (acpi_ut_get_resource_type(aml) == ACPI_RESOURCE_NAME_SERIAL_BUS) {
 		if (aml_resource->common_serial_bus.type >
 		    AML_RESOURCE_MAX_SERIALBUSTYPE) {
@@ -225,10 +226,10 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
 
 		/* Perform final sanity check on the new AML resource descriptor */
 
-		status = acpi_ut_validate_resource(NULL,
-						   ACPI_CAST_PTR(union
-								 aml_resource,
-								 aml), NULL);
+		status =
+		    acpi_ut_validate_resource(NULL,
+					      ACPI_CAST_PTR(union aml_resource,
+							    aml), NULL);
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
 		}
drivers/acpi/acpica/rsmisc.c +10 -12
index b528ed90..b112c7b 100644
@@ -189,8 +189,8 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 			item_count = ACPI_GET8(source);
 			ACPI_SET8(destination, item_count);
 
-			resource->length = resource->length +
-			    (info->value * item_count);
+			resource->length =
+			    resource->length + (info->value * item_count);
 			break;
 
 		case ACPI_RSC_COUNT_GPIO_RES:
@@ -445,8 +445,8 @@ exit:
 
 		/* Round the resource struct length up to the next boundary (32 or 64) */
 
-		resource->length =
-		    (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(resource->length);
+		resource->length = (u32)
+		    ACPI_ROUND_UP_TO_NATIVE_WORD(resource->length);
 	}
 	return_ACPI_STATUS(AE_OK);
 }
@@ -550,9 +550,8 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			item_count = ACPI_GET8(source);
 			ACPI_SET8(destination, item_count);
 
-			aml_length =
-			    (u16)(aml_length +
-				  (info->value * (item_count - 1)));
+			aml_length = (u16)
+			    (aml_length + (info->value * (item_count - 1)));
 			break;
 
 		case ACPI_RSC_COUNT16:
@@ -723,11 +722,10 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
 			/*
 			 * 16-bit encoded bitmask (IRQ macro)
 			 */
-			temp16 = acpi_rs_encode_bitmask(source,
-							*ACPI_ADD_PTR(u8,
-								      resource,
-								      info->
-								      value));
+			temp16 =
+			    acpi_rs_encode_bitmask(source,
+						   *ACPI_ADD_PTR(u8, resource,
+								 info->value));
 			ACPI_MOVE_16_TO_16(destination, &temp16);
 			break;
 
drivers/acpi/acpica/rsutils.c +23 -19

91 lines not on this page · raw message

drivers/acpi/acpica/rsxface.c +1 -1
index 1e8cd57..308bfd6 100644
@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("rsxface")
 
 /* Local macros for 16,32-bit to 64-bit conversion */
 #define ACPI_COPY_FIELD(out, in, field)  ((out)->field = (in)->field)
-#define ACPI_COPY_ADDRESS(out, in)                      \
+#define ACPI_COPY_ADDRESS(out, in)                       \
 	ACPI_COPY_FIELD(out, in, resource_type);             \
 	ACPI_COPY_FIELD(out, in, producer_consumer);         \
 	ACPI_COPY_FIELD(out, in, decode);                    \
drivers/acpi/acpica/tbdata.c +1 -0
index 5c9d5ab..4a81527 100644
@@ -407,6 +407,7 @@ acpi_tb_verify_temp_table(struct acpi_table_desc * table_desc, char *signature)
 					table_desc->signature.ascii : "????",
 					ACPI_FORMAT_UINT64(table_desc->
 							   address)));
+
 			goto invalidate_and_exit;
 		}
 	}
drivers/acpi/acpica/tbinstal.c +2 -2
index 6319b42..bd87801 100644
@@ -337,8 +337,8 @@ acpi_tb_install_standard_table(acpi_physical_address address,
 			 * need to be unregistered when they are unloaded, and slots in the
 			 * root table list should be reused when empty.
 			 */
-			if (acpi_gbl_root_table_list.tables[i].
-			    flags & ACPI_TABLE_IS_LOADED) {
+			if (acpi_gbl_root_table_list.tables[i].flags &
+			    ACPI_TABLE_IS_LOADED) {
 
 				/* Table is still loaded, this is an error */
 
drivers/acpi/acpica/tbprint.c +1 -0
index 709d511..d0d1259 100644
@@ -76,6 +76,7 @@ static void acpi_tb_fix_string(char *string, acpi_size length)
 		if (!isprint((int)*string)) {
 			*string = '?';
 		}
+
 		string++;
 		length--;
 	}
drivers/acpi/acpica/tbutils.c +1 -1
index d8ddef3..72bcccf 100644
@@ -121,6 +121,7 @@ void acpi_tb_check_dsdt_header(void)
 		ACPI_BIOS_ERROR((AE_INFO,
 				 "The DSDT has been corrupted or replaced - "
 				 "old, new headers below"));
+
 		acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header);
 		acpi_tb_print_table_header(0, acpi_gbl_DSDT);
 
@@ -379,7 +380,6 @@ next_table:
 	}
 
 	acpi_os_unmap_memory(table, length);
-
 	return_ACPI_STATUS(AE_OK);
 }
 
drivers/acpi/acpica/tbxfload.c +1 -0
index 55ee14c..9a7d72b 100644
@@ -191,6 +191,7 @@ acpi_status acpi_tb_load_namespace(void)
 					"(%4.4s:%8.8s) while loading table",
 					table->signature.ascii,
 					table->pointer->oem_table_id));
+
 			tables_failed++;
 
 			ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
drivers/acpi/acpica/utcopy.c +11 -12
index 257221d..ade8acf 100644
@@ -257,9 +257,9 @@ acpi_ut_copy_ielement_to_eelement(u8 object_type,
 	ACPI_FUNCTION_ENTRY();
 
 	this_index = state->pkg.index;
-	target_object = (union acpi_object *)
-	    &((union acpi_object *)(state->pkg.dest_object))->package.
-	    elements[this_index];
+	target_object = (union acpi_object *)&((union acpi_object *)
+					       (state->pkg.dest_object))->
+	    package.elements[this_index];
 
 	switch (object_type) {
 	case ACPI_COPY_TYPE_SIMPLE:
@@ -348,15 +348,15 @@ acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object,
 	 * Free space begins right after the first package
 	 */
 	info.length = ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object));
-	info.free_space =
-	    buffer + ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object));
+	info.free_space = buffer +
+	    ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object));
 	info.object_space = 0;
 	info.num_packages = 1;
 
 	external_object->type = internal_object->common.type;
 	external_object->package.count = internal_object->package.count;
-	external_object->package.elements = ACPI_CAST_PTR(union acpi_object,
-							  info.free_space);
+	external_object->package.elements =
+	    ACPI_CAST_PTR(union acpi_object, info.free_space);
 
 	/*
 	 * Leave room for an array of ACPI_OBJECTS in the buffer
@@ -593,8 +593,8 @@ acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
 	package_elements = package_object->package.elements;
 
 	/*
-	 * Recursive implementation. Probably ok, since nested external packages
-	 * as parameters should be very rare.
+	 * Recursive implementation. Probably ok, since nested external
+	 * packages as parameters should be very rare.
 	 */
 	for (i = 0; i < external_object->package.count; i++) {
 		status =
@@ -649,9 +649,8 @@ acpi_ut_copy_eobject_to_iobject(union acpi_object *external_object,
 		/*
 		 * Build a simple object (no nested objects)
 		 */
-		status =
-		    acpi_ut_copy_esimple_to_isimple(external_object,
-						    internal_object);
+		status = acpi_ut_copy_esimple_to_isimple(external_object,
+							 internal_object);
 	}
 
 	return_ACPI_STATUS(status);
drivers/acpi/acpica/utdecode.c +2 -1
index 7e14400..3533135 100644
@@ -180,7 +180,8 @@ const char *acpi_ut_get_event_name(u32 event_id)
  *
  * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
  * when stored in a table it really means that we have thus far seen no
- * evidence to indicate what type is actually going to be stored for this entry.
+ * evidence to indicate what type is actually going to be stored for this
+ & entry.
  */
 static const char acpi_gbl_bad_type[] = "UNDEFINED";
 
drivers/acpi/acpica/utdelete.c +3 -2
index 1638312..1afd742 100644
@@ -209,6 +209,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
 			acpi_ut_delete_object_desc(object->method.mutex);
 			object->method.mutex = NULL;
 		}
+
 		if (object->method.node) {
 			object->method.node = NULL;
 		}
@@ -515,8 +516,8 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 		}
 
 		/*
-		 * All sub-objects must have their reference count incremented also.
-		 * Different object types have different subobjects.
+		 * All sub-objects must have their reference count incremented
+		 * also. Different object types have different subobjects.
 		 */
 		switch (object->common.type) {
 		case ACPI_TYPE_DEVICE:
drivers/acpi/acpica/uterror.c +5 -5
index 9ef80f2..f93bb90 100644
@@ -217,8 +217,9 @@ acpi_ut_namespace_error(const char *module_name,
 	} else {
 		/* Convert path to external format */
 
-		status = acpi_ns_externalize_name(ACPI_UINT32_MAX,
-						  internal_name, NULL, &name);
+		status =
+		    acpi_ns_externalize_name(ACPI_UINT32_MAX, internal_name,
+					     NULL, &name);
 
 		/* Print target name */
 
@@ -271,9 +272,8 @@ acpi_ut_method_error(const char *module_name,
 	acpi_os_printf(ACPI_MSG_ERROR);
 
 	if (path) {
-		status =
-		    acpi_ns_get_node(prefix_node, path, ACPI_NS_NO_UPSEARCH,
-				     &node);
+		status = acpi_ns_get_node(prefix_node, path,
+					  ACPI_NS_NO_UPSEARCH, &node);
 		if (ACPI_FAILURE(status)) {
 			acpi_os_printf("[Could not get node by pathname]");
 		}
drivers/acpi/acpica/utfileio.c +2 -0
index d435b7b..be49c71 100644
@@ -106,6 +106,7 @@ acpi_ut_check_text_mode_corruption(u8 *table, u32 table_length, u32 file_length)
 
 				pairs++;
 			}
+
 			i++;
 		}
 	}
@@ -125,6 +126,7 @@ acpi_ut_check_text_mode_corruption(u8 *table, u32 table_length, u32 file_length)
 	acpi_os_printf("Table has been corrupted by text mode conversion\n");
 	acpi_os_printf("All LFs (%u) were changed to CR/LF pairs\n", pairs);
 	acpi_os_printf("Table cannot be repaired!\n");
+
 	return (AE_BAD_VALUE);
 }
 
drivers/acpi/acpica/utmath.c +6 -4
index f9ff100..58b5d42 100644
@@ -111,6 +111,7 @@ acpi_ut_short_divide(u64 dividend,
 	 */
 	ACPI_DIV_64_BY_32(0, dividend_ovl.part.hi, divisor,
 			  quotient.part.hi, remainder32);
+
 	ACPI_DIV_64_BY_32(remainder32, dividend_ovl.part.lo, divisor,
 			  quotient.part.lo, remainder32);
 
@@ -179,6 +180,7 @@ acpi_ut_divide(u64 in_dividend,
 		 */
 		ACPI_DIV_64_BY_32(0, dividend.part.hi, divisor.part.lo,
 				  quotient.part.hi, partial1);
+
 		ACPI_DIV_64_BY_32(partial1, dividend.part.lo, divisor.part.lo,
 				  quotient.part.lo, remainder.part.lo);
 	}
@@ -206,12 +208,12 @@ acpi_ut_divide(u64 in_dividend,
 
 		ACPI_DIV_64_BY_32(normalized_dividend.part.hi,
 				  normalized_dividend.part.lo,
-				  normalized_divisor.part.lo,
-				  quotient.part.lo, partial1);
+				  normalized_divisor.part.lo, quotient.part.lo,
+				  partial1);
 
 		/*
-		 * The quotient is always 32 bits, and simply requires adjustment.
-		 * The 64-bit remainder must be generated.
+		 * The quotient is always 32 bits, and simply requires
+		 * adjustment. The 64-bit remainder must be generated.
 		 */
 		partial1 = quotient.part.lo * divisor.part.hi;
 		partial2.full = (u64) quotient.part.lo * divisor.part.lo;
drivers/acpi/acpica/utmisc.c +6 -5
index bd4443b..eab1cfe 100644
@@ -264,8 +264,8 @@ acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
 		 */
 		if ((!this_source_obj) ||
 		    (ACPI_GET_DESCRIPTOR_TYPE(this_source_obj) !=
-		     ACPI_DESC_TYPE_OPERAND)
-		    || (this_source_obj->common.type != ACPI_TYPE_PACKAGE)) {
+		     ACPI_DESC_TYPE_OPERAND) ||
+		    (this_source_obj->common.type != ACPI_TYPE_PACKAGE)) {
 			status =
 			    walk_callback(ACPI_COPY_TYPE_SIMPLE,
 					  this_source_obj, state, context);
@@ -318,9 +318,10 @@ acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
 			 * The callback above returned a new target package object.
 			 */
 			acpi_ut_push_generic_state(&state_list, state);
-			state = acpi_ut_create_pkg_state(this_source_obj,
-							 state->pkg.
-							 this_target_obj, 0);
+			state =
+			    acpi_ut_create_pkg_state(this_source_obj,
+						     state->pkg.this_target_obj,
+						     0);
 			if (!state) {
 
 				/* Free any stacked Update State objects */
drivers/acpi/acpica/utmutex.c +3 -2
index ea0c207..038ff84 100644
@@ -273,8 +273,9 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
 			  (u32)this_thread_id,
 			  acpi_ut_get_mutex_name(mutex_id)));
 
-	status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex,
-				       ACPI_WAIT_FOREVER);
+	status =
+	    acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex,
+				  ACPI_WAIT_FOREVER);
 	if (ACPI_SUCCESS(status)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
 				  "Thread %u acquired Mutex [%s]\n",
drivers/acpi/acpica/utnonansi.c +2 -2
index 1d5f6b1..9c3cadc 100644
@@ -282,8 +282,8 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer)
 
 		/* Divide the digit into the correct position */
 
-		(void)acpi_ut_short_divide((dividend - (u64)this_digit),
-					   base, &quotient, NULL);
+		(void)acpi_ut_short_divide((dividend - (u64)this_digit), base,
+					   &quotient, NULL);
 
 		if (return_value > quotient) {
 			if (to_integer_op) {
drivers/acpi/acpica/utobject.c +12 -8
index c7e11cc..787eccf 100644
@@ -112,9 +112,9 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char
 
 		/* These types require a secondary object */
 
-		second_object = acpi_ut_allocate_object_desc_dbg(module_name,
-								 line_number,
-								 component_id);
+		second_object =
+		    acpi_ut_allocate_object_desc_dbg(module_name, line_number,
+						     component_id);
 		if (!second_object) {
 			acpi_ut_delete_object_desc(object);
 			return_PTR(NULL);
@@ -254,6 +254,7 @@ union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size)
 		if (!buffer) {
 			ACPI_ERROR((AE_INFO, "Could not allocate size %u",
 				    (u32)buffer_size));
+
 			acpi_ut_remove_reference(buffer_desc);
 			return_PTR(NULL);
 		}
@@ -306,6 +307,7 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size)
 	if (!string) {
 		ACPI_ERROR((AE_INFO, "Could not allocate size %u",
 			    (u32)string_size));
+
 		acpi_ut_remove_reference(string_desc);
 		return_PTR(NULL);
 	}
@@ -649,8 +651,9 @@ acpi_ut_get_package_object_size(union acpi_operand_object *internal_object,
 	info.object_space = 0;
 	info.num_packages = 1;
 
-	status = acpi_ut_walk_package_tree(internal_object, NULL,
-					   acpi_ut_get_element_length, &info);
+	status =
+	    acpi_ut_walk_package_tree(internal_object, NULL,
+				      acpi_ut_get_element_length, &info);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
@@ -660,7 +663,8 @@ acpi_ut_get_package_object_size(union acpi_operand_object *internal_object,
 	 * just add the length of the package objects themselves.
 	 * Round up to the next machine word.
 	 */
-	info.length += ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)) *
+	info.length +=
+	    ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)) *
 	    (acpi_size) info.num_packages;
 
 	/* Return the total package length */
@@ -692,8 +696,8 @@ acpi_ut_get_object_size(union acpi_operand_object *internal_object,
 	ACPI_FUNCTION_ENTRY();
 
 	if ((ACPI_GET_DESCRIPTOR_TYPE(internal_object) ==
-	     ACPI_DESC_TYPE_OPERAND)
-	    && (internal_object->common.type == ACPI_TYPE_PACKAGE)) {
+	     ACPI_DESC_TYPE_OPERAND) &&
+	    (internal_object->common.type == ACPI_TYPE_PACKAGE)) {
 		status =
 		    acpi_ut_get_package_object_size(internal_object,
 						    obj_length);
drivers/acpi/acpica/utosi.c +6 -5
index 8f3d203a..0809d73 100644
@@ -269,9 +269,10 @@ acpi_status acpi_ut_remove_interface(acpi_string interface_name)
 	previous_interface = next_interface = acpi_gbl_supported_interfaces;
 	while (next_interface) {
 		if (!strcmp(interface_name, next_interface->name)) {
-
-			/* Found: name is in either the static list or was added at runtime */
-
+			/*
+			 * Found: name is in either the static list
+			 * or was added at runtime
+			 */
 			if (next_interface->flags & ACPI_OSI_DYNAMIC) {
 
 				/* Interface was added dynamically, remove and free it */
@@ -288,8 +289,8 @@ acpi_status acpi_ut_remove_interface(acpi_string interface_name)
 				ACPI_FREE(next_interface);
 			} else {
 				/*
-				 * Interface is in static list. If marked invalid, then it
-				 * does not actually exist. Else, mark it invalid.
+				 * Interface is in static list. If marked invalid, then
+				 * it does not actually exist. Else, mark it invalid.
 				 */
 				if (next_interface->flags & ACPI_OSI_INVALID) {
 					return (AE_NOT_EXIST);
drivers/acpi/acpica/utownerid.c +6 -6
index 2959217..ebb811c 100644
@@ -73,8 +73,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
 	/* Guard against multiple allocations of ID to the same location */
 
 	if (*owner_id) {
-		ACPI_ERROR((AE_INFO, "Owner ID [0x%2.2X] already exists",
-			    *owner_id));
+		ACPI_ERROR((AE_INFO,
+			    "Owner ID [0x%2.2X] already exists", *owner_id));
 		return_ACPI_STATUS(AE_ALREADY_EXISTS);
 	}
 
@@ -87,8 +87,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
 
 	/*
 	 * Find a free owner ID, cycle through all possible IDs on repeated
-	 * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index may have
-	 * to be scanned twice.
+	 * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index
+	 * may have to be scanned twice.
 	 */
 	for (i = 0, j = acpi_gbl_last_owner_id_index;
 	     i < (ACPI_NUM_OWNERID_MASKS + 1); i++, j++) {
@@ -141,8 +141,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
 	 * they are released when a table is unloaded or a method completes
 	 * execution.
 	 *
-	 * If this error happens, there may be very deep nesting of invoked control
-	 * methods, or there may be a bug where the IDs are not released.
+	 * If this error happens, there may be very deep nesting of invoked
+	 * control methods, or there may be a bug where the IDs are not released.
 	 */
 	status = AE_OWNER_ID_LIMIT;
 	ACPI_ERROR((AE_INFO,
drivers/acpi/acpica/utpredef.c +4 -2
index 97898ed..9f8e415 100644
@@ -225,8 +225,10 @@ const union acpi_predefined_info *acpi_ut_match_resource_name(char *name)
 {
 	const union acpi_predefined_info *this_name;
 
-	/* Quick check for a predefined name, first character must be underscore */
-
+	/*
+	 * Quick check for a predefined name, first character must
+	 * be underscore
+	 */
 	if (name[0] != '_') {
 		return (NULL);
 	}
drivers/acpi/acpica/utprint.c +10 -5
index b26297c..01f04da 100644
@@ -314,8 +314,9 @@ static char *acpi_ut_format_number(char *string,
 	if (need_prefix) {
 		string = acpi_ut_bound_string_output(string, end, '0');
 		if (base == 16) {
-			string = acpi_ut_bound_string_output(string, end,
-							     upper ? 'X' : 'x');
+			string =
+			    acpi_ut_bound_string_output(string, end,
+							upper ? 'X' : 'x');
 		}
 	}
 	if (!(type & ACPI_FORMAT_LEFT)) {
@@ -400,6 +401,7 @@ acpi_ut_vsnprintf(char *string,
 			} else {
 				break;
 			}
+
 		} while (1);
 
 		/* Process width */
@@ -429,6 +431,7 @@ acpi_ut_vsnprintf(char *string,
 				++format;
 				precision = va_arg(args, int);
 			}
+
 			if (precision < 0) {
 				precision = 0;
 			}
@@ -488,10 +491,12 @@ acpi_ut_vsnprintf(char *string,
 									' ');
 				}
 			}
+
 			for (i = 0; i < length; ++i) {
 				pos = acpi_ut_bound_string_output(pos, end, *s);
 				++s;
 			}
+
 			while (length < width--) {
 				pos =
 				    acpi_ut_bound_string_output(pos, end, ' ');
@@ -529,9 +534,9 @@ acpi_ut_vsnprintf(char *string,
 			}
 
 			p = va_arg(args, void *);
-			pos = acpi_ut_format_number(pos, end,
-						    ACPI_TO_INTEGER(p), 16,
-						    width, precision, type);
+			pos =
+			    acpi_ut_format_number(pos, end, ACPI_TO_INTEGER(p),
+						  16, width, precision, type);
 			continue;
 
 		default:
drivers/acpi/acpica/utresrc.c +4 -4
index b3505db..d50b41c 100644
@@ -441,8 +441,8 @@ acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
 		    acpi_ut_validate_resource(walk_state, aml, &resource_index);
 		if (ACPI_FAILURE(status)) {
 			/*
-			 * Exit on failure. Cannot continue because the descriptor length
-			 * may be bogus also.
+			 * Exit on failure. Cannot continue because the descriptor
+			 * length may be bogus also.
 			 */
 			return_ACPI_STATUS(status);
 		}
@@ -568,8 +568,8 @@ acpi_ut_validate_resource(struct acpi_walk_state *walk_state,
 	}
 
 	/*
-	 * Check validity of the resource type, via acpi_gbl_resource_types. Zero
-	 * indicates an invalid resource.
+	 * Check validity of the resource type, via acpi_gbl_resource_types.
+	 * Zero indicates an invalid resource.
 	 */
 	if (!acpi_gbl_resource_types[resource_index]) {
 		goto invalid_resource;
drivers/acpi/acpica/utstate.c +3 -0
index f201171..0050e00 100644
@@ -246,6 +246,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
 	state->pkg.dest_object = external_object;
 	state->pkg.index = index;
 	state->pkg.num_packages = 1;
+
 	return (state);
 }
 
@@ -279,6 +280,7 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
 
 	state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL;
 	state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
+
 	return (state);
 }
 
@@ -304,5 +306,6 @@ void acpi_ut_delete_generic_state(union acpi_generic_state *state)
 	if (state) {
 		(void)acpi_os_release_object(acpi_gbl_state_cache, state);
 	}
+
 	return;
 }
drivers/acpi/acpica/utstring.c +1 -0
index 4ddd105..0c2e2d2 100644
@@ -135,6 +135,7 @@ void acpi_ut_print_string(char *string, u16 max_length)
 			break;
 		}
 	}
+
 	acpi_os_printf("\"");
 
 	if (i == max_length && string[i]) {
drivers/acpi/acpica/uttrack.c +26 -24

90 lines not on this page · raw message

drivers/acpi/acpica/utxface.c +0 -2
index f9c8f9c..9f3f0a1 100644
@@ -154,7 +154,6 @@ acpi_status acpi_get_system_info(struct acpi_buffer * out_buffer)
 	 * Populate the return buffer
 	 */
 	info_ptr = (struct acpi_system_info *)out_buffer->pointer;
-
 	info_ptr->acpi_ca_version = ACPI_CA_VERSION;
 
 	/* System flags (ACPI capabilities) */
@@ -216,7 +215,6 @@ acpi_status acpi_get_statistics(struct acpi_statistics *stats)
 	/* Other counters */
 
 	stats->method_count = acpi_method_count;
-
 	return_ACPI_STATUS(AE_OK);
 }
 
drivers/acpi/acpica/utxferror.c +1 -0
index 98d5787..f6cbaf4 100644
@@ -117,6 +117,7 @@ acpi_exception(const char *module_name,
 		acpi_os_printf(ACPI_MSG_EXCEPTION "%s, ",
 			       acpi_format_exception(status));
 	}
+
 	va_start(arg_list, format);
 	acpi_os_vprintf(format, arg_list);
 	ACPI_MSG_SUFFIX;
drivers/acpi/acpica/utxfmutex.c +3 -3
index f2606af..95d6123 100644
@@ -89,9 +89,9 @@ acpi_ut_get_mutex_object(acpi_handle handle,
 
 	mutex_node = handle;
 	if (pathname != NULL) {
-		status = acpi_get_handle(handle, pathname,
-					 ACPI_CAST_PTR(acpi_handle,
-						       &mutex_node));
+		status =
+		    acpi_get_handle(handle, pathname,
+				    ACPI_CAST_PTR(acpi_handle, &mutex_node));
 		if (ACPI_FAILURE(status)) {
 			return (status);
 		}
tools/power/acpi/common/getopt.c +1 -0
index 326e826..2496629 100644
@@ -85,6 +85,7 @@ static int current_char_ptr = 1;
 
 int acpi_getopt_argument(int argc, char **argv)
 {
+
 	acpi_gbl_optind--;
 	current_char_ptr++;
 
tools/power/acpi/os_specific/service_layers/oslibcfs.c +3 -0
index b51e40a..6df7583 100644
@@ -73,6 +73,7 @@ ACPI_FILE acpi_os_open_file(const char *path, u8 modes)
 	if (modes & ACPI_FILE_WRITING) {
 		modes_str[i++] = 'w';
 	}
+
 	if (modes & ACPI_FILE_BINARY) {
 		modes_str[i++] = 'b';
 	}
@@ -101,6 +102,7 @@ ACPI_FILE acpi_os_open_file(const char *path, u8 modes)
 
 void acpi_os_close_file(ACPI_FILE file)
 {
+
 	fclose(file);
 }
 
@@ -202,6 +204,7 @@ acpi_status acpi_os_set_file_offset(ACPI_FILE file, long offset, u8 from)
 	if (from == ACPI_FILE_BEGIN) {
 		ret = fseek(file, offset, SEEK_SET);
 	}
+
 	if (from == ACPI_FILE_END) {
 		ret = fseek(file, offset, SEEK_END);
 	}
tools/power/acpi/tools/acpidump/apfiles.c +13 -0
index a1c62de..bbdf9e8 100644
@@ -48,6 +48,18 @@
 
 static int ap_is_existing_file(char *pathname);
 
+/******************************************************************************
+ *
+ * FUNCTION:    ap_is_existing_file
+ *
+ * PARAMETERS:  pathname            - Output filename
+ *
+ * RETURN:      0 on success
+ *
+ * DESCRIPTION: Query for file overwrite if it already exists.
+ *
+ ******************************************************************************/
+
 static int ap_is_existing_file(char *pathname)
 {
 #ifndef _GNU_EFI
@@ -136,6 +148,7 @@ int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance)
 	} else {
 		ACPI_MOVE_NAME(filename, table->signature);
 	}
+
 	filename[0] = (char)tolower((int)filename[0]);
 	filename[1] = (char)tolower((int)filename[1]);
 	filename[2] = (char)tolower((int)filename[2]);
Signature · 1 line
1.7.10
author
#9 lore raw

PATCH 9/42 ACPICA: Split interpreter tracing functions to a new file

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit a3f85a7d26a52ee0d9103feb4fbec8d7b6ba4c11

Split out functions from exdebug.c to extrace.c

---
 drivers/acpi/acpica/Makefile  |    3 +-
 drivers/acpi/acpica/exdebug.c |  325 -----------------------------------
 drivers/acpi/acpica/extrace.c |  377 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 379 insertions(+), 326 deletions(-)
 create mode 100644 drivers/acpi/acpica/extrace.c
drivers/acpi/acpica/Makefile +2 -1
index 885936f..e75f401 100644
@@ -50,6 +50,7 @@ acpi-y +=		\
 	exdump.o	\
 	exfield.o	\
 	exfldio.o	\
+	exmisc.o	\
 	exmutex.o	\
 	exnames.o	\
 	exoparg1.o	\
@@ -57,7 +58,6 @@ acpi-y +=		\
 	exoparg3.o	\
 	exoparg6.o	\
 	exprep.o	\
-	exmisc.o	\
 	exregion.o	\
 	exresnte.o	\
 	exresolv.o	\
@@ -66,6 +66,7 @@ acpi-y +=		\
 	exstoren.o	\
 	exstorob.o	\
 	exsystem.o	\
+	extrace.o	\
 	exutils.o
 
 acpi-y +=		\
drivers/acpi/acpica/exdebug.c +0 -325

345 lines not on this page · raw message

drivers/acpi/acpica/extrace.c new file +377 -0

377 lines not on this page · raw message

Signature · 1 line
1.7.10
author
#10 lore raw

PATCH 10/42 ACPICA: acpiexec: Add support for AML files containing multiple tables

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 301f16e4037275888f65b88aec7231c1cd64339f

Add support for multi-AML-table files that originate from either acpixtract or iASL.

---
 drivers/acpi/acpica/acutils.h  |    4 ++++
 drivers/acpi/acpica/utfileio.c |   23 +++++++++++++++++++++++
 2 files changed, 27 insertions(+)
drivers/acpi/acpica/acutils.h +4 -0
index 7495421..5d3ae91 100644
@@ -356,6 +356,10 @@ acpi_ut_execute_power_methods(struct acpi_namespace_node *device_node,
  * utfileio - file operations
  */
 #ifdef ACPI_APPLICATION
+
+acpi_status
+acpi_ut_read_tables_from_file(FILE * file, struct acpi_table_header **table);
+
 acpi_status
 acpi_ut_read_table_from_file(char *filename, struct acpi_table_header **table);
 #endif
drivers/acpi/acpica/utfileio.c +23 -0
index be49c71..e729486 100644
@@ -292,6 +292,29 @@ acpi_ut_read_table(FILE * fp,
  ******************************************************************************/
 
 acpi_status
+acpi_ut_read_tables_from_file(FILE * file, struct acpi_table_header ** table)
+{
+	struct acpi_table_header table_header;
+	s32 count;
+	long position;
+
+	position = ftell(file);
+	count = fread(&table_header, 1, sizeof(struct acpi_table_header), file);
+	if (count < sizeof(struct acpi_table_header)) {
+		return (AE_CTRL_TERMINATE);
+	}
+
+	/* Allocate a buffer for the table */
+
+	*table = acpi_os_allocate((size_t) table_header.length);
+	fseek(file, position, SEEK_SET);
+
+	count = fread(*table, 1, table_header.length, file);
+
+	return (AE_OK);
+}
+
+acpi_status
 acpi_ut_read_table_from_file(char *filename, struct acpi_table_header ** table)
 {
 	FILE *file;
Signature · 1 line
1.7.10
author
#11 lore raw

PATCH 11/42 ACPICA: Disassembler/tools: Support for multiple ACPI tables in one file

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 5be7dc4d0d69b2953d156f5bc4d3e8a65a390837

Matches the support in iASL and acpi_exec.

---
 drivers/acpi/acpica/Makefile   |    1 -
 drivers/acpi/acpica/acapps.h   |   39 ++---
 drivers/acpi/acpica/acdebug.h  |    5 +-
 drivers/acpi/acpica/aclocal.h  |    7 +
 drivers/acpi/acpica/acutils.h  |   12 --
 drivers/acpi/acpica/dbfileio.c |  123 ++------------
 drivers/acpi/acpica/dbinput.c  |   19 ++-
 drivers/acpi/acpica/tbxfload.c |    2 +-
 drivers/acpi/acpica/utfileio.c |  359 ----------------------------------------
 9 files changed, 53 insertions(+), 514 deletions(-)
 delete mode 100644 drivers/acpi/acpica/utfileio.c
drivers/acpi/acpica/Makefile +0 -1
index e75f401..f682374 100644
@@ -197,7 +197,6 @@ acpi-$(ACPI_FUTURE_USAGE) +=	\
 	dbfileio.o		\
 	dbtest.o		\
 	utcache.o		\
-	utfileio.o		\
 	utprint.o		\
 	uttrack.o		\
 	utuuid.o
drivers/acpi/acpica/acapps.h +14 -25
index e4cc48f..185c2eb 100644
@@ -44,6 +44,8 @@
 #ifndef _ACAPPS
 #define _ACAPPS
 
+#include <stdio.h>
+
 /* Common info for tool signons */
 
 #define ACPICA_NAME                 "Intel ACPI Component Architecture"
@@ -90,6 +92,18 @@
 #define FILE_SUFFIX_DISASSEMBLY     "dsl"
 #define FILE_SUFFIX_BINARY_TABLE    ".dat"	/* Needs the dot */
 
+/* acfileio */
+
+acpi_status
+acpi_ac_get_all_tables_from_file(char *filename,
+				 u8 get_only_aml_tables,
+				 struct acpi_new_table_desc **return_list_head);
+
+/* Values for get_only_aml_tables */
+
+#define ACPI_GET_ONLY_AML_TABLES    TRUE
+#define ACPI_GET_ALL_TABLES         FALSE
+
 /*
  * getopt
  */
@@ -107,30 +121,6 @@ extern char *acpi_gbl_optarg;
  */
 u32 cm_get_file_size(ACPI_FILE file);
 
-#ifndef ACPI_DUMP_APP
-/*
- * adisasm
- */
-acpi_status
-ad_aml_disassemble(u8 out_to_file,
-		   char *filename, char *prefix, char **out_filename);
-
-void ad_print_statistics(void);
-
-acpi_status ad_find_dsdt(u8 **dsdt_ptr, u32 *dsdt_length);
-
-void ad_dump_tables(void);
-
-acpi_status ad_get_local_tables(void);
-
-acpi_status
-ad_parse_table(struct acpi_table_header *table,
-	       acpi_owner_id * owner_id, u8 load_table, u8 external);
-
-acpi_status ad_display_tables(char *filename, struct acpi_table_header *table);
-
-acpi_status ad_display_statistics(void);
-
 /*
  * adwalk
  */
@@ -168,6 +158,5 @@ char *ad_generate_filename(char *prefix, char *table_id);
 void
 ad_write_table(struct acpi_table_header *table,
 	       u32 length, char *table_name, char *oem_table_id);
-#endif
 
 #endif				/* _ACAPPS */
drivers/acpi/acpica/acdebug.h +1 -4
index dcaa15d..ecb05f1 100644
@@ -245,10 +245,7 @@ void acpi_db_open_debug_file(char *name);
 
 acpi_status acpi_db_load_acpi_table(char *filename);
 
-acpi_status
-acpi_db_get_table_from_file(char *filename,
-			    struct acpi_table_header **table,
-			    u8 must_be_aml_table);
+acpi_status acpi_db_load_tables(struct acpi_new_table_desc *list_head);
 
 /*
  * dbhistry - debugger HISTORY command
drivers/acpi/acpica/aclocal.h +7 -0
index e1dd784..4fd5040 100644
@@ -219,6 +219,13 @@ struct acpi_table_list {
 #define ACPI_ROOT_ORIGIN_ALLOCATED      (1)
 #define ACPI_ROOT_ALLOW_RESIZE          (2)
 
+/* List to manage incoming ACPI tables */
+
+struct acpi_new_table_desc {
+	struct acpi_table_header *table;
+	struct acpi_new_table_desc *next;
+};
+
 /* Predefined table indexes */
 
 #define ACPI_INVALID_TABLE_INDEX        (0xFFFFFFFF)
drivers/acpi/acpica/acutils.h +0 -12
index 5d3ae91..6776348 100644
@@ -353,18 +353,6 @@ acpi_ut_execute_power_methods(struct acpi_namespace_node *device_node,
 			      u8 method_count, u8 *out_values);
 
 /*
- * utfileio - file operations
- */
-#ifdef ACPI_APPLICATION
-
-acpi_status
-acpi_ut_read_tables_from_file(FILE * file, struct acpi_table_header **table);
-
-acpi_status
-acpi_ut_read_table_from_file(char *filename, struct acpi_table_header **table);
-#endif
-
-/*
  * utids - device ID support
  */
 acpi_status
drivers/acpi/acpica/dbfileio.c +15 -108

161 lines not on this page · raw message

drivers/acpi/acpica/dbinput.c +15 -4
index 2bf8e6b..71357fe 100644
@@ -45,6 +45,10 @@
 #include "accommon.h"
 #include "acdebug.h"
 
+#ifdef ACPI_APPLICATION
+#include "acapps.h"
+#endif
+
 #define _COMPONENT          ACPI_CA_DEBUGGER
 ACPI_MODULE_NAME("dbinput")
 
@@ -1048,11 +1052,18 @@ acpi_db_command_dispatch(char *input_buffer,
 		acpi_db_close_debug_file();
 		break;
 
-	case CMD_LOAD:
+	case CMD_LOAD:{
+			struct acpi_new_table_desc *list_head = NULL;
 
-		status =
-		    acpi_db_get_table_from_file(acpi_gbl_db_args[1], NULL,
-						FALSE);
+			status =
+			    acpi_ac_get_all_tables_from_file(acpi_gbl_db_args
+							     [1],
+							     ACPI_GET_ALL_TABLES,
+							     &list_head);
+			if (ACPI_SUCCESS(status)) {
+				acpi_db_load_tables(list_head);
+			}
+		}
 		break;
 
 	case CMD_OPEN:
drivers/acpi/acpica/tbxfload.c +1 -1
index 9a7d72b..ca2f136 100644
@@ -207,7 +207,7 @@ acpi_status acpi_tb_load_namespace(void)
 
 	if (!tables_failed) {
 		ACPI_INFO((AE_INFO,
-			   "%u ACPI AML tables successfully acquired and loaded",
+			   "%u ACPI AML tables successfully acquired and loaded\n",
 			   tables_loaded));
 	} else {
 		ACPI_ERROR((AE_INFO,
drivers/acpi/acpica/utfileio.c deleted +0 -359

359 lines not on this page · raw message

Signature · 1 line
1.7.10
author
#12 lore raw

PATCH 12/42 ACPICA: iasl/acpiexec: Update input file handling and verification

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 3a6f2a516dd35a4daacbc5b5144d1db763ff2cb0

Improve and cleanup verification of ACPI tables within input files. Share more code between the disassembler and acpiexec.

This patch only affects application debugger commands, thus it is a no-op chage for Linux kernel.

---
 drivers/acpi/acpica/acapps.h  |   10 +++++++---
 drivers/acpi/acpica/dbinput.c |    7 +++----
 drivers/acpi/acpica/exmisc.c  |    4 ++--
 drivers/acpi/acpica/tbutils.c |    8 +-------
 4 files changed, 13 insertions(+), 16 deletions(-)
drivers/acpi/acpica/acapps.h +7 -3
index 185c2eb..340350f 100644
@@ -95,9 +95,13 @@
 /* acfileio */
 
 acpi_status
-acpi_ac_get_all_tables_from_file(char *filename,
-				 u8 get_only_aml_tables,
-				 struct acpi_new_table_desc **return_list_head);
+ac_get_all_tables_from_file(char *filename,
+			    u8 get_only_aml_tables,
+			    struct acpi_new_table_desc **return_list_head);
+
+u8 ac_is_file_binary(FILE * file);
+
+acpi_status ac_validate_table_header(FILE * file, long table_offset);
 
 /* Values for get_only_aml_tables */
 
drivers/acpi/acpica/dbinput.c +3 -4
index 71357fe..802779a 100644
@@ -1056,10 +1056,9 @@ acpi_db_command_dispatch(char *input_buffer,
 			struct acpi_new_table_desc *list_head = NULL;
 
 			status =
-			    acpi_ac_get_all_tables_from_file(acpi_gbl_db_args
-							     [1],
-							     ACPI_GET_ALL_TABLES,
-							     &list_head);
+			    ac_get_all_tables_from_file(acpi_gbl_db_args[1],
+							ACPI_GET_ALL_TABLES,
+							&list_head);
 			if (ACPI_SUCCESS(status)) {
 				acpi_db_load_tables(list_head);
 			}
drivers/acpi/acpica/exmisc.c +2 -2
index b5413bb..a8ce8a8 100644
@@ -98,9 +98,9 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
 
 		default:
 
-			ACPI_ERROR((AE_INFO, "Unknown Reference Class 0x%2.2X",
+			ACPI_ERROR((AE_INFO, "Invalid Reference Class 0x%2.2X",
 				    obj_desc->reference.class));
-			return_ACPI_STATUS(AE_AML_INTERNAL);
+			return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
 		}
 		break;
 
drivers/acpi/acpica/tbutils.c +1 -7
index 72bcccf..7c1b5f8 100644
@@ -389,7 +389,7 @@ next_table:
  *
  * PARAMETERS:  signature           - Sig string to be validated
  *
- * RETURN:      TRUE if signature is correct length and has valid characters
+ * RETURN:      TRUE if signature is has 4 valid ACPI characters
  *
  * DESCRIPTION: Validate an ACPI table signature.
  *
@@ -399,12 +399,6 @@ u8 acpi_is_valid_signature(char *signature)
 {
 	u32 i;
 
-	/* Validate the signature length */
-
-	if (strlen(signature) != ACPI_NAME_SIZE) {
-		return (FALSE);
-	}
-
 	/* Validate each character in the signature */
 
 	for (i = 0; i < ACPI_NAME_SIZE; i++) {
Signature · 1 line
1.7.10
author
#13 lore raw

PATCH 13/42 ACPICA: Debugger: Remove some unecessary NULL checks

In reply to Lv Zheng

From: Markus Elfring <[email protected]>

ACPICA commit 36fcc1b98def3fb6e20cf5e877ffc3c1592d0140

local strupr function already checks for NULL pointers. Original linux patch submitted by:
Markus Elfring <[email protected]>

---
 drivers/acpi/acpica/dbcmds.c  |    9 ++-------
 drivers/acpi/acpica/dbinput.c |    4 +---
 2 files changed, 3 insertions(+), 10 deletions(-)
drivers/acpi/acpica/dbcmds.c +2 -7
index 84ab1c2..328c35b 100644
@@ -1131,13 +1131,8 @@ void acpi_db_trace(char *enable_arg, char *method_arg, char *once_arg)
 	u32 debug_layer = 0;
 	u32 flags = 0;
 
-	if (enable_arg) {
-		acpi_ut_strupr(enable_arg);
-	}
-
-	if (once_arg) {
-		acpi_ut_strupr(once_arg);
-	}
+	acpi_ut_strupr(enable_arg);
+	acpi_ut_strupr(once_arg);
 
 	if (method_arg) {
 		if (acpi_db_trace_method_name) {
drivers/acpi/acpica/dbinput.c +1 -3
index 802779a..6203001 100644
@@ -625,9 +625,7 @@ static u32 acpi_db_get_line(char *input_buffer)
 
 	/* Uppercase the actual command */
 
-	if (acpi_gbl_db_args[0]) {
-		acpi_ut_strupr(acpi_gbl_db_args[0]);
-	}
+	acpi_ut_strupr(acpi_gbl_db_args[0]);
 
 	count = i;
 	if (count) {
Signature · 1 line
1.7.10
author
#14 lore raw

PATCH 14/42 ACPICA: Revert "acpi_get_object_info: Add support for ACPI 5.0 _SUB method."

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit e4743959b59ad93eab7310adf756adc930be0ddb

This reverts commit 8e7a8753827660c3dd1f571f3185610402b756f0.

The _SUB method was found to be problematic for this interface because some implementations use control methods. Therefore, it is being removed.

Operations cannot be used because this interface is called during the device discovery scan and the region handlers are not fully installed at that time.

Conflicts:
source/components/debugger/dbdisply.c
source/components/namespace/nsxfname.c
source/components/utilities/utids.c
source/include/acnames.h
source/include/actypes.h
source/tools/acpinames/anstubs.c

---
 drivers/acpi/acpica/acutils.h  |    4 ---
 drivers/acpi/acpica/dbdisply.c |   48 ++++++++++------------------
 drivers/acpi/acpica/nsxfname.c |   29 +++--------------
 drivers/acpi/acpica/utids.c    |   67 ----------------------------------------
 include/acpi/actypes.h         |    6 ++--
 5 files changed, 24 insertions(+), 130 deletions(-)
drivers/acpi/acpica/acutils.h +0 -4
index 6776348..9e84c05 100644
@@ -364,10 +364,6 @@ acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
 		    struct acpi_pnp_device_id ** return_id);
 
 acpi_status
-acpi_ut_execute_SUB(struct acpi_namespace_node *device_node,
-		    struct acpi_pnp_device_id **return_id);
-
-acpi_status
 acpi_ut_execute_CID(struct acpi_namespace_node *device_node,
 		    struct acpi_pnp_device_id_list ** return_cid_list);
 
drivers/acpi/acpica/dbdisply.c +17 -31

78 lines not on this page · raw message

drivers/acpi/acpica/nsxfname.c +5 -24
index c19d86c..0e4e6b7 100644
@@ -238,7 +238,6 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest,
 				    struct acpi_pnp_device_id *source,
 				    char *string_area)
 {
-
 	/* Create the destination PNP_DEVICE_ID */
 
 	dest->string = string_area;
@@ -263,8 +262,8 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest,
  *              namespace node and possibly by running several standard
  *              control methods (Such as in the case of a device.)
  *
- * For Device and Processor objects, run the Device _HID, _UID, _CID, _SUB,
- * _CLS, _STA, _ADR, _sx_w, and _sx_d methods.
+ * For Device and Processor objects, run the Device _HID, _UID, _CID, _STA,
+ * _CLS, _ADR, _sx_w, and _sx_d methods.
  *
  * Note: Allocates the return buffer, must be freed by the caller.
  *
@@ -279,7 +278,6 @@ acpi_get_object_info(acpi_handle handle,
 	struct acpi_pnp_device_id_list *cid_list = NULL;
 	struct acpi_pnp_device_id *hid = NULL;
 	struct acpi_pnp_device_id *uid = NULL;
-	struct acpi_pnp_device_id *sub = NULL;
 	struct acpi_pnp_device_id *cls = NULL;
 	char *next_id_string;
 	acpi_object_type type;
@@ -325,7 +323,7 @@ acpi_get_object_info(acpi_handle handle,
 	if ((type == ACPI_TYPE_DEVICE) || (type == ACPI_TYPE_PROCESSOR)) {
 		/*
 		 * Get extra info for ACPI Device/Processor objects only:
-		 * Run the Device _HID, _UID, _SUB, _CID, and _CLS methods.
+		 * Run the Device _HID, _UID, _CLS, and _CID methods.
 		 *
 		 * Note: none of these methods are required, so they may or may
 		 * not be present for this device. The Info->Valid bitfield is used
@@ -348,14 +346,6 @@ acpi_get_object_info(acpi_handle handle,
 			valid |= ACPI_VALID_UID;
 		}
 
-		/* Execute the Device._SUB method */
-
-		status = acpi_ut_execute_SUB(node, &sub);
-		if (ACPI_SUCCESS(status)) {
-			info_size += sub->length;
-			valid |= ACPI_VALID_SUB;
-		}
-
 		/* Execute the Device._CID method */
 
 		status = acpi_ut_execute_CID(node, &cid_list);
@@ -456,9 +446,8 @@ acpi_get_object_info(acpi_handle handle,
 	}
 
 	/*
-	 * Copy the HID, UID, SUB, and CIDs to the return buffer.
-	 * The variable-length strings are copied to the reserved area
-	 * at the end of the buffer.
+	 * Copy the HID, UID, and CIDs to the return buffer. The variable-length
+	 * strings are copied to the reserved area at the end of the buffer.
 	 *
 	 * For HID and CID, check if the ID is a PCI Root Bridge.
 	 */
@@ -476,11 +465,6 @@ acpi_get_object_info(acpi_handle handle,
 							uid, next_id_string);
 	}
 
-	if (sub) {
-		next_id_string = acpi_ns_copy_device_id(&info->subsystem_id,
-							sub, next_id_string);
-	}
-
 	if (cid_list) {
 		info->compatible_id_list.count = cid_list->count;
 		info->compatible_id_list.list_size = cid_list->list_size;
@@ -522,9 +506,6 @@ cleanup:
 	if (uid) {
 		ACPI_FREE(uid);
 	}
-	if (sub) {
-		ACPI_FREE(sub);
-	}
 	if (cid_list) {
 		ACPI_FREE(cid_list);
 	}
drivers/acpi/acpica/utids.c +0 -67

73 lines not on this page · raw message

include/acpi/actypes.h +2 -4
index f914958..9633f60 100644
@@ -1148,7 +1148,7 @@ u32 (*acpi_interface_handler) (acpi_string interface_name, u32 supported);
 
 #define ACPI_PCICLS_STRING_SIZE         7	/* Includes null terminator */
 
-/* Structures used for device/processor HID, UID, CID, and SUB */
+/* Structures used for device/processor HID, UID, CID */
 
 struct acpi_pnp_device_id {
 	u32 length;		/* Length of string + null */
@@ -1178,7 +1178,6 @@ struct acpi_device_info {
 	u64 address;	/* _ADR value */
 	struct acpi_pnp_device_id hardware_id;	/* _HID value */
 	struct acpi_pnp_device_id unique_id;	/* _UID value */
-	struct acpi_pnp_device_id subsystem_id;	/* _SUB value */
 	struct acpi_pnp_device_id class_code;	/* _CLS value */
 	struct acpi_pnp_device_id_list compatible_id_list;	/* _CID list <must be last> */
 };
@@ -1193,13 +1192,12 @@ struct acpi_device_info {
 #define ACPI_VALID_ADR                  0x0002
 #define ACPI_VALID_HID                  0x0004
 #define ACPI_VALID_UID                  0x0008
-#define ACPI_VALID_SUB                  0x0010
 #define ACPI_VALID_CID                  0x0020
 #define ACPI_VALID_CLS                  0x0040
 #define ACPI_VALID_SXDS                 0x0100
 #define ACPI_VALID_SXWS                 0x0200
 
-/* Flags for _STA return value (current_status above) */
+/* Flags for _STA method */
 
 #define ACPI_STA_DEVICE_PRESENT         0x01
 #define ACPI_STA_DEVICE_ENABLED         0x02
Signature · 1 line
1.7.10
author
#15 lore raw

PATCH 15/42 ACPICA: Add comment explaining _SUB removal

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 81a89968f83bfc3b1d0f0f80f2da08ea69646053

Adds a lengthy comment to acpi_get_object_info explaining the removal of _SUB and why no complex methods can be added ever to this interface.

---
 drivers/acpi/acpica/nsxfname.c |    7 +++++++
 1 file changed, 7 insertions(+)
drivers/acpi/acpica/nsxfname.c +7 -0
index 0e4e6b7..669e0f1 100644
@@ -267,6 +267,13 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest,
  *
  * Note: Allocates the return buffer, must be freed by the caller.
  *
+ * Note: This interface is intended to be used during the initial device
+ * discovery namespace traversal. Therefore, no complex methods can be
+ * executed, especially those that access operation regions. Therefore, do
+ * not add any additional methods that could cause problems in this area.
+ * this was the fate of the _SUB method which was found to cause such
+ * problems and was removed (11/2015).
+ *
  ******************************************************************************/
 
 acpi_status
Signature · 1 line
1.7.10
author
#16 lore raw

PATCH 16/42 ACPICA: acpiexec/acpinames: Update for error checking macros

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 5bdfb4f43f4d315d23b31b39bac5a0b1ca420c2b

Standardize naming, deploy in common header.

---
 drivers/acpi/acpica/acapps.h |   13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/acpi/acpica/acapps.h +13 -0
index 340350f..578e37f 100644
@@ -89,6 +89,19 @@
 #define ACPI_OPTION(name, description) \
 	acpi_os_printf (" %-18s%s\n", name, description);
 
+/* Check for unexpected exceptions */
+
+#define ACPI_CHECK_STATUS(name, status, expected) \
+	if (status != expected) \
+	{ \
+		acpi_os_printf ("Unexpected %s from %s (%s-%d)\n", \
+			acpi_format_exception (status), #name, _acpi_module_name, __LINE__); \
+	}
+
+/* Check for unexpected non-AE_OK errors */
+
+#define ACPI_CHECK_OK(name, status)   ACPI_CHECK_STATUS (name, status, AE_OK);
+
 #define FILE_SUFFIX_DISASSEMBLY     "dsl"
 #define FILE_SUFFIX_BINARY_TABLE    ".dat"	/* Needs the dot */
 
Signature · 1 line
1.7.10
author
#17 lore raw

PATCH 17/42 ACPICA: Concatenate operator: Add extensions to support all ACPI objects

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 3420c1f5e6c6dd4fe51be4d98da69b3197d608df

Emits strings for all the object types besides int/str/buf. This simplifies and extends the usefulness of the Printf macros.

---
 drivers/acpi/acpica/acopcode.h |    2 +-
 drivers/acpi/acpica/exmisc.c   |   41 +++++++++++++++++++++++++++++++++++-----
 2 files changed, 37 insertions(+), 6 deletions(-)
drivers/acpi/acpica/acopcode.h +1 -1
index f9acf92..db71b02 100644
@@ -223,7 +223,7 @@
 #define ARGI_BUFFER_OP                  ARGI_LIST1 (ARGI_INTEGER)
 #define ARGI_BYTE_OP                    ARGI_INVALID_OPCODE
 #define ARGI_BYTELIST_OP                ARGI_INVALID_OPCODE
-#define ARGI_CONCAT_OP                  ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA,   ARGI_TARGETREF)
+#define ARGI_CONCAT_OP                  ARGI_LIST3 (ARGI_ANYTYPE,    ARGI_ANYTYPE,       ARGI_TARGETREF)
 #define ARGI_CONCAT_RES_OP              ARGI_LIST3 (ARGI_BUFFER,     ARGI_BUFFER,        ARGI_TARGETREF)
 #define ARGI_COND_REF_OF_OP             ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF)
 #define ARGI_CONNECTFIELD_OP            ARGI_INVALID_OPCODE
drivers/acpi/acpica/exmisc.c +36 -5

60 lines not on this page · raw message

Signature · 1 line
1.7.10
author
#18 lore raw

PATCH 18/42 ACPICA: Debug Object: Cleanup output

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 05492c4a7d1e106eb871a5e1357ed564d25740e5

1) Make the timer value output optional
2) Allow empty lines via null string or simple newline
3) No need for the object type name for strings and integers
4) Miscellaneous cleanup of output

---
 drivers/acpi/acpica/exdebug.c |   67 +++++++++++++++++++++++++++++------------
 include/acpi/acpixf.h         |    4 +++
 2 files changed, 51 insertions(+), 20 deletions(-)
drivers/acpi/acpica/exdebug.c +47 -20
index 815442b..a203335 100644
@@ -88,20 +88,39 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 		return_VOID;
 	}
 
-	/*
-	 * We will emit the current timer value (in microseconds) with each
-	 * debug output. Only need the lower 26 bits. This allows for 67
-	 * million microseconds or 67 seconds before rollover.
-	 */
-	timer = ((u32)acpi_os_get_timer() / 10);	/* (100 nanoseconds to microseconds) */
-	timer &= 0x03FFFFFF;
+	/* Null string or newline -- don't emit the line header */
+
+	if ((ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) &&
+	    (source_desc->common.type == ACPI_TYPE_STRING)) {
+		if ((source_desc->string.length == 0) ||
+		    ((source_desc->string.length == 1) &&
+		     (*source_desc->string.pointer == '\n'))) {
+			acpi_os_printf("\n");
+			return_VOID;
+		}
+	}
 
 	/*
 	 * Print line header as long as we are not in the middle of an
 	 * object display
 	 */
 	if (!((level > 0) && index == 0)) {
-		acpi_os_printf("[ACPI Debug %.8u] %*s", timer, level, " ");
+		if (acpi_gbl_display_debug_timer) {
+			/*
+			 * We will emit the current timer value (in microseconds) with each
+			 * debug output. Only need the lower 26 bits. This allows for 67
+			 * million microseconds or 67 seconds before rollover.
+			 *
+			 * Convert 100 nanosecond units to microseconds
+			 */
+			timer = ((u32)acpi_os_get_timer() / 10);
+			timer &= 0x03FFFFFF;
+
+			acpi_os_printf("[ACPI Debug T=0x%8.8X] %*s", timer,
+				       level, " ");
+		} else {
+			acpi_os_printf("[ACPI Debug] %*s", level, " ");
+		}
 	}
 
 	/* Display the index for package output only */
@@ -116,8 +135,15 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 	}
 
 	if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) {
-		acpi_os_printf("%s ",
-			       acpi_ut_get_object_type_name(source_desc));
+
+		/* No object type prefix needed for integers and strings */
+
+		if ((source_desc->common.type != ACPI_TYPE_INTEGER) &&
+		    (source_desc->common.type != ACPI_TYPE_STRING)) {
+			acpi_os_printf("%s ",
+				       acpi_ut_get_object_type_name
+				       (source_desc));
+		}
 
 		if (!acpi_ut_valid_internal_object(source_desc)) {
 			acpi_os_printf("%p, Invalid Internal Object!\n",
@@ -126,7 +152,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 		}
 	} else if (ACPI_GET_DESCRIPTOR_TYPE(source_desc) ==
 		   ACPI_DESC_TYPE_NAMED) {
-		acpi_os_printf("%s: %p\n",
+		acpi_os_printf("%s (Node %p)\n",
 			       acpi_ut_get_type_name(((struct
 						       acpi_namespace_node *)
 						      source_desc)->type),
@@ -164,14 +190,12 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 
 	case ACPI_TYPE_STRING:
 
-		acpi_os_printf("[0x%.2X] \"%s\"\n",
-			       source_desc->string.length,
-			       source_desc->string.pointer);
+		acpi_os_printf("\"%s\"\n", source_desc->string.pointer);
 		break;
 
 	case ACPI_TYPE_PACKAGE:
 
-		acpi_os_printf("[Contains 0x%.2X Elements]\n",
+		acpi_os_printf("(Contains 0x%.2X Elements):\n",
 			       source_desc->package.count);
 
 		/* Output the entire contents of the package */
@@ -250,11 +274,14 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 			if (ACPI_GET_DESCRIPTOR_TYPE
 			    (source_desc->reference.object) ==
 			    ACPI_DESC_TYPE_NAMED) {
-				acpi_ex_do_debug_object(((struct
-							  acpi_namespace_node *)
+
+				/* Reference object is a namespace node */
+
+				acpi_ex_do_debug_object(ACPI_CAST_PTR
+							(union
+							 acpi_operand_object,
 							 source_desc->reference.
-							 object)->object,
-							level + 4, 0);
+							 object), level + 4, 0);
 			} else {
 				object_desc = source_desc->reference.object;
 				value = source_desc->reference.value;
@@ -300,7 +327,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 
 	default:
 
-		acpi_os_printf("%p\n", source_desc);
+		acpi_os_printf("(Descriptor %p)\n", source_desc);
 		break;
 	}
 
include/acpi/acpixf.h +4 -0
index 5dfab9c..d60507b7 100644
@@ -263,6 +263,10 @@ ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_layer, ACPI_TRACE_LAYER_DEFAULT);
 ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT);
 ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0);
 
+/* Optionally enable timer output with Debug Object output */
+
+ACPI_INIT_GLOBAL(u8, acpi_gbl_display_debug_timer, FALSE);
+
 /*
  * Debugger command handshake globals. Host OSes need to access these
  * variables to implement their own command handshake mechanism.
Signature · 1 line
1.7.10
author
#19 lore raw

PATCH 19/42 ACPICA: Debug object: Fix output for a NULL object

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit e4414f067c726ef746dac990c0bae7f433045843

Was broken by addition of "null string" feature to emit simple blank lines.

---
 drivers/acpi/acpica/exdebug.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/acpica/exdebug.c +2 -1
index a203335..ca6e379 100644
@@ -90,7 +90,8 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 
 	/* Null string or newline -- don't emit the line header */
 
-	if ((ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) &&
+	if (source_desc &&
+	    (ACPI_GET_DESCRIPTOR_TYPE(source_desc) == ACPI_DESC_TYPE_OPERAND) &&
 	    (source_desc->common.type == ACPI_TYPE_STRING)) {
 		if ((source_desc->string.length == 0) ||
 		    ((source_desc->string.length == 1) &&
Signature · 1 line
1.7.10
author
#20 lore raw

PATCH 20/42 ACPICA: Update for output of the Debug Object

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit b01414f5a822d0879aa9eba91541a21e7e501142

Improve output for the case of an Index() that refers to a Package element that has not been initialized.

---
 drivers/acpi/acpica/exdebug.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/acpi/acpica/exdebug.c +8 -3
index ca6e379..b223090 100644
@@ -310,9 +310,14 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
 				case ACPI_TYPE_PACKAGE:
 
 					acpi_os_printf("Package[%u] = ", value);
-					acpi_ex_do_debug_object(*source_desc->
-								reference.where,
-								level + 4, 0);
+					if (!(*source_desc->reference.where)) {
+						acpi_os_printf
+						    ("[Uninitialized Package Element]\n");
+					} else {
+						acpi_ex_do_debug_object
+						    (*source_desc->reference.
+						     where, level + 4, 0);
+					}
 					break;
 
 				default:
Signature · 1 line
1.7.10
author
#21 lore raw

PATCH 21/42 ACPICA: Namespace: Add scope information to the simple object repair mechanism

In reply to Lv Zheng

ACPICA commit 51cbd324420ca5e381cb2c57ce95139053518a35

The acpi_object_converter callbacks are lack in scope information to convert name_string. This patch fixes this issue by passing the evaluation method/object node to the converter callbacks. Lv Zheng.

---
 drivers/acpi/acpica/aclocal.h   |    3 ++-
 drivers/acpi/acpica/acnamesp.h  |    6 ++++--
 drivers/acpi/acpica/nsconvert.c |   12 ++++++++----
 drivers/acpi/acpica/nsrepair.c  |    4 ++--
 4 files changed, 16 insertions(+), 9 deletions(-)
drivers/acpi/acpica/aclocal.h +2 -1
index 4fd5040..351a1cd 100644
@@ -395,7 +395,8 @@ union acpi_predefined_info {
 
 /* Return object auto-repair info */
 
-typedef acpi_status(*acpi_object_converter) (union acpi_operand_object
+typedef acpi_status(*acpi_object_converter) (struct acpi_namespace_node * scope,
+					     union acpi_operand_object
 					     *original_object,
 					     union acpi_operand_object
 					     **converted_object);
drivers/acpi/acpica/acnamesp.h +4 -2
index 5d261c9..1f42c3c 100644
@@ -183,11 +183,13 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
 			  union acpi_operand_object **return_object);
 
 acpi_status
-acpi_ns_convert_to_unicode(union acpi_operand_object *original_object,
+acpi_ns_convert_to_unicode(struct acpi_namespace_node *scope,
+			   union acpi_operand_object *original_object,
 			   union acpi_operand_object **return_object);
 
 acpi_status
-acpi_ns_convert_to_resource(union acpi_operand_object *original_object,
+acpi_ns_convert_to_resource(struct acpi_namespace_node *scope,
+			    union acpi_operand_object *original_object,
 			    union acpi_operand_object **return_object);
 
 /*
drivers/acpi/acpica/nsconvert.c +8 -4
index 749a189..ab47a50 100644
@@ -306,7 +306,8 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
  *
  * FUNCTION:    acpi_ns_convert_to_unicode
  *
- * PARAMETERS:  original_object     - ASCII String Object to be converted
+ * PARAMETERS:  scope               - Namespace node for the method/object
+ *              original_object     - ASCII String Object to be converted
  *              return_object       - Where the new converted object is returned
  *
  * RETURN:      Status. AE_OK if conversion was successful.
@@ -316,7 +317,8 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
  ******************************************************************************/
 
 acpi_status
-acpi_ns_convert_to_unicode(union acpi_operand_object *original_object,
+acpi_ns_convert_to_unicode(struct acpi_namespace_node * scope,
+			   union acpi_operand_object *original_object,
 			   union acpi_operand_object **return_object)
 {
 	union acpi_operand_object *new_object;
@@ -370,7 +372,8 @@ acpi_ns_convert_to_unicode(union acpi_operand_object *original_object,
  *
  * FUNCTION:    acpi_ns_convert_to_resource
  *
- * PARAMETERS:  original_object     - Object to be converted
+ * PARAMETERS:  scope               - Namespace node for the method/object
+ *              original_object     - Object to be converted
  *              return_object       - Where the new converted object is returned
  *
  * RETURN:      Status. AE_OK if conversion was successful
@@ -381,7 +384,8 @@ acpi_ns_convert_to_unicode(union acpi_operand_object *original_object,
  ******************************************************************************/
 
 acpi_status
-acpi_ns_convert_to_resource(union acpi_operand_object *original_object,
+acpi_ns_convert_to_resource(struct acpi_namespace_node * scope,
+			    union acpi_operand_object *original_object,
 			    union acpi_operand_object **return_object)
 {
 	union acpi_operand_object *new_object;
drivers/acpi/acpica/nsrepair.c +2 -2
index 360e3ab..4b7dbff 100644
@@ -172,8 +172,8 @@ acpi_ns_simple_repair(struct acpi_evaluate_info *info,
 					      "Missing expected return value"));
 		}
 
-		status =
-		    predefined->object_converter(return_object, &new_object);
+		status = predefined->object_converter(info->node, return_object,
+						      &new_object);
 		if (ACPI_FAILURE(status)) {
 
 			/* A fatal error occurred during a conversion */
Signature · 1 line
1.7.10
author
#22 lore raw

PATCH 22/42 ACPICA: Namespace: Add String -> ObjectReference conversion support

In reply to Lv Zheng

ACPICA commit 80e60d72959bb51c5d08c8500d978607a42ed81d

BIOS developers may accidently put the quotes around the name strings, which converts the object references in the packages indicated by the name strings into the data objects (strings). Such kind of error has been seen in _DEP control methods on some platforms. This patch implements a workaround to correct it. Reported by Bastien Nocera. Fixed by Lv Zheng.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=106231

---
 drivers/acpi/acpica/acnamesp.h  |    6 ++++
 drivers/acpi/acpica/nsconvert.c |   75 +++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/nsrepair.c  |    9 ++++-
 3 files changed, 89 insertions(+), 1 deletion(-)
drivers/acpi/acpica/acnamesp.h +6 -0
index 1f42c3c..d082e62 100644
@@ -77,6 +77,7 @@
 /* Object is not a package element */
 
 #define ACPI_NOT_PACKAGE_ELEMENT    ACPI_UINT32_MAX
+#define ACPI_ALL_PACKAGE_ELEMENTS   (ACPI_UINT32_MAX-1)
 
 /* Always emit warning message, not dependent on node flags */
 
@@ -192,6 +193,11 @@ acpi_ns_convert_to_resource(struct acpi_namespace_node *scope,
 			    union acpi_operand_object *original_object,
 			    union acpi_operand_object **return_object);
 
+acpi_status
+acpi_ns_convert_to_reference(struct acpi_namespace_node *scope,
+			     union acpi_operand_object *original_object,
+			     union acpi_operand_object **return_object);
+
 /*
  * nsdump - Namespace dump/print utilities
  */
drivers/acpi/acpica/nsconvert.c +75 -0

78 lines not on this page · raw message

drivers/acpi/acpica/nsrepair.c +8 -1
index 4b7dbff..6418863 100644
@@ -116,6 +116,11 @@ static const struct acpi_simple_repair_info acpi_object_repair_info[] = {
 	 ACPI_NOT_PACKAGE_ELEMENT,
 	 acpi_ns_convert_to_resource},
 
+	/* Object reference conversions */
+
+	{"_DEP", ACPI_RTYPE_STRING, ACPI_ALL_PACKAGE_ELEMENTS,
+	 acpi_ns_convert_to_reference},
+
 	/* Unicode conversions */
 
 	{"_MLS", ACPI_RTYPE_STRING, 1,
@@ -360,7 +365,9 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct
 			/* Check if we can actually repair this name/type combination */
 
 			if ((return_btype & this_name->unexpected_btypes) &&
-			    (package_index == this_name->package_index)) {
+			    (this_name->package_index ==
+			     ACPI_ALL_PACKAGE_ELEMENTS
+			     || package_index == this_name->package_index)) {
 				return (this_name);
 			}
 
Signature · 1 line
1.7.10
author
#23 lore raw

PATCH 23/42 ACPICA: getopt: Comment update, no functional change

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 0d784a90bc3aac75227c4459c3553de18b9ebe7a

Document one of the option string operators.

---
 tools/power/acpi/common/getopt.c |    1 +
 1 file changed, 1 insertion(+)
tools/power/acpi/common/getopt.c +1 -0
index 2496629..efefe30 100644
@@ -47,6 +47,7 @@
  * Option strings:
  *    "f"       - Option has no arguments
  *    "f:"      - Option requires an argument
+ *    "f+"      - Option has an optional argument
  *    "f^"      - Option has optional single-char sub-options
  *    "f|"      - Option has required single-char sub-options
  */
Signature · 1 line
1.7.10
author
#24 lore raw

PATCH 24/42 ACPICA: Tools: Add spacing and missing options in acpibin tool

In reply to Lv Zheng

From: Colin Ian King <[email protected]>

ACPICA commit e7c8ffbbef3f7ce340e012ae4db63ea16cd09714

The -e option is missing from the acpibin help options, so add this. Also, there should be spaces between the filenames for the -c and -d optios, so add this and expand the field size from 18 to 20 characters in the ACPI_OPTION macro.

---
 drivers/acpi/acpica/acapps.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpica/acapps.h +1 -1
index 578e37f..8b4ff40 100644
@@ -87,7 +87,7 @@
 	acpi_os_printf (description);
 
 #define ACPI_OPTION(name, description) \
-	acpi_os_printf (" %-18s%s\n", name, description);
+	acpi_os_printf (" %-20s%s\n", name, description);
 
 /* Check for unexpected exceptions */
 
Signature · 1 line
1.7.10
author
#25 lore raw

PATCH 25/42 ACPICA: Add new exception code, AE_IO_ERROR

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit dcaeaddfc11544f03e6323be4ac8ff8a1e014956

The intent for this exception is for low-level I/O operations, especially Clib functions.

---
 include/acpi/acexcep.h |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/acpi/acexcep.h +4 -2
index 204f581..cd84b12 100644
@@ -126,8 +126,9 @@ struct acpi_exception_info {
 #define AE_OWNER_ID_LIMIT               EXCEP_ENV (0x001B)
 #define AE_NOT_CONFIGURED               EXCEP_ENV (0x001C)
 #define AE_ACCESS                       EXCEP_ENV (0x001D)
+#define AE_IO_ERROR                     EXCEP_ENV (0x001E)
 
-#define AE_CODE_ENV_MAX                 0x001D
+#define AE_CODE_ENV_MAX                 0x001E
 
 /*
  * Programmer exceptions
@@ -263,7 +264,8 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = {
 		  "There are no more Owner IDs available for ACPI tables or control methods"),
 	EXCEP_TXT("AE_NOT_CONFIGURED",
 		  "The interface is not part of the current subsystem configuration"),
-	EXCEP_TXT("AE_ACCESS", "Permission denied for the requested operation")
+	EXCEP_TXT("AE_ACCESS", "Permission denied for the requested operation"),
+	EXCEP_TXT("AE_IO_ERROR", "An I/O error occurred")
 };
 
 static const struct acpi_exception_info acpi_gbl_exception_names_pgm[] = {
Signature · 1 line
1.7.10
author
#26 lore raw

PATCH 26/42 ACPICA: iasl/Disassembler: Support ASL ElseIf operator

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 918a840d27d620942e0ecb69de320bb71ea86c5a

ElseIf is a macro that resolves to an Else..If in the AML byte code. This support merges an Else followed immediately by an If to an ASL ElseIf operator. Simplifies decoded ASL, especially for large Switch statements.

This patch only applies to iasl, and is no-op for Linux kernel.

---
 drivers/acpi/acpica/aclocal.h |    1 +
 1 file changed, 1 insertion(+)
drivers/acpi/acpica/aclocal.h +1 -0
index 351a1cd..034402d 100644
@@ -869,6 +869,7 @@ struct acpi_parse_state {
 #define ACPI_PARSEOP_CLOSING_PAREN      0x10
 #define ACPI_PARSEOP_COMPOUND           0x20
 #define ACPI_PARSEOP_ASSIGNMENT         0x40
+#define ACPI_PARSEOP_ELSEIF             0x80
 
 /*****************************************************************************
  *
Signature · 1 line
1.7.10
author
#27 lore raw

PATCH 27/42 ACPICA: Parser: Add constants for internal namepath function

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit b216e39fe85feee955d29fe0a7190dd811e181ea

Add true/false constants for the "PossibleMethodCall" parameter for acpi_ps_get_next_namepath.

---
 drivers/acpi/acpica/acparser.h |    8 +++++++-
 drivers/acpi/acpica/psargs.c   |    4 ++--
 drivers/acpi/acpica/psloop.c   |    8 ++++----
 3 files changed, 13 insertions(+), 7 deletions(-)
drivers/acpi/acpica/acparser.h +7 -1
index 8fc8c7c..96d510a 100644
@@ -92,7 +92,13 @@ acpi_ps_get_next_simple_arg(struct acpi_parse_state *parser_state,
 acpi_status
 acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
 			  struct acpi_parse_state *parser_state,
-			  union acpi_parse_object *arg, u8 method_call);
+			  union acpi_parse_object *arg,
+			  u8 possible_method_call);
+
+/* Values for u8 above */
+
+#define ACPI_NOT_METHOD_CALL            FALSE
+#define ACPI_POSSIBLE_METHOD_CALL       TRUE
 
 acpi_status
 acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
drivers/acpi/acpica/psargs.c +2 -2
index 3f0ffee..0fdb7fc 100644
@@ -821,7 +821,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 				status =
 				    acpi_ps_get_next_namepath(walk_state,
 							      parser_state, arg,
-							      1);
+							      ACPI_POSSIBLE_METHOD_CALL);
 
 				/*
 				 * If the super_name arg of Unload is a method call,
@@ -836,7 +836,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 				status =
 				    acpi_ps_get_next_namepath(walk_state,
 							      parser_state, arg,
-							      0);
+							      ACPI_NOT_METHOD_CALL);
 			}
 		} else {
 			/* Single complex argument, nothing returned */
drivers/acpi/acpica/psloop.c +4 -4
index c660006..a57f473 100644
@@ -109,10 +109,10 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
 
 	case AML_INT_NAMEPATH_OP:	/* AML_NAMESTRING_ARG */
 
-		status =
-		    acpi_ps_get_next_namepath(walk_state,
-					      &(walk_state->parser_state), op,
-					      1);
+		status = acpi_ps_get_next_namepath(walk_state,
+						   &(walk_state->parser_state),
+						   op,
+						   ACPI_POSSIBLE_METHOD_CALL);
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
 		}
Signature · 1 line
1.7.10
author
#28 lore raw

PATCH 28/42 ACPICA: Parser: Fix for SuperName method invocation

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 4b86d1046d06e462dae83ebcd5a66cc132a08f8f

SuperName parameters that are in fact control method invocations were not handled correctly by the parser. This change fixes the problem by identifying these properly as method invocations. This affects about 14 different ASL operators that contain SuperName parameters. ACPICA BZ 1002.

---
 drivers/acpi/acpica/psargs.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/acpi/acpica/psargs.c +5 -4
index 0fdb7fc..f84e546 100644
@@ -269,7 +269,8 @@ 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->opcode == AML_UNLOAD_OP) {
+		if (GET_CURRENT_ARG_TYPE(walk_state->arg_types) ==
+		    ARGP_SUPERNAME) {
 			/*
 			 * acpi_ps_get_next_namestring has increased the AML pointer,
 			 * so we need to restore the saved AML pointer for method call.
@@ -696,7 +697,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
  *
  * PARAMETERS:  walk_state          - Current state
  *              parser_state        - Current parser state object
- *              arg_type            - The argument type (AML_*_ARG)
+ *              arg_type            - The parser argument type (ARGP_*)
  *              return_arg          - Where the next arg is returned
  *
  * RETURN:      Status, and an op object containing the next argument.
@@ -815,9 +816,9 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 				return_ACPI_STATUS(AE_NO_MEMORY);
 			}
 
-			/* To support super_name arg of Unload */
+			/* super_name allows argument to be a method call */
 
-			if (walk_state->opcode == AML_UNLOAD_OP) {
+			if (arg_type == ARGP_SUPERNAME) {
 				status =
 				    acpi_ps_get_next_namepath(walk_state,
 							      parser_state, arg,
Signature · 1 line
1.7.10
author
#29 lore raw

PATCH 29/42 ACPICA: Update parameter type for ObjectType operator

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 67953304a34944548f2fa53a4b0786a5db0ca2ea

The grammar for this operator changed in ACPI 5.0A, but it was not necessary to update the interpreter/parser until now.

The UserTerm (method invocation) element was removed. Previously a SuperName, the lone argument now requires a new ARGP_ type.

---
 drivers/acpi/acpica/acopcode.h |    2 +-
 drivers/acpi/acpica/amlcode.h  |    3 ++-
 drivers/acpi/acpica/psargs.c   |    5 +++--
 3 files changed, 6 insertions(+), 4 deletions(-)
drivers/acpi/acpica/acopcode.h +1 -1
index db71b02..05f80de 100644
@@ -185,7 +185,7 @@
 #define ARGP_TO_HEX_STR_OP              ARGP_LIST2 (ARGP_TERMARG,    ARGP_TARGET)
 #define ARGP_TO_INTEGER_OP              ARGP_LIST2 (ARGP_TERMARG,    ARGP_TARGET)
 #define ARGP_TO_STRING_OP               ARGP_LIST3 (ARGP_TERMARG,    ARGP_TERMARG,       ARGP_TARGET)
-#define ARGP_TYPE_OP                    ARGP_LIST1 (ARGP_SUPERNAME)
+#define ARGP_TYPE_OP                    ARGP_LIST1 (ARGP_NAME_OR_REF)
 #define ARGP_UNLOAD_OP                  ARGP_LIST1 (ARGP_SUPERNAME)
 #define ARGP_VAR_PACKAGE_OP             ARGP_LIST3 (ARGP_PKGLENGTH,  ARGP_TERMARG,       ARGP_DATAOBJLIST)
 #define ARGP_WAIT_OP                    ARGP_LIST2 (ARGP_SUPERNAME,  ARGP_TERMARG)
drivers/acpi/acpica/amlcode.h +2 -1
index 883f20c..2eedfa2 100644
@@ -238,7 +238,8 @@
 #define ARGP_TERMLIST               0x0F
 #define ARGP_WORDDATA               0x10
 #define ARGP_QWORDDATA              0x11
-#define ARGP_SIMPLENAME             0x12
+#define ARGP_SIMPLENAME             0x12	/* name_string | local_term | arg_term */
+#define ARGP_NAME_OR_REF            0x13	/* For object_type only */
 
 /*
  * Resolved argument types for the AML Interpreter
drivers/acpi/acpica/psargs.c +3 -2
index f84e546..f3bcfa2 100644
@@ -800,6 +800,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 	case ARGP_TARGET:
 	case ARGP_SUPERNAME:
 	case ARGP_SIMPLENAME:
+	case ARGP_NAME_OR_REF:
 
 		subop = acpi_ps_peek_opcode(parser_state);
 		if (subop == 0 ||
@@ -825,8 +826,8 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 							      ACPI_POSSIBLE_METHOD_CALL);
 
 				/*
-				 * If the super_name arg of Unload is a method call,
-				 * we have restored the AML pointer, just free this Arg
+				 * If the super_name argument is a method call, we have
+				 * already restored the AML pointer, just free this Arg
 				 */
 				if (arg->common.aml_opcode ==
 				    AML_INT_METHODCALL_OP) {
Signature · 1 line
1.7.10
author
#30 lore raw

PATCH 30/42 ACPICA: Update internal #defines for ObjectType operator. No functional change

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 5923a9be36b8cb1b62afa89fe217783c04c92ad3

To improve readability. Rename all *_TYPE_* defines related to ObjectType to *_OBJECT_TYPE_*

---
 drivers/acpi/acpica/acopcode.h |    4 ++--
 drivers/acpi/acpica/amlcode.h  |    2 +-
 drivers/acpi/acpica/exoparg1.c |    2 +-
 drivers/acpi/acpica/psopcode.c |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
drivers/acpi/acpica/acopcode.h +2 -2
index 05f80de..c6b2f42 100644
@@ -152,6 +152,7 @@
 #define ARGP_NAMEPATH_OP                ARGP_LIST1 (ARGP_NAMESTRING)
 #define ARGP_NOOP_OP                    ARG_NONE
 #define ARGP_NOTIFY_OP                  ARGP_LIST2 (ARGP_SUPERNAME,  ARGP_TERMARG)
+#define ARGP_OBJECT_TYPE_OP             ARGP_LIST1 (ARGP_NAME_OR_REF)
 #define ARGP_ONE_OP                     ARG_NONE
 #define ARGP_ONES_OP                    ARG_NONE
 #define ARGP_PACKAGE_OP                 ARGP_LIST3 (ARGP_PKGLENGTH,  ARGP_BYTEDATA,      ARGP_DATAOBJLIST)
@@ -185,7 +186,6 @@
 #define ARGP_TO_HEX_STR_OP              ARGP_LIST2 (ARGP_TERMARG,    ARGP_TARGET)
 #define ARGP_TO_INTEGER_OP              ARGP_LIST2 (ARGP_TERMARG,    ARGP_TARGET)
 #define ARGP_TO_STRING_OP               ARGP_LIST3 (ARGP_TERMARG,    ARGP_TERMARG,       ARGP_TARGET)
-#define ARGP_TYPE_OP                    ARGP_LIST1 (ARGP_NAME_OR_REF)
 #define ARGP_UNLOAD_OP                  ARGP_LIST1 (ARGP_SUPERNAME)
 #define ARGP_VAR_PACKAGE_OP             ARGP_LIST3 (ARGP_PKGLENGTH,  ARGP_TERMARG,       ARGP_DATAOBJLIST)
 #define ARGP_WAIT_OP                    ARGP_LIST2 (ARGP_SUPERNAME,  ARGP_TERMARG)
@@ -285,6 +285,7 @@
 #define ARGI_NAMEPATH_OP                ARGI_INVALID_OPCODE
 #define ARGI_NOOP_OP                    ARG_NONE
 #define ARGI_NOTIFY_OP                  ARGI_LIST2 (ARGI_DEVICE_REF, ARGI_INTEGER)
+#define ARGI_OBJECT_TYPE_OP             ARGI_LIST1 (ARGI_ANYTYPE)
 #define ARGI_ONE_OP                     ARG_NONE
 #define ARGI_ONES_OP                    ARG_NONE
 #define ARGI_PACKAGE_OP                 ARGI_LIST1 (ARGI_INTEGER)
@@ -318,7 +319,6 @@
 #define ARGI_TO_HEX_STR_OP              ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
 #define ARGI_TO_INTEGER_OP              ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
 #define ARGI_TO_STRING_OP               ARGI_LIST3 (ARGI_BUFFER,     ARGI_INTEGER,       ARGI_FIXED_TARGET)
-#define ARGI_TYPE_OP                    ARGI_LIST1 (ARGI_ANYTYPE)
 #define ARGI_UNLOAD_OP                  ARGI_LIST1 (ARGI_DDBHANDLE)
 #define ARGI_VAR_PACKAGE_OP             ARGI_LIST1 (ARGI_INTEGER)
 #define ARGI_WAIT_OP                    ARGI_LIST2 (ARGI_EVENT,      ARGI_INTEGER)
drivers/acpi/acpica/amlcode.h +1 -1
index 2eedfa2..ab9f3f1 100644
@@ -120,7 +120,7 @@
 #define AML_CREATE_WORD_FIELD_OP    (u16) 0x8b
 #define AML_CREATE_BYTE_FIELD_OP    (u16) 0x8c
 #define AML_CREATE_BIT_FIELD_OP     (u16) 0x8d
-#define AML_TYPE_OP                 (u16) 0x8e
+#define AML_OBJECT_TYPE_OP          (u16) 0x8e
 #define AML_CREATE_QWORD_FIELD_OP   (u16) 0x8f	/* ACPI 2.0 */
 #define AML_LAND_OP                 (u16) 0x90
 #define AML_LOR_OP                  (u16) 0x91
drivers/acpi/acpica/exoparg1.c +1 -1
index bcdf43c..efe7ac3 100644
@@ -686,7 +686,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 		status = acpi_ex_store(return_desc, operand[0], walk_state);
 		break;
 
-	case AML_TYPE_OP:	/* object_type (source_object) */
+	case AML_OBJECT_TYPE_OP:	/* object_type (source_object) */
 		/*
 		 * Note: The operand is not resolved at this point because we want to
 		 * get the associated object, not its value. For example, we don't
drivers/acpi/acpica/psopcode.c +1 -1
index c3005bd..40909dd 100644
@@ -380,7 +380,7 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {
 			 AML_TYPE_CREATE_FIELD,
 			 AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE |
 			 AML_DEFER | AML_CREATE),
-/* 37 */ ACPI_OP("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP,
+/* 37 */ ACPI_OP("ObjectType", ARGP_OBJECT_TYPE_OP, ARGI_OBJECT_TYPE_OP,
 			 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
 			 AML_TYPE_EXEC_1A_0T_1R,
 			 AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE),
Signature · 1 line
1.7.10
author
#31 lore raw

PATCH 31/42 ACPICA: Update for CondRefOf and RefOf operators

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 725c094f1a7a2ae28e623ee77be400af1c36b180

The SuperName parameters for these operators were incorrect. This represents two problems in the ACPI specification itself.

---
 drivers/acpi/acpica/acopcode.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/acpica/acopcode.h +2 -2
index c6b2f42..324512d 100644
@@ -92,7 +92,7 @@
 #define ARGP_BYTELIST_OP                ARGP_LIST1 (ARGP_NAMESTRING)
 #define ARGP_CONCAT_OP                  ARGP_LIST3 (ARGP_TERMARG,    ARGP_TERMARG,       ARGP_TARGET)
 #define ARGP_CONCAT_RES_OP              ARGP_LIST3 (ARGP_TERMARG,    ARGP_TERMARG,       ARGP_TARGET)
-#define ARGP_COND_REF_OF_OP             ARGP_LIST2 (ARGP_SUPERNAME,  ARGP_SUPERNAME)
+#define ARGP_COND_REF_OF_OP             ARGP_LIST2 (ARGP_NAME_OR_REF,ARGP_TARGET)
 #define ARGP_CONNECTFIELD_OP            ARGP_LIST1 (ARGP_NAMESTRING)
 #define ARGP_CONTINUE_OP                ARG_NONE
 #define ARGP_COPY_OP                    ARGP_LIST2 (ARGP_TERMARG,    ARGP_SIMPLENAME)
@@ -159,7 +159,7 @@
 #define ARGP_POWER_RES_OP               ARGP_LIST5 (ARGP_PKGLENGTH,  ARGP_NAME,          ARGP_BYTEDATA,  ARGP_WORDDATA,  ARGP_OBJLIST)
 #define ARGP_PROCESSOR_OP               ARGP_LIST6 (ARGP_PKGLENGTH,  ARGP_NAME,          ARGP_BYTEDATA,  ARGP_DWORDDATA, ARGP_BYTEDATA,  ARGP_OBJLIST)
 #define ARGP_QWORD_OP                   ARGP_LIST1 (ARGP_QWORDDATA)
-#define ARGP_REF_OF_OP                  ARGP_LIST1 (ARGP_SUPERNAME)
+#define ARGP_REF_OF_OP                  ARGP_LIST1 (ARGP_NAME_OR_REF)
 #define ARGP_REGION_OP                  ARGP_LIST4 (ARGP_NAME,       ARGP_BYTEDATA,      ARGP_TERMARG,   ARGP_TERMARG)
 #define ARGP_RELEASE_OP                 ARGP_LIST1 (ARGP_SUPERNAME)
 #define ARGP_RESERVEDFIELD_OP           ARGP_LIST1 (ARGP_NAMESTRING)
Signature · 1 line
1.7.10
author
#32 lore raw

PATCH 32/42 ACPICA: Cleanup code related to the per-table module level improvement

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 071eff738c59eda1792ac24b3b688b61691d7e7c

This patch collects cleanups from per-table module level improvement. By splitting this patch from that commit, we can make per-table module level improvement clearer for the revewers. This is a no-op change.

---
 drivers/acpi/acpica/acglobal.h  |    1 +
 drivers/acpi/acpica/evhandler.c |  113 +++++++++++++++++++++++++--------------
 drivers/acpi/acpica/evregion.c  |    6 +++
 drivers/acpi/acpica/evrgnini.c  |    2 +-
 drivers/acpi/acpica/exdump.c    |    6 ++-
 drivers/acpi/acpica/utxfinit.c  |    7 +++
 6 files changed, 91 insertions(+), 44 deletions(-)
drivers/acpi/acpica/acglobal.h +1 -0
index 3977134..ef0abf4 100644
@@ -145,6 +145,7 @@ ACPI_GLOBAL(acpi_cache_t *, acpi_gbl_operand_cache);
 
 ACPI_INIT_GLOBAL(u32, acpi_gbl_startup_flags, 0);
 ACPI_INIT_GLOBAL(u8, acpi_gbl_shutdown, TRUE);
+ACPI_INIT_GLOBAL(u8, acpi_gbl_early_initialization, TRUE);
 
 /* Global handlers */
 
drivers/acpi/acpica/evhandler.c +72 -41

163 lines not on this page · raw message

drivers/acpi/acpica/evregion.c +6 -0
index 5ee79a1..6717e57 100644
@@ -127,6 +127,12 @@ acpi_status acpi_ev_initialize_op_regions(void)
  * DESCRIPTION: Dispatch an address space or operation region access to
  *              a previously installed handler.
  *
+ * NOTE: During early initialization, we always install the default region
+ * handlers for Memory, I/O and PCI_Config. This ensures that these operation
+ * region address spaces are always available as per the ACPI specification.
+ * This is especially needed in order to support the execution of
+ * module-level AML code during loading of the ACPI tables.
+ *
  ******************************************************************************/
 
 acpi_status
drivers/acpi/acpica/evrgnini.c +1 -1
index da32339..6181f5a 100644
@@ -552,7 +552,7 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
 
 	/*
 	 * The following loop depends upon the root Node having no parent
-	 * ie: acpi_gbl_root_node->parent_entry being set to NULL
+	 * ie: acpi_gbl_root_node->Parent being set to NULL
 	 */
 	while (node) {
 
drivers/acpi/acpica/exdump.c +4 -2
index d836f88..ff976c4 100644
@@ -508,7 +508,8 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
 			if (next) {
 				acpi_os_printf("(%s %2.2X)",
 					       acpi_ut_get_object_type_name
-					       (next), next->common.type);
+					       (next),
+					       next->address_space.space_id);
 
 				while (next->address_space.next) {
 					if ((next->common.type ==
@@ -520,7 +521,8 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
 					acpi_os_printf("->%p(%s %2.2X)", next,
 						       acpi_ut_get_object_type_name
 						       (next),
-						       next->common.type);
+						       next->address_space.
+						       space_id);
 
 					if ((next == start) || (next == data)) {
 						acpi_os_printf
drivers/acpi/acpica/utxfinit.c +7 -0
index a7137ec..8586260 100644
@@ -147,6 +147,13 @@ acpi_status __init acpi_enable_subsystem(u32 flags)
 
 	ACPI_FUNCTION_TRACE(acpi_enable_subsystem);
 
+	/*
+	 * The early initialization phase is complete. The namespace is loaded,
+	 * and we can now support address spaces other than Memory, I/O, and
+	 * PCI_Config.
+	 */
+	acpi_gbl_early_initialization = FALSE;
+
 #if (!ACPI_REDUCED_HARDWARE)
 
 	/* Enable ACPI mode */
Signature · 1 line
1.7.10
author
#33 lore raw

PATCH 33/42 ACPICA: Events: Deploys acpi_ev_find_region_handler()

In reply to Lv Zheng

ACPICA commit b916a0a0ae9e81db1a85523c63ec6aa32d5c70c8

There are code fragments that can be substituted by acpi_ev_find_region_handler().
This patch cleans up these code fragments. Lv Zheng.

---
 drivers/acpi/acpica/acevents.h  |    5 +++
 drivers/acpi/acpica/dbdisply.c  |   30 ++++++++--------
 drivers/acpi/acpica/evhandler.c |   58 ++++++++++++++-----------------
 drivers/acpi/acpica/evrgnini.c  |   73 +++++++++++++++++----------------------
 4 files changed, 75 insertions(+), 91 deletions(-)
drivers/acpi/acpica/acevents.h +5 -0
index 228704b7..42975ab 100644
@@ -161,6 +161,11 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
 /*
  * evhandler - Address space handling
  */
+union acpi_operand_object *acpi_ev_find_region_handler(acpi_adr_space_type
+						       space_id,
+						       union acpi_operand_object
+						       *handler_obj);
+
 u8
 acpi_ev_has_default_handler(struct acpi_namespace_node *node,
 			    acpi_adr_space_type space_id);
drivers/acpi/acpica/dbdisply.c +14 -16
index 390a7ca..a66b4ae 100644
@@ -48,6 +48,7 @@
 #include "acnamesp.h"
 #include "acparser.h"
 #include "acinterp.h"
+#include "acevents.h"
 #include "acdebug.h"
 
 #define _COMPONENT          ACPI_CA_DEBUGGER
@@ -949,28 +950,25 @@ void acpi_db_display_handlers(void)
 	if (obj_desc) {
 		for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_gbl_space_id_list); i++) {
 			space_id = acpi_gbl_space_id_list[i];
-			handler_obj = obj_desc->device.handler;
 
 			acpi_os_printf(ACPI_PREDEFINED_PREFIX,
 				       acpi_ut_get_region_name((u8)space_id),
 				       space_id);
 
-			while (handler_obj) {
-				if (acpi_gbl_space_id_list[i] ==
-				    handler_obj->address_space.space_id) {
-					acpi_os_printf
-					    (ACPI_HANDLER_PRESENT_STRING,
-					     (handler_obj->address_space.
-					      handler_flags &
-					      ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)
-					     ? "Default" : "User",
-					     handler_obj->address_space.
-					     handler);
-
-					goto found_handler;
-				}
+			handler_obj =
+			    acpi_ev_find_region_handler(space_id,
+							obj_desc->device.
+							handler);
+			if (handler_obj) {
+				acpi_os_printf(ACPI_HANDLER_PRESENT_STRING,
+					       (handler_obj->address_space.
+						handler_flags &
+						ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)
+					       ? "Default" : "User",
+					       handler_obj->address_space.
+					       handler);
 
-				handler_obj = handler_obj->address_space.next;
+				goto found_handler;
 			}
 
 			/* There is no handler for this space_id */
drivers/acpi/acpica/evhandler.c +25 -33

79 lines not on this page · raw message

drivers/acpi/acpica/evrgnini.c +31 -42

91 lines not on this page · raw message

Signature · 1 line
1.7.10
author
#34 lore raw

PATCH 34/42 ACPICA: Events: Uses common_notify for address space handlers

In reply to Lv Zheng

ACPICA commit 5ea0fb75fdf1aa7c0aba067dfa4d5dc3a9279461

The address space handlers can be attached to not only Device but also Processor/thermal_zone objects, so it is better to use their common class 'CommonNotify' instead. Lv Zheng.

---
 drivers/acpi/acpica/dbdisply.c  |    6 +++---
 drivers/acpi/acpica/evhandler.c |   12 +++++++-----
 drivers/acpi/acpica/evrgnini.c  |   10 +---------
 drivers/acpi/acpica/evxfregn.c  |    4 ++--
 4 files changed, 13 insertions(+), 19 deletions(-)
drivers/acpi/acpica/dbdisply.c +3 -3
index a66b4ae..1965b48 100644
@@ -957,7 +957,7 @@ void acpi_db_display_handlers(void)
 
 			handler_obj =
 			    acpi_ev_find_region_handler(space_id,
-							obj_desc->device.
+							obj_desc->common_notify.
 							handler);
 			if (handler_obj) {
 				acpi_os_printf(ACPI_HANDLER_PRESENT_STRING,
@@ -980,7 +980,7 @@ found_handler:		;
 
 		/* Find all handlers for user-defined space_IDs */
 
-		handler_obj = obj_desc->device.handler;
+		handler_obj = obj_desc->common_notify.handler;
 		while (handler_obj) {
 			if (handler_obj->address_space.space_id >=
 			    ACPI_USER_REGION_BEGIN) {
@@ -1082,7 +1082,7 @@ acpi_db_display_non_root_handlers(acpi_handle obj_handle,
 
 	/* Display all handlers associated with this device */
 
-	handler_obj = obj_desc->device.handler;
+	handler_obj = obj_desc->common_notify.handler;
 	while (handler_obj) {
 		acpi_os_printf(ACPI_PREDEFINED_PREFIX,
 			       acpi_ut_get_region_name((u8)handler_obj->
drivers/acpi/acpica/evhandler.c +7 -5
index 6a7fc11..709419c 100644
@@ -159,7 +159,7 @@ acpi_ev_has_default_handler(struct acpi_namespace_node *node,
 
 	obj_desc = acpi_ns_get_attached_object(node);
 	if (obj_desc) {
-		handler_obj = obj_desc->device.handler;
+		handler_obj = obj_desc->common_notify.handler;
 
 		/* Walk the linked list of handlers for this object */
 
@@ -250,7 +250,8 @@ acpi_ev_install_handler(acpi_handle obj_handle,
 		next_handler_obj =
 		    acpi_ev_find_region_handler(handler_obj->address_space.
 						space_id,
-						obj_desc->device.handler);
+						obj_desc->common_notify.
+						handler);
 		if (next_handler_obj) {
 
 			/* Found a handler, is it for the same address space? */
@@ -444,7 +445,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
 		 * the handler is not already installed.
 		 */
 		handler_obj = acpi_ev_find_region_handler(space_id,
-							  obj_desc->device.
+							  obj_desc->
+							  common_notify.
 							  handler);
 
 		if (handler_obj) {
@@ -531,13 +533,13 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
 
 	/* Install at head of Device.address_space list */
 
-	handler_obj->address_space.next = obj_desc->device.handler;
+	handler_obj->address_space.next = obj_desc->common_notify.handler;
 
 	/*
 	 * The Device object is the first reference on the handler_obj.
 	 * Each region that uses the handler adds a reference.
 	 */
-	obj_desc->device.handler = handler_obj;
+	obj_desc->common_notify.handler = handler_obj;
 
 	/*
 	 * Walk the namespace finding all of the regions this handler will
drivers/acpi/acpica/evrgnini.c +1 -9
index 4df81b5..024689d 100644
@@ -566,18 +566,10 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
 
 			switch (node->type) {
 			case ACPI_TYPE_DEVICE:
-
-				handler_obj = obj_desc->device.handler;
-				break;
-
 			case ACPI_TYPE_PROCESSOR:
-
-				handler_obj = obj_desc->processor.handler;
-				break;
-
 			case ACPI_TYPE_THERMAL:
 
-				handler_obj = obj_desc->thermal_zone.handler;
+				handler_obj = obj_desc->common_notify.handler;
 				break;
 
 			case ACPI_TYPE_METHOD:
drivers/acpi/acpica/evxfregn.c +2 -2
index dbd9f16..3c90508 100644
@@ -216,8 +216,8 @@ acpi_remove_address_space_handler(acpi_handle device,
 
 	/* Find the address handler the user requested */
 
-	handler_obj = obj_desc->device.handler;
-	last_obj_ptr = &obj_desc->device.handler;
+	handler_obj = obj_desc->common_notify.handler;
+	last_obj_ptr = &obj_desc->common_notify.handler;
 	while (handler_obj) {
 
 		/* We have a handler, see if user requested this one */
Signature · 1 line
1.7.10
author
#35 lore raw

PATCH 35/42 ACPICA: Utilities: Reorder initialization code

In reply to Lv Zheng

ACPICA commit 3894fa9d071343e6ebc7ea480255fa4f27a290be

This patch re-orders initialization code in acpi_enable_subsystem() so that all hardware reduced stuffs can be collected together.

Note this patch contains code from the following 2 ACPICA upstream commits so that the changes can be made clearer for the reviewers:
https://github.com/acpica/acpica/commit/071eff73
https://github.com/acpica/acpica/commit/3894fa9d
And additional change to remove the global variable and unused code fragments due to the test result. Lv Zheng.

---
 drivers/acpi/acpica/utxfinit.c |   31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)
drivers/acpi/acpica/utxfinit.c +15 -16
index 8586260..7d8eb60 100644
@@ -154,6 +154,21 @@ acpi_status __init acpi_enable_subsystem(u32 flags)
 	 */
 	acpi_gbl_early_initialization = FALSE;
 
+	/*
+	 * Install the default operation region handlers. These are the
+	 * handlers that are defined by the ACPI specification to be
+	 * "always accessible" -- namely, system_memory, system_IO, and
+	 * PCI_Config. This also means that no _REG methods need to be
+	 * run for these address spaces. We need to have these handlers
+	 * installed before any AML code can be executed, especially any
+	 * module-level code (11/2015).
+	 */
+	status = acpi_ev_install_region_handlers();
+	if (ACPI_FAILURE(status)) {
+		ACPI_EXCEPTION((AE_INFO, status,
+				"During Region initialization"));
+		return_ACPI_STATUS(status);
+	}
 #if (!ACPI_REDUCED_HARDWARE)
 
 	/* Enable ACPI mode */
@@ -182,24 +197,8 @@ acpi_status __init acpi_enable_subsystem(u32 flags)
 			return_ACPI_STATUS(status);
 		}
 	}
-#endif				/* !ACPI_REDUCED_HARDWARE */
 
 	/*
-	 * Install the default op_region handlers. These are installed unless
-	 * other handlers have already been installed via the
-	 * install_address_space_handler interface.
-	 */
-	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "[Init] Installing default address space handlers\n"));
-
-		status = acpi_ev_install_region_handlers();
-		if (ACPI_FAILURE(status)) {
-			return_ACPI_STATUS(status);
-		}
-	}
-#if (!ACPI_REDUCED_HARDWARE)
-	/*
 	 * Initialize ACPI Event handling (Fixed and General Purpose)
 	 *
 	 * Note1: We must have the hardware and events initialized before we can
Signature · 1 line
1.7.10
author
#36 lore raw

PATCH 36/42 ACPICA: Events: Fix an issue that region object is re-attached to another scope when it is already attached

In reply to Lv Zheng

ACPICA commit 6ebcb24d3225b6c7715a3ce061c327b4c3a6b76e

The logic in acpi_ev_attach_region() is not correct, it can break address space handler link. This patch fixes this problem. But be aware that this fix must be applied along with a region object race issue fix. Lv Zheng.

---
 drivers/acpi/acpica/evregion.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/acpi/acpica/evregion.c +6 -7
index 6717e57..19a4e69 100644
@@ -504,6 +504,12 @@ acpi_ev_attach_region(union acpi_operand_object *handler_obj,
 
 	ACPI_FUNCTION_TRACE(ev_attach_region);
 
+	/* Install the region's handler */
+
+	if (region_obj->region.handler) {
+		return_ACPI_STATUS(AE_ALREADY_EXISTS);
+	}
+
 	ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
 			  "Adding Region [%4.4s] %p to address handler %p [%s]\n",
 			  acpi_ut_get_node_name(region_obj->region.node),
@@ -515,13 +521,6 @@ acpi_ev_attach_region(union acpi_operand_object *handler_obj,
 
 	region_obj->region.next = handler_obj->address_space.region_list;
 	handler_obj->address_space.region_list = region_obj;
-
-	/* Install the region's handler */
-
-	if (region_obj->region.handler) {
-		return_ACPI_STATUS(AE_ALREADY_EXISTS);
-	}
-
 	region_obj->region.handler = handler_obj;
 	acpi_ut_add_reference(handler_obj);
 
Signature · 1 line
1.7.10
author
#37 lore raw

PATCH 37/42 ACPICA: Events: Split acpi_ev_associate_reg_method() from region initialization code

In reply to Lv Zheng

ACPICA commit 87c85610250ff7141a84507f68dbc1e00f2936db

This patch introduces a new region initialization function acpi_ev_associate_reg_method(), which is invoked to associate the _REG method to its related region object.

Region object's default value assignments are also sorted by cleaning up the code using this new function. Lv Zheng.

---
 drivers/acpi/acpica/acevents.h |    2 ++
 drivers/acpi/acpica/evregion.c |   46 ++++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/evrgnini.c |   30 ++------------------------
 drivers/acpi/acpica/excreate.c |    6 +++++-
 4 files changed, 55 insertions(+), 29 deletions(-)
drivers/acpi/acpica/acevents.h +2 -0
index 42975ab..772ee3c 100644
@@ -198,6 +198,8 @@ void
 acpi_ev_detach_region(union acpi_operand_object *region_obj,
 		      u8 acpi_ns_is_locked);
 
+void acpi_ev_associate_reg_method(union acpi_operand_object *region_obj);
+
 acpi_status
 acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
 			    acpi_adr_space_type space_id);
drivers/acpi/acpica/evregion.c +46 -0

52 lines not on this page · raw message

drivers/acpi/acpica/evrgnini.c +2 -28
index 024689d..bb2e529 100644
@@ -507,9 +507,6 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
 	acpi_adr_space_type space_id;
 	struct acpi_namespace_node *node;
 	acpi_status status;
-	struct acpi_namespace_node *method_node;
-	acpi_name *reg_name_ptr = (acpi_name *) METHOD_NAME__REG;
-	union acpi_operand_object *region_obj2;
 
 	ACPI_FUNCTION_TRACE_U32(ev_initialize_region, acpi_ns_locked);
 
@@ -521,35 +518,12 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
 		return_ACPI_STATUS(AE_OK);
 	}
 
-	region_obj2 = acpi_ns_get_secondary_object(region_obj);
-	if (!region_obj2) {
-		return_ACPI_STATUS(AE_NOT_EXIST);
-	}
+	acpi_ev_associate_reg_method(region_obj);
+	region_obj->common.flags |= AOPOBJ_OBJECT_INITIALIZED;
 
 	node = region_obj->region.node->parent;
 	space_id = region_obj->region.space_id;
 
-	/* Setup defaults */
-
-	region_obj->region.handler = NULL;
-	region_obj2->extra.method_REG = NULL;
-	region_obj->common.flags &= ~(AOPOBJ_SETUP_COMPLETE);
-	region_obj->common.flags |= AOPOBJ_OBJECT_INITIALIZED;
-
-	/* Find any "_REG" method associated with this region definition */
-
-	status =
-	    acpi_ns_search_one_scope(*reg_name_ptr, node, ACPI_TYPE_METHOD,
-				     &method_node);
-	if (ACPI_SUCCESS(status)) {
-		/*
-		 * The _REG method is optional and there can be only one per region
-		 * definition. This will be executed when the handler is attached
-		 * or removed
-		 */
-		region_obj2->extra.method_REG = method_node;
-	}
-
 	/*
 	 * The following loop depends upon the root Node having no parent
 	 * ie: acpi_gbl_root_node->Parent being set to NULL
drivers/acpi/acpica/excreate.c +5 -1
index 0f34446..6a1396e 100644
@@ -326,9 +326,10 @@ acpi_ex_create_region(u8 * aml_start,
 	 * Remember location in AML stream of address & length
 	 * operands since they need to be evaluated at run time.
 	 */
-	region_obj2 = obj_desc->common.next_object;
+	region_obj2 = acpi_ns_get_secondary_object(obj_desc);
 	region_obj2->extra.aml_start = aml_start;
 	region_obj2->extra.aml_length = aml_length;
+	region_obj2->extra.method_REG = NULL;
 	if (walk_state->scope_info) {
 		region_obj2->extra.scope_node =
 		    walk_state->scope_info->scope.node;
@@ -342,6 +343,9 @@ acpi_ex_create_region(u8 * aml_start,
 	obj_desc->region.address = 0;
 	obj_desc->region.length = 0;
 	obj_desc->region.node = node;
+	obj_desc->region.handler = NULL;
+	obj_desc->common.flags &=
+	    ~(AOPOBJ_SETUP_COMPLETE | AOPOBJ_OBJECT_INITIALIZED);
 
 	/* Install the new region object in the parent Node */
 
Signature · 1 line
1.7.10
author
#38 lore raw

PATCH 38/42 ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no _REG evaluations can happen during OS early boot stages

In reply to Lv Zheng

ACPICA commit 31178590dde82368fdb0f6b0e466b6c0add96c57

We can ensure no early _REG evaluations by ensuring the following rules in acpi_ev_execute_reg_method():
1. If an address space handler is installed during early stage, _REG(CONNECT) evaluations are blocked. This is achieved using acpi_gbl_reg_methods_enabled which is renamed from acpi_gbl_reg_methods_executed.
2. If _REG(CONNECT) has never been evalauted for the region object, _REG(DISCONNECT) evaluations are blocked. This is achieved by a new region object flag: AOPOBJ_REG_CONNECTED.
Note that, after applying this patch, we can ensure _REG(DISCONNECT) is always paired to _REG(CONNECT). Lv Zheng

---
 drivers/acpi/acpica/acglobal.h |    2 +-
 drivers/acpi/acpica/acobject.h |    7 ++++---
 drivers/acpi/acpica/evregion.c |   25 ++++++++++++++++++++++---
 drivers/acpi/acpica/evxfregn.c |   33 ---------------------------------
 drivers/acpi/acpica/excreate.c |    3 ++-
 drivers/acpi/acpica/utinit.c   |    1 -
 drivers/acpi/acpica/utxfinit.c |    1 +
 7 files changed, 30 insertions(+), 42 deletions(-)
drivers/acpi/acpica/acglobal.h +1 -1
index ef0abf4..73462ca 100644
@@ -165,7 +165,7 @@ ACPI_GLOBAL(u8, acpi_gbl_next_owner_id_offset);
 
 /* Initialization sequencing */
 
-ACPI_GLOBAL(u8, acpi_gbl_reg_methods_executed);
+ACPI_INIT_GLOBAL(u8, acpi_gbl_reg_methods_enabled, FALSE);
 
 /* Misc */
 
drivers/acpi/acpica/acobject.h +4 -3
index 0bd02c4..2b154cf 100644
@@ -93,9 +93,10 @@
 #define AOPOBJ_AML_CONSTANT         0x01	/* Integer is an AML constant */
 #define AOPOBJ_STATIC_POINTER       0x02	/* Data is part of an ACPI table, don't delete */
 #define AOPOBJ_DATA_VALID           0x04	/* Object is initialized and data is valid */
-#define AOPOBJ_OBJECT_INITIALIZED   0x08	/* Region is initialized, _REG was run */
-#define AOPOBJ_SETUP_COMPLETE       0x10	/* Region setup is complete */
-#define AOPOBJ_INVALID              0x20	/* Host OS won't allow a Region address */
+#define AOPOBJ_OBJECT_INITIALIZED   0x08	/* Region is initialized */
+#define AOPOBJ_REG_CONNECTED        0x10	/* _REG was run */
+#define AOPOBJ_SETUP_COMPLETE       0x20	/* Region setup is complete */
+#define AOPOBJ_INVALID              0x40	/* Host OS won't allow a Region address */
 
 /******************************************************************************
  *
drivers/acpi/acpica/evregion.c +22 -3
index 432b810..cf6e878 100644
@@ -104,8 +104,6 @@ acpi_status acpi_ev_initialize_op_regions(void)
 		}
 	}
 
-	acpi_gbl_reg_methods_executed = TRUE;
-
 	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 	return_ACPI_STATUS(status);
 }
@@ -601,7 +599,18 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
 		return_ACPI_STATUS(AE_NOT_EXIST);
 	}
 
-	if (region_obj2->extra.method_REG == NULL) {
+	if (region_obj2->extra.method_REG == NULL ||
+	    region_obj->region.handler == NULL ||
+	    !acpi_gbl_reg_methods_enabled) {
+		return_ACPI_STATUS(AE_OK);
+	}
+
+	/* _REG(DISCONNECT) should be paired with _REG(CONNECT) */
+
+	if ((function == ACPI_REG_CONNECT &&
+	     region_obj->common.flags & AOPOBJ_REG_CONNECTED) ||
+	    (function == ACPI_REG_DISCONNECT &&
+	     !(region_obj->common.flags & AOPOBJ_REG_CONNECTED))) {
 		return_ACPI_STATUS(AE_OK);
 	}
 
@@ -650,6 +659,16 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
 	status = acpi_ns_evaluate(info);
 	acpi_ut_remove_reference(args[1]);
 
+	if (ACPI_FAILURE(status)) {
+		goto cleanup2;
+	}
+
+	if (function == ACPI_REG_CONNECT) {
+		region_obj->common.flags |= AOPOBJ_REG_CONNECTED;
+	} else {
+		region_obj->common.flags &= ~AOPOBJ_REG_CONNECTED;
+	}
+
 cleanup2:
 	acpi_ut_remove_reference(args[0]);
 
drivers/acpi/acpica/evxfregn.c +0 -33
index 3c90508..29f9f39 100644
@@ -112,39 +112,6 @@ acpi_install_address_space_handler(acpi_handle device,
 		goto unlock_and_exit;
 	}
 
-	/*
-	 * For the default space_IDs, (the IDs for which there are default region handlers
-	 * installed) Only execute the _REG methods if the global initialization _REG
-	 * methods have already been run (via acpi_initialize_objects). In other words,
-	 * we will defer the execution of the _REG methods for these space_IDs until
-	 * execution of acpi_initialize_objects. This is done because we need the handlers
-	 * for the default spaces (mem/io/pci/table) to be installed before we can run
-	 * any control methods (or _REG methods). There is known BIOS code that depends
-	 * on this.
-	 *
-	 * For all other space_IDs, we can safely execute the _REG methods immediately.
-	 * This means that for IDs like embedded_controller, this function should be called
-	 * only after acpi_enable_subsystem has been called.
-	 */
-	switch (space_id) {
-	case ACPI_ADR_SPACE_SYSTEM_MEMORY:
-	case ACPI_ADR_SPACE_SYSTEM_IO:
-	case ACPI_ADR_SPACE_PCI_CONFIG:
-	case ACPI_ADR_SPACE_DATA_TABLE:
-
-		if (!acpi_gbl_reg_methods_executed) {
-
-			/* We will defer execution of the _REG methods for this space */
-
-			goto unlock_and_exit;
-		}
-		break;
-
-	default:
-
-		break;
-	}
-
 	/* Run all _REG methods for this address space */
 
 	status = acpi_ev_execute_reg_methods(node, space_id);
drivers/acpi/acpica/excreate.c +2 -1
index 6a1396e..46be5a2 100644
@@ -345,7 +345,8 @@ acpi_ex_create_region(u8 * aml_start,
 	obj_desc->region.node = node;
 	obj_desc->region.handler = NULL;
 	obj_desc->common.flags &=
-	    ~(AOPOBJ_SETUP_COMPLETE | AOPOBJ_OBJECT_INITIALIZED);
+	    ~(AOPOBJ_SETUP_COMPLETE | AOPOBJ_REG_CONNECTED |
+	      AOPOBJ_OBJECT_INITIALIZED);
 
 	/* Install the new region object in the parent Node */
 
drivers/acpi/acpica/utinit.c +0 -1
index ccd0745..fd82a12 100644
@@ -206,7 +206,6 @@ acpi_status acpi_ut_init_globals(void)
 	acpi_gbl_next_owner_id_offset = 0;
 	acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
 	acpi_gbl_osi_mutex = NULL;
-	acpi_gbl_reg_methods_executed = FALSE;
 	acpi_gbl_max_loop_iterations = 0xFFFF;
 
 	/* Hardware oriented */
drivers/acpi/acpica/utxfinit.c +1 -0
index 7d8eb60..1c7ed49 100644
@@ -267,6 +267,7 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 	 * initialized, even if they contain executable AML (see the call to
 	 * acpi_ns_initialize_objects below).
 	 */
+	acpi_gbl_reg_methods_enabled = TRUE;
 	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
 				  "[Init] Executing _REG OpRegion methods\n"));
Signature · 1 line
1.7.10
author
#39 lore raw

PATCH 39/42 ACPICA: Events: Introduce ACPI_REG_DISCONNECT invocation to acpi_ev_execute_reg_methods()

In reply to Lv Zheng

ACPICA commit 1cf1a1e090f61f0c27f1dcf1905c7cc79a9c51c8

It is likely that we should synchronously invoke _REG(DISCONNECT) only when the acpi_remove_address_space_handler() is invoked because of dependencies. If it is invoked when the object is not referenced, problem may occur if the operation region fields accessed in _REG are no longer driven by any device driver.

Noticed that _REG(CONNECT)/_REG(DISCONNECT) only mean to inform the AML of the handler availability, no return value is required for the caller.

This patch only introduces ACPI_REG_DISCONNECT invaocation, but doesn't introduce a real change. Lv Zheng.

---
 drivers/acpi/acpica/acevents.h |    4 ++--
 drivers/acpi/acpica/aclocal.h  |    1 +
 drivers/acpi/acpica/evregion.c |   26 +++++++++++++-------------
 drivers/acpi/acpica/evxfregn.c |    2 +-
 4 files changed, 17 insertions(+), 16 deletions(-)
drivers/acpi/acpica/acevents.h +2 -2
index 772ee3c..d18f184 100644
@@ -200,9 +200,9 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
 
 void acpi_ev_associate_reg_method(union acpi_operand_object *region_obj);
 
-acpi_status
+void
 acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
-			    acpi_adr_space_type space_id);
+			    acpi_adr_space_type space_id, u32 function);
 
 acpi_status
 acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function);
drivers/acpi/acpica/aclocal.h +1 -0
index 034402d..24928ec 100644
@@ -428,6 +428,7 @@ struct acpi_simple_repair_info {
 
 struct acpi_reg_walk_info {
 	acpi_adr_space_type space_id;
+	u32 function;
 	u32 reg_run_count;
 };
 
drivers/acpi/acpica/evregion.c +13 -13
index cf6e878..a43178f 100644
@@ -97,10 +97,9 @@ acpi_status acpi_ev_initialize_op_regions(void)
 		if (acpi_ev_has_default_handler(acpi_gbl_root_node,
 						acpi_gbl_default_address_spaces
 						[i])) {
-			status =
-			    acpi_ev_execute_reg_methods(acpi_gbl_root_node,
-							acpi_gbl_default_address_spaces
-							[i]);
+			acpi_ev_execute_reg_methods(acpi_gbl_root_node,
+						    acpi_gbl_default_address_spaces
+						    [i], ACPI_REG_CONNECT);
 		}
 	}
 
@@ -683,24 +682,25 @@ cleanup1:
  *
  * PARAMETERS:  node            - Namespace node for the device
  *              space_id        - The address space ID
+ *              function        - Passed to _REG: On (1) or Off (0)
  *
- * RETURN:      Status
+ * RETURN:      None
  *
  * DESCRIPTION: Run all _REG methods for the input Space ID;
  *              Note: assumes namespace is locked, or system init time.
  *
  ******************************************************************************/
 
-acpi_status
+void
 acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
-			    acpi_adr_space_type space_id)
+			    acpi_adr_space_type space_id, u32 function)
 {
-	acpi_status status;
 	struct acpi_reg_walk_info info;
 
 	ACPI_FUNCTION_TRACE(ev_execute_reg_methods);
 
 	info.space_id = space_id;
+	info.function = function;
 	info.reg_run_count = 0;
 
 	ACPI_DEBUG_PRINT_RAW((ACPI_DB_NAMES,
@@ -713,9 +713,9 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
 	 * regions and _REG methods. (i.e. handlers must be installed for all
 	 * regions of this Space ID before we can run any _REG methods)
 	 */
-	status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, node, ACPI_UINT32_MAX,
-					ACPI_NS_WALK_UNLOCK, acpi_ev_reg_run,
-					NULL, &info, NULL);
+	(void)acpi_ns_walk_namespace(ACPI_TYPE_ANY, node, ACPI_UINT32_MAX,
+				     ACPI_NS_WALK_UNLOCK, acpi_ev_reg_run, NULL,
+				     &info, NULL);
 
 	/* Special case for EC: handle "orphan" _REG methods with no region */
 
@@ -728,7 +728,7 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
 			      info.reg_run_count,
 			      acpi_ut_get_region_name(info.space_id)));
 
-	return_ACPI_STATUS(status);
+	return_VOID;
 }
 
 /*******************************************************************************
@@ -787,7 +787,7 @@ acpi_ev_reg_run(acpi_handle obj_handle,
 	}
 
 	info->reg_run_count++;
-	status = acpi_ev_execute_reg_method(obj_desc, ACPI_REG_CONNECT);
+	status = acpi_ev_execute_reg_method(obj_desc, info->function);
 	return (status);
 }
 
drivers/acpi/acpica/evxfregn.c +1 -1
index 29f9f39..35f9e60 100644
@@ -114,7 +114,7 @@ acpi_install_address_space_handler(acpi_handle device,
 
 	/* Run all _REG methods for this address space */
 
-	status = acpi_ev_execute_reg_methods(node, space_id);
+	acpi_ev_execute_reg_methods(node, space_id, ACPI_REG_CONNECT);
 
 unlock_and_exit:
 	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
Signature · 1 line
1.7.10
author
#40 lore raw

PATCH 40/42 ACPICA: Add "root node" case to the ACPI name repair code

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 95b40b31aa8148629fbe5de0356725fc01298003

Special-case the namespace root node, it has an unusual name. This case can occur if there are errors during the execution of module-level code.

---
 drivers/acpi/acpica/utstring.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/acpi/acpica/utstring.c +8 -0
index 0c2e2d2..958b2f7 100644
@@ -240,6 +240,14 @@ void acpi_ut_repair_name(char *name)
 
 	ACPI_FUNCTION_NAME(ut_repair_name);
 
+	/*
+	 * Special case for the root node. This can happen if we get an
+	 * error during the execution of module-level code.
+	 */
+	if (ACPI_COMPARE_NAME(name, "\\___")) {
+		return;
+	}
+
 	ACPI_MOVE_NAME(&original_name, name);
 
 	/* Check each character in the name */
Signature · 1 line
1.7.10
author
#41 lore raw

PATCH 41/42 ACPICA: Add per-table execution of module-level code

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 071eff738c59eda1792ac24b3b688b61691d7e7c

Execute any module-level code after each ACPI table (DSDT or SSDT) is loaded into the namespace (rather than after all AML tables have been loaded. This matches the behavior of other ACPI implementations and is required to support BIOS code that depends on this behavior.

---
 drivers/acpi/acpica/nsload.c   |   17 +++++++++++++++++
 drivers/acpi/acpica/utxfinit.c |    8 +++++++-
 include/acpi/acpixf.h          |    5 +++++
 3 files changed, 29 insertions(+), 1 deletion(-)
drivers/acpi/acpica/nsload.c +17 -0
index c106916..14c953e 100644
@@ -149,6 +149,23 @@ unlock:
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 			  "**** Completed Table Object Initialization\n"));
 
+	/*
+	 * Execute any module-level code that was detected during the table load
+	 * phase. Although illegal since ACPI 2.0, there are many machines that
+	 * contain this type of code. Each block of detected executable AML code
+	 * outside of any control method is wrapped with a temporary control
+	 * method object and placed on a global list. The methods on this list
+	 * are executed below.
+	 *
+	 * This case executes the module-level code for each table immediately
+	 * after the table has been loaded. This provides compatibility with
+	 * other ACPI implementations. Optionally, the execution can be deferred
+	 * until later, see acpi_initialize_objects.
+	 */
+	if (!acpi_gbl_group_module_level_code) {
+		acpi_ns_exec_module_code_list();
+	}
+
 	return_ACPI_STATUS(status);
 }
 
drivers/acpi/acpica/utxfinit.c +7 -1
index 1c7ed49..e38facd 100644
@@ -292,8 +292,14 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 	 * outside of any control method is wrapped with a temporary control
 	 * method object and placed on a global list. The methods on this list
 	 * are executed below.
+	 *
+	 * This case executes the module-level code for all tables only after
+	 * all of the tables have been loaded. It is a legacy option and is
+	 * not compatible with other ACPI implementations. See acpi_ns_load_table.
 	 */
-	acpi_ns_exec_module_code_list();
+	if (acpi_gbl_group_module_level_code) {
+		acpi_ns_exec_module_code_list();
+	}
 
 	/*
 	 * Initialize the objects that remain uninitialized. This runs the
include/acpi/acpixf.h +5 -0
index d60507b7..8c95e82 100644
@@ -190,6 +190,11 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
 ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
 
 /*
+ * Optionally support group module level code.
+ */
+ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, TRUE);
+
+/*
  * Optionally use 32-bit FADT addresses if and when there is a conflict
  * (address mismatch) between the 32-bit and 64-bit versions of the
  * address. Although ACPICA adheres to the ACPI specification which
Signature · 1 line
1.7.10
author
#42 lore raw

PATCH 42/42 ACPICA: Update version to 20151218

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit e81cedadd3a847d40f30bc9c52dfe441620ed12f

Version 20151218.

---
 include/acpi/acpixf.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
index 8c95e82..1b462d8 100644
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20150930
+#define ACPI_CA_VERSION                 0x20151218
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
Signature · 1 line
1.7.10
#43 lore raw
In reply to Lv Zheng
Quoted 97 lines · Lv Zheng

The 20151218 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. i386 + default + ACPI_DEBUGGER=y
2. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20150930 Release):
517 lines
After applying (20151218 Release):
506 lines

Bob Moore (25):
ACPICA: exmutex: General cleanup, restructured some code
ACPICA: Core: Major update for code formatting, no functional changes
ACPICA: Split interpreter tracing functions to a new file
ACPICA: acpiexec: Add support for AML files containing multiple
tables
ACPICA: Disassembler/tools: Support for multiple ACPI tables in one
file
ACPICA: iasl/acpiexec: Update input file handling and verification
ACPICA: Revert "acpi_get_object_info: Add support for ACPI 5.0 _SUB
method."
ACPICA: Add comment explaining _SUB removal
ACPICA: acpiexec/acpinames: Update for error checking macros
ACPICA: Concatenate operator: Add extensions to support all ACPI
objects
ACPICA: Debug Object: Cleanup output
ACPICA: Debug object: Fix output for a NULL object
ACPICA: Update for output of the Debug Object
ACPICA: getopt: Comment update, no functional change
ACPICA: Add new exception code, AE_IO_ERROR
ACPICA: iasl/Disassembler: Support ASL ElseIf operator
ACPICA: Parser: Add constants for internal namepath function
ACPICA: Parser: Fix for SuperName method invocation
ACPICA: Update parameter type for ObjectType operator
ACPICA: Update internal #defines for ObjectType operator. No
functional change
ACPICA: Update for CondRefOf and RefOf operators
ACPICA: Cleanup code related to the per-table module level
improvement
ACPICA: Add "root node" case to the ACPI name repair code
ACPICA: Add per-table execution of module-level code
ACPICA: Update version to 20151218

Colin Ian King (1):
ACPICA: Tools: Add spacing and missing options in acpibin tool

David E. Box (1):
ACPICA: Fix SyncLevel support interaction with method
auto-serialization

LABBE Corentin (1):
ACPICA: Add "const" to some functions that return fixed strings

Lv Zheng (12):
ACPICA: Linuxize: reduce divergences for 20151218 release
ACPICA: Namespace: Fix wrong error log
ACPICA: Debugger: reduce old external path format
ACPICA: Namespace: Add scope information to the simple object repair
mechanism
ACPICA: Namespace: Add String -> ObjectReference conversion support
ACPICA: Events: Deploys acpi_ev_find_region_handler()
ACPICA: Events: Uses common_notify for address space handlers
ACPICA: Utilities: Reorder initialization code
ACPICA: Events: Fix an issue that region object is re-attached to
another scope when it is already attached
ACPICA: Events: Split acpi_ev_associate_reg_method() from region
initialization code
ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no
_REG evaluations can happen during OS early boot stages
ACPICA: Events: Introduce ACPI_REG_DISCONNECT invocation to
acpi_ev_execute_reg_methods()

Quoted 5 lines

Markus Elfring (1):
ACPICA: Debugger: Remove some unecessary NULL checks

Prarit Bhargava (1):
ACPICA: acpi_get_sleep_type_data: Reduce warnings

Can you please send patch [8/42] again to me to the address I'm sending this message from?

It seems that it didn't make it to the mailing lists.

Thanks,
Rafael

#44 lore raw
Quoted 101 lines · Rafael J. Wysocki
Quoted 100 lines · Lv Zheng

The 20151218 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. i386 + default + ACPI_DEBUGGER=y
2. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20150930 Release):
517 lines
After applying (20151218 Release):
506 lines

Bob Moore (25):
ACPICA: exmutex: General cleanup, restructured some code
ACPICA: Core: Major update for code formatting, no functional changes
ACPICA: Split interpreter tracing functions to a new file
ACPICA: acpiexec: Add support for AML files containing multiple
tables
ACPICA: Disassembler/tools: Support for multiple ACPI tables in one
file
ACPICA: iasl/acpiexec: Update input file handling and verification
ACPICA: Revert "acpi_get_object_info: Add support for ACPI 5.0 _SUB
method."
ACPICA: Add comment explaining _SUB removal
ACPICA: acpiexec/acpinames: Update for error checking macros
ACPICA: Concatenate operator: Add extensions to support all ACPI
objects
ACPICA: Debug Object: Cleanup output
ACPICA: Debug object: Fix output for a NULL object
ACPICA: Update for output of the Debug Object
ACPICA: getopt: Comment update, no functional change
ACPICA: Add new exception code, AE_IO_ERROR
ACPICA: iasl/Disassembler: Support ASL ElseIf operator
ACPICA: Parser: Add constants for internal namepath function
ACPICA: Parser: Fix for SuperName method invocation
ACPICA: Update parameter type for ObjectType operator
ACPICA: Update internal #defines for ObjectType operator. No
functional change
ACPICA: Update for CondRefOf and RefOf operators
ACPICA: Cleanup code related to the per-table module level
improvement
ACPICA: Add "root node" case to the ACPI name repair code
ACPICA: Add per-table execution of module-level code
ACPICA: Update version to 20151218

Colin Ian King (1):
ACPICA: Tools: Add spacing and missing options in acpibin tool

David E. Box (1):
ACPICA: Fix SyncLevel support interaction with method
auto-serialization

LABBE Corentin (1):
ACPICA: Add "const" to some functions that return fixed strings

Lv Zheng (12):
ACPICA: Linuxize: reduce divergences for 20151218 release
ACPICA: Namespace: Fix wrong error log
ACPICA: Debugger: reduce old external path format
ACPICA: Namespace: Add scope information to the simple object repair
mechanism
ACPICA: Namespace: Add String -> ObjectReference conversion support
ACPICA: Events: Deploys acpi_ev_find_region_handler()
ACPICA: Events: Uses common_notify for address space handlers
ACPICA: Utilities: Reorder initialization code
ACPICA: Events: Fix an issue that region object is re-attached to
another scope when it is already attached
ACPICA: Events: Split acpi_ev_associate_reg_method() from region
initialization code
ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no
_REG evaluations can happen during OS early boot stages
ACPICA: Events: Introduce ACPI_REG_DISCONNECT invocation to
acpi_ev_execute_reg_methods()

Markus Elfring (1):
ACPICA: Debugger: Remove some unecessary NULL checks

Quoted 7 lines
Quoted 2 lines

Prarit Bhargava (1):
ACPICA: acpi_get_sleep_type_data: Reduce warnings

Can you please send patch [8/42] again to me to the address I'm sending this message from?

It seems that it didn't make it to the mailing lists.

OK, found it.

Thanks,
Rafael

author
#45 lore raw
In reply to Rafael J. Wysocki

Hi, Rafael

Quoted 105 lines

From: Rafael J. Wysocki [mailto:[email protected]]
Sent: Friday, January 1, 2016 11:05 AM
Subject: Re: [PATCH 00/42] ACPICA: 20151218 Release

Quoted 100 lines · Lv Zheng

The 20151218 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. i386 + default + ACPI_DEBUGGER=y
2. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20150930 Release):
517 lines
After applying (20151218 Release):
506 lines

Bob Moore (25):
ACPICA: exmutex: General cleanup, restructured some code
ACPICA: Core: Major update for code formatting, no functional changes
ACPICA: Split interpreter tracing functions to a new file
ACPICA: acpiexec: Add support for AML files containing multiple
tables
ACPICA: Disassembler/tools: Support for multiple ACPI tables in one
file
ACPICA: iasl/acpiexec: Update input file handling and verification
ACPICA: Revert "acpi_get_object_info: Add support for ACPI 5.0 _SUB
method."
ACPICA: Add comment explaining _SUB removal
ACPICA: acpiexec/acpinames: Update for error checking macros
ACPICA: Concatenate operator: Add extensions to support all ACPI
objects
ACPICA: Debug Object: Cleanup output
ACPICA: Debug object: Fix output for a NULL object
ACPICA: Update for output of the Debug Object
ACPICA: getopt: Comment update, no functional change
ACPICA: Add new exception code, AE_IO_ERROR
ACPICA: iasl/Disassembler: Support ASL ElseIf operator
ACPICA: Parser: Add constants for internal namepath function
ACPICA: Parser: Fix for SuperName method invocation
ACPICA: Update parameter type for ObjectType operator
ACPICA: Update internal #defines for ObjectType operator. No
functional change
ACPICA: Update for CondRefOf and RefOf operators
ACPICA: Cleanup code related to the per-table module level
improvement
ACPICA: Add "root node" case to the ACPI name repair code
ACPICA: Add per-table execution of module-level code
ACPICA: Update version to 20151218

Colin Ian King (1):
ACPICA: Tools: Add spacing and missing options in acpibin tool

David E. Box (1):
ACPICA: Fix SyncLevel support interaction with method
auto-serialization

LABBE Corentin (1):
ACPICA: Add "const" to some functions that return fixed strings

Lv Zheng (12):
ACPICA: Linuxize: reduce divergences for 20151218 release
ACPICA: Namespace: Fix wrong error log
ACPICA: Debugger: reduce old external path format
ACPICA: Namespace: Add scope information to the simple object repair
mechanism
ACPICA: Namespace: Add String -> ObjectReference conversion support
ACPICA: Events: Deploys acpi_ev_find_region_handler()
ACPICA: Events: Uses common_notify for address space handlers
ACPICA: Utilities: Reorder initialization code
ACPICA: Events: Fix an issue that region object is re-attached to
another scope when it is already attached
ACPICA: Events: Split acpi_ev_associate_reg_method() from region
initialization code
ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no
_REG evaluations can happen during OS early boot stages
ACPICA: Events: Introduce ACPI_REG_DISCONNECT invocation to
acpi_ev_execute_reg_methods()

Markus Elfring (1):
ACPICA: Debugger: Remove some unecessary NULL checks

Quoted 7 lines
Quoted 2 lines

Prarit Bhargava (1):
ACPICA: acpi_get_sleep_type_data: Reduce warnings

Can you please send patch [8/42] again to me to the address I'm sending this message from?

It seems that it didn't make it to the mailing lists.

[Lv Zheng]
OK.
I'll re-send it to "Rafael J. Wysocki <[email protected]>".

Thanks and best regards
-Lv

Quoted 3 lines

Thanks,
Rafael

#46 lore raw
In reply to Lv Zheng
Quoted 97 lines · Lv Zheng

The 20151218 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. i386 + default + ACPI_DEBUGGER=y
2. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20150930 Release):
517 lines
After applying (20151218 Release):
506 lines

Bob Moore (25):
ACPICA: exmutex: General cleanup, restructured some code
ACPICA: Core: Major update for code formatting, no functional changes
ACPICA: Split interpreter tracing functions to a new file
ACPICA: acpiexec: Add support for AML files containing multiple
tables
ACPICA: Disassembler/tools: Support for multiple ACPI tables in one
file
ACPICA: iasl/acpiexec: Update input file handling and verification
ACPICA: Revert "acpi_get_object_info: Add support for ACPI 5.0 _SUB
method."
ACPICA: Add comment explaining _SUB removal
ACPICA: acpiexec/acpinames: Update for error checking macros
ACPICA: Concatenate operator: Add extensions to support all ACPI
objects
ACPICA: Debug Object: Cleanup output
ACPICA: Debug object: Fix output for a NULL object
ACPICA: Update for output of the Debug Object
ACPICA: getopt: Comment update, no functional change
ACPICA: Add new exception code, AE_IO_ERROR
ACPICA: iasl/Disassembler: Support ASL ElseIf operator
ACPICA: Parser: Add constants for internal namepath function
ACPICA: Parser: Fix for SuperName method invocation
ACPICA: Update parameter type for ObjectType operator
ACPICA: Update internal #defines for ObjectType operator. No
functional change
ACPICA: Update for CondRefOf and RefOf operators
ACPICA: Cleanup code related to the per-table module level
improvement
ACPICA: Add "root node" case to the ACPI name repair code
ACPICA: Add per-table execution of module-level code
ACPICA: Update version to 20151218

Colin Ian King (1):
ACPICA: Tools: Add spacing and missing options in acpibin tool

David E. Box (1):
ACPICA: Fix SyncLevel support interaction with method
auto-serialization

LABBE Corentin (1):
ACPICA: Add "const" to some functions that return fixed strings

Lv Zheng (12):
ACPICA: Linuxize: reduce divergences for 20151218 release
ACPICA: Namespace: Fix wrong error log
ACPICA: Debugger: reduce old external path format
ACPICA: Namespace: Add scope information to the simple object repair
mechanism
ACPICA: Namespace: Add String -> ObjectReference conversion support
ACPICA: Events: Deploys acpi_ev_find_region_handler()
ACPICA: Events: Uses common_notify for address space handlers
ACPICA: Utilities: Reorder initialization code
ACPICA: Events: Fix an issue that region object is re-attached to
another scope when it is already attached
ACPICA: Events: Split acpi_ev_associate_reg_method() from region
initialization code
ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no
_REG evaluations can happen during OS early boot stages
ACPICA: Events: Introduce ACPI_REG_DISCONNECT invocation to
acpi_ev_execute_reg_methods()

Quoted 5 lines

Markus Elfring (1):
ACPICA: Debugger: Remove some unecessary NULL checks

Prarit Bhargava (1):
ACPICA: acpi_get_sleep_type_data: Reduce warnings

Series applied, thanks!

#47 lore raw
In reply to Lv Zheng

what is ACPICA and why should we care about divergence between it and the linux upstream? Where is it to be found?

This may be common knowlege to many people, but it should probably be documented in the patch bundle and it's explination.

David Lang

Quoted 254 lines · Lv Zheng

Date: Tue, 29 Dec 2015 13:52:19 +0800
From: Lv Zheng <[email protected]>
To: Rafael J. Wysocki <[email protected]>,
Len Brown <[email protected]>
Cc: Lv Zheng <[email protected]>, Lv Zheng <[email protected]>,
[email protected], [email protected]
Subject: [PATCH 00/42] ACPICA: 20151218 Release

The 20151218 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. i386 + default + ACPI_DEBUGGER=y
2. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20150930 Release):
517 lines
After applying (20151218 Release):
506 lines

Bob Moore (25):
ACPICA: exmutex: General cleanup, restructured some code
ACPICA: Core: Major update for code formatting, no functional changes
ACPICA: Split interpreter tracing functions to a new file
ACPICA: acpiexec: Add support for AML files containing multiple
tables
ACPICA: Disassembler/tools: Support for multiple ACPI tables in one
file
ACPICA: iasl/acpiexec: Update input file handling and verification
ACPICA: Revert "acpi_get_object_info: Add support for ACPI 5.0 _SUB
method."
ACPICA: Add comment explaining _SUB removal
ACPICA: acpiexec/acpinames: Update for error checking macros
ACPICA: Concatenate operator: Add extensions to support all ACPI
objects
ACPICA: Debug Object: Cleanup output
ACPICA: Debug object: Fix output for a NULL object
ACPICA: Update for output of the Debug Object
ACPICA: getopt: Comment update, no functional change
ACPICA: Add new exception code, AE_IO_ERROR
ACPICA: iasl/Disassembler: Support ASL ElseIf operator
ACPICA: Parser: Add constants for internal namepath function
ACPICA: Parser: Fix for SuperName method invocation
ACPICA: Update parameter type for ObjectType operator
ACPICA: Update internal #defines for ObjectType operator. No
functional change
ACPICA: Update for CondRefOf and RefOf operators
ACPICA: Cleanup code related to the per-table module level
improvement
ACPICA: Add "root node" case to the ACPI name repair code
ACPICA: Add per-table execution of module-level code
ACPICA: Update version to 20151218

Colin Ian King (1):
ACPICA: Tools: Add spacing and missing options in acpibin tool

David E. Box (1):
ACPICA: Fix SyncLevel support interaction with method
auto-serialization

LABBE Corentin (1):
ACPICA: Add "const" to some functions that return fixed strings

Lv Zheng (12):
ACPICA: Linuxize: reduce divergences for 20151218 release
ACPICA: Namespace: Fix wrong error log
ACPICA: Debugger: reduce old external path format
ACPICA: Namespace: Add scope information to the simple object repair
mechanism
ACPICA: Namespace: Add String -> ObjectReference conversion support
ACPICA: Events: Deploys acpi_ev_find_region_handler()
ACPICA: Events: Uses common_notify for address space handlers
ACPICA: Utilities: Reorder initialization code
ACPICA: Events: Fix an issue that region object is re-attached to
another scope when it is already attached
ACPICA: Events: Split acpi_ev_associate_reg_method() from region
initialization code
ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no
_REG evaluations can happen during OS early boot stages
ACPICA: Events: Introduce ACPI_REG_DISCONNECT invocation to
acpi_ev_execute_reg_methods()

Markus Elfring (1):
ACPICA: Debugger: Remove some unecessary NULL checks

Prarit Bhargava (1):
ACPICA: acpi_get_sleep_type_data: Reduce warnings

drivers/acpi/acpica/Makefile                       |    4 +-
drivers/acpi/acpica/acapps.h                       |   58 +-
drivers/acpi/acpica/acdebug.h                      |    5 +-
drivers/acpi/acpica/acevents.h                     |   11 +-
drivers/acpi/acpica/acglobal.h                     |    3 +-
drivers/acpi/acpica/aclocal.h                      |   12 +-
drivers/acpi/acpica/acnamesp.h                     |   12 +-
drivers/acpi/acpica/acobject.h                     |    7 +-
drivers/acpi/acpica/acopcode.h                     |   10 +-
drivers/acpi/acpica/acparser.h                     |    8 +-
drivers/acpi/acpica/acutils.h                      |   26 +-
drivers/acpi/acpica/amlcode.h                      |    5 +-
drivers/acpi/acpica/dbcmds.c                       |   11 +-
drivers/acpi/acpica/dbdisply.c                     |   84 ++-
drivers/acpi/acpica/dbfileio.c                     |  123 +---
drivers/acpi/acpica/dbinput.c                      |   22 +-
drivers/acpi/acpica/dbnames.c                      |    2 +-
drivers/acpi/acpica/dbstats.c                      |    1 +
drivers/acpi/acpica/dbtest.c                       |    2 +-
drivers/acpi/acpica/dbutils.c                      |    1 +
drivers/acpi/acpica/dsargs.c                       |    7 +-
drivers/acpi/acpica/dsdebug.c                      |    5 +-
drivers/acpi/acpica/dsfield.c                      |   39 +-
drivers/acpi/acpica/dsinit.c                       |    2 +-
drivers/acpi/acpica/dsmethod.c                     |   39 +-
drivers/acpi/acpica/dsmthdat.c                     |   20 +-
drivers/acpi/acpica/dsobject.c                     |   19 +-
drivers/acpi/acpica/dsopcode.c                     |   21 +-
drivers/acpi/acpica/dsutils.c                      |   29 +-
drivers/acpi/acpica/dswexec.c                      |   19 +-
drivers/acpi/acpica/dswload.c                      |   10 +-
drivers/acpi/acpica/dswload2.c                     |   10 +-
drivers/acpi/acpica/dswscope.c                     |    1 +
drivers/acpi/acpica/evgpe.c                        |    2 +-
drivers/acpi/acpica/evgpeblk.c                     |    1 +
drivers/acpi/acpica/evgpeutil.c                    |    1 +
drivers/acpi/acpica/evhandler.c                    |  165 +++---
drivers/acpi/acpica/evmisc.c                       |    5 +-
drivers/acpi/acpica/evregion.c                     |  114 +++-
drivers/acpi/acpica/evrgnini.c                     |  115 ++--
drivers/acpi/acpica/evxface.c                      |    9 +-
drivers/acpi/acpica/evxfregn.c                     |   38 +-
drivers/acpi/acpica/exconfig.c                     |    8 +-
drivers/acpi/acpica/exconvrt.c                     |    9 +-
drivers/acpi/acpica/excreate.c                     |   20 +-
drivers/acpi/acpica/exdebug.c                      |  403 ++-----------
drivers/acpi/acpica/exdump.c                       |    6 +-
drivers/acpi/acpica/exfield.c                      |   74 +--
drivers/acpi/acpica/exfldio.c                      |   35 +-
drivers/acpi/acpica/exmisc.c                       |   49 +-
drivers/acpi/acpica/exmutex.c                      |   82 ++-
drivers/acpi/acpica/exnames.c                      |    4 +-
drivers/acpi/acpica/exoparg1.c                     |   33 +-
drivers/acpi/acpica/exoparg2.c                     |   12 +-
drivers/acpi/acpica/exoparg3.c                     |   25 +-
drivers/acpi/acpica/exoparg6.c                     |    1 +
drivers/acpi/acpica/exprep.c                       |   25 +-
drivers/acpi/acpica/exregion.c                     |   13 +-
drivers/acpi/acpica/exresnte.c                     |    2 +-
drivers/acpi/acpica/exresolv.c                     |   10 +-
drivers/acpi/acpica/exresop.c                      |   43 +-
drivers/acpi/acpica/exstore.c                      |   17 +-
drivers/acpi/acpica/exstorob.c                     |    7 +-
drivers/acpi/acpica/exsystem.c                     |    6 +-
drivers/acpi/acpica/extrace.c                      |  377 ++++++++++++
drivers/acpi/acpica/exutils.c                      |    7 +-
drivers/acpi/acpica/hwesleep.c                     |    4 +-
drivers/acpi/acpica/hwgpe.c                        |    6 +-
drivers/acpi/acpica/hwsleep.c                      |    4 +-
drivers/acpi/acpica/hwxface.c                      |   24 +-
drivers/acpi/acpica/hwxfsleep.c                    |    1 +
drivers/acpi/acpica/nsconvert.c                    |  105 +++-
drivers/acpi/acpica/nsdump.c                       |    5 +-
drivers/acpi/acpica/nseval.c                       |    2 +-
drivers/acpi/acpica/nsinit.c                       |    3 +-
drivers/acpi/acpica/nsload.c                       |   18 +-
drivers/acpi/acpica/nsnames.c                      |    6 +-
drivers/acpi/acpica/nsparse.c                      |    5 +-
drivers/acpi/acpica/nsprepkg.c                     |   10 +-
drivers/acpi/acpica/nsrepair.c                     |   19 +-
drivers/acpi/acpica/nsrepair2.c                    |   24 +-
drivers/acpi/acpica/nssearch.c                     |    2 +-
drivers/acpi/acpica/nsutils.c                      |    8 +-
drivers/acpi/acpica/nsxfeval.c                     |    4 +-
drivers/acpi/acpica/nsxfname.c                     |   39 +-
drivers/acpi/acpica/nsxfobj.c                      |    6 +-
drivers/acpi/acpica/psargs.c                       |   19 +-
drivers/acpi/acpica/psloop.c                       |   12 +-
drivers/acpi/acpica/psopcode.c                     |  606 ++++++++++----------
drivers/acpi/acpica/psparse.c                      |    8 +-
drivers/acpi/acpica/psutils.c                      |    4 +-
drivers/acpi/acpica/pswalk.c                       |    1 +
drivers/acpi/acpica/rsaddr.c                       |    4 +-
drivers/acpi/acpica/rscalc.c                       |   81 +--
drivers/acpi/acpica/rscreate.c                     |   32 +-
drivers/acpi/acpica/rsdump.c                       |    6 +
drivers/acpi/acpica/rslist.c                       |    9 +-
drivers/acpi/acpica/rsmisc.c                       |   22 +-
drivers/acpi/acpica/rsutils.c                      |   42 +-
drivers/acpi/acpica/rsxface.c                      |    2 +-
drivers/acpi/acpica/tbdata.c                       |    1 +
drivers/acpi/acpica/tbinstal.c                     |    4 +-
drivers/acpi/acpica/tbprint.c                      |    1 +
drivers/acpi/acpica/tbutils.c                      |   10 +-
drivers/acpi/acpica/tbxfload.c                     |    3 +-
drivers/acpi/acpica/utaddress.c                    |    5 +-
drivers/acpi/acpica/utcopy.c                       |   23 +-
drivers/acpi/acpica/utdecode.c                     |   32 +-
drivers/acpi/acpica/utdelete.c                     |    5 +-
drivers/acpi/acpica/uterror.c                      |   10 +-
drivers/acpi/acpica/utfileio.c                     |  334 -----------
drivers/acpi/acpica/uthex.c                        |    2 +-
drivers/acpi/acpica/utids.c                        |   67 ---
drivers/acpi/acpica/utinit.c                       |    1 -
drivers/acpi/acpica/utmath.c                       |   10 +-
drivers/acpi/acpica/utmisc.c                       |   11 +-
drivers/acpi/acpica/utmutex.c                      |    5 +-
drivers/acpi/acpica/utnonansi.c                    |    4 +-
drivers/acpi/acpica/utobject.c                     |   24 +-
drivers/acpi/acpica/utosi.c                        |   11 +-
drivers/acpi/acpica/utownerid.c                    |   12 +-
drivers/acpi/acpica/utpredef.c                     |    6 +-
drivers/acpi/acpica/utprint.c                      |   15 +-
drivers/acpi/acpica/utresrc.c                      |    8 +-
drivers/acpi/acpica/utstate.c                      |    3 +
drivers/acpi/acpica/utstring.c                     |    9 +
drivers/acpi/acpica/uttrack.c                      |   50 +-
drivers/acpi/acpica/utxface.c                      |    2 -
drivers/acpi/acpica/utxferror.c                    |    1 +
drivers/acpi/acpica/utxfinit.c                     |   47 +-
drivers/acpi/acpica/utxfmutex.c                    |    6 +-
include/acpi/acexcep.h                             |    6 +-
include/acpi/acpixf.h                              |   11 +-
include/acpi/actypes.h                             |    6 +-
include/acpi/platform/aclinuxex.h                  |    1 +
tools/power/acpi/common/getopt.c                   |    2 +
.../acpi/os_specific/service_layers/oslibcfs.c     |    3 +
tools/power/acpi/tools/acpidump/apfiles.c          |   13 +
138 files changed, 2113 insertions(+), 2140 deletions(-)

create mode 100644 drivers/acpi/acpica/extrace.c
delete mode 100644 drivers/acpi/acpica/utfileio.c

author
#48 lore raw

Hi,

Quoted 6 lines

From: David Lang [mailto:[email protected]]
Sent: Sunday, January 3, 2016 2:45 PM

what is ACPICA and why should we care about divergence between it and the linux
upstream? Where is it to be found?

[Lv Zheng]
You can find ACPICA at: https://acpica.org.
Source code of ACPICA can be found at: https://github.com/acpica/acpica/

There is a process to convert ACPICA source code into Linux source code. The release process happens almost monthly.
We call it as "ACPICA release".

And we call the difference of "Linuxized ACPICA" and "ACPICA in Linux" as divergences. "Linuxized ACPICA" can be generated by the following commands:

  # git clone https://github.com/acpica/acpica
  # cd acpica
  # generate/linux/gen-repo.sh
"ACPICA in Linux" contains the following folders of Linux source tree:
  drivers/acpi/acpica
  include/acpi
  tools/power/acpi
These folders in fact are not maintained by human, but maintained by the ACPICA release automation.

ACPICA upstream uses a different coding style than Linux.
The last step of the release process is to execute "indent" using "linux" style (tuned --linux-style) to make the generated code somewhat compliant to the Linux coding style. However, "indent" is not such a perfect tool.
If you execute indent with same options on the same input, you'll get same output.
While when you execute indent with same options on the same input that contains incremental changes, the output always may contain giant changes. This is because "indent" make different decisions on indentation if the input is different.
While as you may know, there are still differences (about 500+ lines) between "Linux" and "ACPICA upstream".
So the "giant changes" now is inevitable.
In the release process, we use "diff -b" to ignore space changes in order not to generate giant changes every time ACPICA is released.
As you may sense from the above description, the release automation can be seriously affected by the accumulation of this kind of divergences. The "Linuxized ACPICA patch" cannot be directly applied to Linux if such divergences are accumulated.
That's why we have to reduce it in order to make the release automation working.
So you can see a "divergence reduction" patch as the 1st patch in the ACPICA release series occasionally.
After applying this patch, the rest of the release patches can be done without human intervention.

Well, there are more rules and stories about ACPICA release process. :)

Quoted 4 lines

This may be common knowlege to many people, but it should probably be documented
in the patch bundle and it's explination.

[Lv Zheng]
Yes.
This is a good idea.
I'll prepare the documentation.

Thanks and best regards
-Lv

Quoted 259 lines

David Lang

Quoted 254 lines · Lv Zheng

Date: Tue, 29 Dec 2015 13:52:19 +0800
From: Lv Zheng <[email protected]>
To: Rafael J. Wysocki <[email protected]>,
Len Brown <[email protected]>
Cc: Lv Zheng <[email protected]>, Lv Zheng <[email protected]>,
[email protected], [email protected]
Subject: [PATCH 00/42] ACPICA: 20151218 Release

The 20151218 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. i386 + default + ACPI_DEBUGGER=y
2. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "HP Compaq 8200 Elite SFF PC"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20150930 Release):
517 lines
After applying (20151218 Release):
506 lines

Bob Moore (25):
ACPICA: exmutex: General cleanup, restructured some code
ACPICA: Core: Major update for code formatting, no functional changes
ACPICA: Split interpreter tracing functions to a new file
ACPICA: acpiexec: Add support for AML files containing multiple
tables
ACPICA: Disassembler/tools: Support for multiple ACPI tables in one
file
ACPICA: iasl/acpiexec: Update input file handling and verification
ACPICA: Revert "acpi_get_object_info: Add support for ACPI 5.0 _SUB
method."
ACPICA: Add comment explaining _SUB removal
ACPICA: acpiexec/acpinames: Update for error checking macros
ACPICA: Concatenate operator: Add extensions to support all ACPI
objects
ACPICA: Debug Object: Cleanup output
ACPICA: Debug object: Fix output for a NULL object
ACPICA: Update for output of the Debug Object
ACPICA: getopt: Comment update, no functional change
ACPICA: Add new exception code, AE_IO_ERROR
ACPICA: iasl/Disassembler: Support ASL ElseIf operator
ACPICA: Parser: Add constants for internal namepath function
ACPICA: Parser: Fix for SuperName method invocation
ACPICA: Update parameter type for ObjectType operator
ACPICA: Update internal #defines for ObjectType operator. No
functional change
ACPICA: Update for CondRefOf and RefOf operators
ACPICA: Cleanup code related to the per-table module level
improvement
ACPICA: Add "root node" case to the ACPI name repair code
ACPICA: Add per-table execution of module-level code
ACPICA: Update version to 20151218

Colin Ian King (1):
ACPICA: Tools: Add spacing and missing options in acpibin tool

David E. Box (1):
ACPICA: Fix SyncLevel support interaction with method
auto-serialization

LABBE Corentin (1):
ACPICA: Add "const" to some functions that return fixed strings

Lv Zheng (12):
ACPICA: Linuxize: reduce divergences for 20151218 release
ACPICA: Namespace: Fix wrong error log
ACPICA: Debugger: reduce old external path format
ACPICA: Namespace: Add scope information to the simple object repair
mechanism
ACPICA: Namespace: Add String -> ObjectReference conversion support
ACPICA: Events: Deploys acpi_ev_find_region_handler()
ACPICA: Events: Uses common_notify for address space handlers
ACPICA: Utilities: Reorder initialization code
ACPICA: Events: Fix an issue that region object is re-attached to
another scope when it is already attached
ACPICA: Events: Split acpi_ev_associate_reg_method() from region
initialization code
ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no
_REG evaluations can happen during OS early boot stages
ACPICA: Events: Introduce ACPI_REG_DISCONNECT invocation to
acpi_ev_execute_reg_methods()

Markus Elfring (1):
ACPICA: Debugger: Remove some unecessary NULL checks

Prarit Bhargava (1):
ACPICA: acpi_get_sleep_type_data: Reduce warnings

drivers/acpi/acpica/Makefile                       |    4 +-
drivers/acpi/acpica/acapps.h                       |   58 +-
drivers/acpi/acpica/acdebug.h                      |    5 +-
drivers/acpi/acpica/acevents.h                     |   11 +-
drivers/acpi/acpica/acglobal.h                     |    3 +-
drivers/acpi/acpica/aclocal.h                      |   12 +-
drivers/acpi/acpica/acnamesp.h                     |   12 +-
drivers/acpi/acpica/acobject.h                     |    7 +-
drivers/acpi/acpica/acopcode.h                     |   10 +-
drivers/acpi/acpica/acparser.h                     |    8 +-
drivers/acpi/acpica/acutils.h                      |   26 +-
drivers/acpi/acpica/amlcode.h                      |    5 +-
drivers/acpi/acpica/dbcmds.c                       |   11 +-
drivers/acpi/acpica/dbdisply.c                     |   84 ++-
drivers/acpi/acpica/dbfileio.c                     |  123 +---
drivers/acpi/acpica/dbinput.c                      |   22 +-
drivers/acpi/acpica/dbnames.c                      |    2 +-
drivers/acpi/acpica/dbstats.c                      |    1 +
drivers/acpi/acpica/dbtest.c                       |    2 +-
drivers/acpi/acpica/dbutils.c                      |    1 +
drivers/acpi/acpica/dsargs.c                       |    7 +-
drivers/acpi/acpica/dsdebug.c                      |    5 +-
drivers/acpi/acpica/dsfield.c                      |   39 +-
drivers/acpi/acpica/dsinit.c                       |    2 +-
drivers/acpi/acpica/dsmethod.c                     |   39 +-
drivers/acpi/acpica/dsmthdat.c                     |   20 +-
drivers/acpi/acpica/dsobject.c                     |   19 +-
drivers/acpi/acpica/dsopcode.c                     |   21 +-
drivers/acpi/acpica/dsutils.c                      |   29 +-
drivers/acpi/acpica/dswexec.c                      |   19 +-
drivers/acpi/acpica/dswload.c                      |   10 +-
drivers/acpi/acpica/dswload2.c                     |   10 +-
drivers/acpi/acpica/dswscope.c                     |    1 +
drivers/acpi/acpica/evgpe.c                        |    2 +-
drivers/acpi/acpica/evgpeblk.c                     |    1 +
drivers/acpi/acpica/evgpeutil.c                    |    1 +
drivers/acpi/acpica/evhandler.c                    |  165 +++---
drivers/acpi/acpica/evmisc.c                       |    5 +-
drivers/acpi/acpica/evregion.c                     |  114 +++-
drivers/acpi/acpica/evrgnini.c                     |  115 ++--
drivers/acpi/acpica/evxface.c                      |    9 +-
drivers/acpi/acpica/evxfregn.c                     |   38 +-
drivers/acpi/acpica/exconfig.c                     |    8 +-
drivers/acpi/acpica/exconvrt.c                     |    9 +-
drivers/acpi/acpica/excreate.c                     |   20 +-
drivers/acpi/acpica/exdebug.c                      |  403 ++-----------
drivers/acpi/acpica/exdump.c                       |    6 +-
drivers/acpi/acpica/exfield.c                      |   74 +--
drivers/acpi/acpica/exfldio.c                      |   35 +-
drivers/acpi/acpica/exmisc.c                       |   49 +-
drivers/acpi/acpica/exmutex.c                      |   82 ++-
drivers/acpi/acpica/exnames.c                      |    4 +-
drivers/acpi/acpica/exoparg1.c                     |   33 +-
drivers/acpi/acpica/exoparg2.c                     |   12 +-
drivers/acpi/acpica/exoparg3.c                     |   25 +-
drivers/acpi/acpica/exoparg6.c                     |    1 +
drivers/acpi/acpica/exprep.c                       |   25 +-
drivers/acpi/acpica/exregion.c                     |   13 +-
drivers/acpi/acpica/exresnte.c                     |    2 +-
drivers/acpi/acpica/exresolv.c                     |   10 +-
drivers/acpi/acpica/exresop.c                      |   43 +-
drivers/acpi/acpica/exstore.c                      |   17 +-
drivers/acpi/acpica/exstorob.c                     |    7 +-
drivers/acpi/acpica/exsystem.c                     |    6 +-
drivers/acpi/acpica/extrace.c                      |  377 ++++++++++++
drivers/acpi/acpica/exutils.c                      |    7 +-
drivers/acpi/acpica/hwesleep.c                     |    4 +-
drivers/acpi/acpica/hwgpe.c                        |    6 +-
drivers/acpi/acpica/hwsleep.c                      |    4 +-
drivers/acpi/acpica/hwxface.c                      |   24 +-
drivers/acpi/acpica/hwxfsleep.c                    |    1 +
drivers/acpi/acpica/nsconvert.c                    |  105 +++-
drivers/acpi/acpica/nsdump.c                       |    5 +-
drivers/acpi/acpica/nseval.c                       |    2 +-
drivers/acpi/acpica/nsinit.c                       |    3 +-
drivers/acpi/acpica/nsload.c                       |   18 +-
drivers/acpi/acpica/nsnames.c                      |    6 +-
drivers/acpi/acpica/nsparse.c                      |    5 +-
drivers/acpi/acpica/nsprepkg.c                     |   10 +-
drivers/acpi/acpica/nsrepair.c                     |   19 +-
drivers/acpi/acpica/nsrepair2.c                    |   24 +-
drivers/acpi/acpica/nssearch.c                     |    2 +-
drivers/acpi/acpica/nsutils.c                      |    8 +-
drivers/acpi/acpica/nsxfeval.c                     |    4 +-
drivers/acpi/acpica/nsxfname.c                     |   39 +-
drivers/acpi/acpica/nsxfobj.c                      |    6 +-
drivers/acpi/acpica/psargs.c                       |   19 +-
drivers/acpi/acpica/psloop.c                       |   12 +-
drivers/acpi/acpica/psopcode.c                     |  606 ++++++++++----------
drivers/acpi/acpica/psparse.c                      |    8 +-
drivers/acpi/acpica/psutils.c                      |    4 +-
drivers/acpi/acpica/pswalk.c                       |    1 +
drivers/acpi/acpica/rsaddr.c                       |    4 +-
drivers/acpi/acpica/rscalc.c                       |   81 +--
drivers/acpi/acpica/rscreate.c                     |   32 +-
drivers/acpi/acpica/rsdump.c                       |    6 +
drivers/acpi/acpica/rslist.c                       |    9 +-
drivers/acpi/acpica/rsmisc.c                       |   22 +-
drivers/acpi/acpica/rsutils.c                      |   42 +-
drivers/acpi/acpica/rsxface.c                      |    2 +-
drivers/acpi/acpica/tbdata.c                       |    1 +
drivers/acpi/acpica/tbinstal.c                     |    4 +-
drivers/acpi/acpica/tbprint.c                      |    1 +
drivers/acpi/acpica/tbutils.c                      |   10 +-
drivers/acpi/acpica/tbxfload.c                     |    3 +-
drivers/acpi/acpica/utaddress.c                    |    5 +-
drivers/acpi/acpica/utcopy.c                       |   23 +-
drivers/acpi/acpica/utdecode.c                     |   32 +-
drivers/acpi/acpica/utdelete.c                     |    5 +-
drivers/acpi/acpica/uterror.c                      |   10 +-
drivers/acpi/acpica/utfileio.c                     |  334 -----------
drivers/acpi/acpica/uthex.c                        |    2 +-
drivers/acpi/acpica/utids.c                        |   67 ---
drivers/acpi/acpica/utinit.c                       |    1 -
drivers/acpi/acpica/utmath.c                       |   10 +-
drivers/acpi/acpica/utmisc.c                       |   11 +-
drivers/acpi/acpica/utmutex.c                      |    5 +-
drivers/acpi/acpica/utnonansi.c                    |    4 +-
drivers/acpi/acpica/utobject.c                     |   24 +-
drivers/acpi/acpica/utosi.c                        |   11 +-
drivers/acpi/acpica/utownerid.c                    |   12 +-
drivers/acpi/acpica/utpredef.c                     |    6 +-
drivers/acpi/acpica/utprint.c                      |   15 +-
drivers/acpi/acpica/utresrc.c                      |    8 +-
drivers/acpi/acpica/utstate.c                      |    3 +
drivers/acpi/acpica/utstring.c                     |    9 +
drivers/acpi/acpica/uttrack.c                      |   50 +-
drivers/acpi/acpica/utxface.c                      |    2 -
drivers/acpi/acpica/utxferror.c                    |    1 +
drivers/acpi/acpica/utxfinit.c                     |   47 +-
drivers/acpi/acpica/utxfmutex.c                    |    6 +-
include/acpi/acexcep.h                             |    6 +-
include/acpi/acpixf.h                              |   11 +-
include/acpi/actypes.h                             |    6 +-
include/acpi/platform/aclinuxex.h                  |    1 +
tools/power/acpi/common/getopt.c                   |    2 +
.../acpi/os_specific/service_layers/oslibcfs.c     |    3 +
tools/power/acpi/tools/acpidump/apfiles.c          |   13 +
138 files changed, 2113 insertions(+), 2140 deletions(-)

create mode 100644 drivers/acpi/acpica/extrace.c
delete mode 100644 drivers/acpi/acpica/utfileio.c

#49 lore raw
Quoted 11 lines · Lv

Hi,

Quoted 6 lines

From: David Lang [mailto:[email protected]]
Sent: Sunday, January 3, 2016 2:45 PM

what is ACPICA and why should we care about divergence between it and the linux
upstream? Where is it to be found?

[Lv Zheng]
You can find ACPICA at: https://acpica.org.
Source code of ACPICA can be found at: https://github.com/acpica/acpica/

Also, there is an ACPICA entry in MAINTAINERS with links to various places where more information can be found.

That said it is a good idea to document the release process under Documentation/acpi/.

Thanks,
Rafael