linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/12] ACPICA version 20191018
@ 2019-10-24 18:55 Erik Schmauss
  2019-10-24 18:55 ` [PATCH 01/12] ACPICA: Results from Clang changes/fixes From Clang V5.0.1. Mostly "set but never read" warnings Erik Schmauss
                   ` (12 more replies)
  0 siblings, 13 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Erik Schmauss

This patchset contains the linuxized patches for ACPICA version
20191018. There are several debugger changes but they are meant for
acpiexec at this time. acpi_load_table definition has been modified and
a new acpi_unload_table has been added. These new interfaces can be used
as a part of config fs to load and unload tables.

Other than that, Bob has run clang on our code base and removed several
compiler warnings.

This patchset is also available here:
https://github.com/SchmErik/linux/tree/v20191018

Bob Moore (5):
  ACPICA: Results from Clang changes/fixes From Clang V5.0.1. Mostly
    "set but never read" warnings.
  ACPICA: Win OSL: Replace get_tick_count with get_tick_count64
  ACPICA: More Clang changes - V8.0.1 Fixed all "dead assignment"
    warnings.
  ACPICA: Add new external interface, acpi_unload_table
  ACPICA: Update version to 20191018

Erik Schmauss (6):
  ACPICA: utilities: add flag to only display data when dumping buffers
  ACPICA: Debugger: add command to dump all fields of a particular
    subtype
  ACPICA: debugger: surround field unit output with braces '{'
  ACPICA: debugger: add field unit support for acpi_db_get_next_token
  ACPICA: acpiexec: initialize all simple types and field units from
    user input
  ACPICA: debugger: remove leading whitespaces when converting a string
    to a buffer

Nikolaus Voss (1):
  ACPICA: make acpi_load_table() return table index

 drivers/acpi/acpi_configfs.c    |   2 +-
 drivers/acpi/acpica/acdebug.h   |   2 +
 drivers/acpi/acpica/acstruct.h  |  10 +++
 drivers/acpi/acpica/acutils.h   |   9 +--
 drivers/acpi/acpica/dbconvert.c |   4 ++
 drivers/acpi/acpica/dbdisply.c  |   2 -
 drivers/acpi/acpica/dbfileio.c  |   2 +-
 drivers/acpi/acpica/dbinput.c   |  36 +++++++++-
 drivers/acpi/acpica/dbmethod.c  |   4 ++
 drivers/acpi/acpica/dbnames.c   | 113 ++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/dbobject.c  |   1 -
 drivers/acpi/acpica/dscontrol.c |   2 +-
 drivers/acpi/acpica/dsfield.c   |  12 +---
 drivers/acpi/acpica/evgpeblk.c  |  11 ++--
 drivers/acpi/acpica/evgpeinit.c |   3 -
 drivers/acpi/acpica/evmisc.c    |  12 +++-
 drivers/acpi/acpica/evregion.c  |   4 +-
 drivers/acpi/acpica/evrgnini.c  |   1 -
 drivers/acpi/acpica/hwxfsleep.c |   3 +
 drivers/acpi/acpica/nsconvert.c |   2 +-
 drivers/acpi/acpica/nsdump.c    |   6 +-
 drivers/acpi/acpica/nsxfname.c  |   4 +-
 drivers/acpi/acpica/psobject.c  |   7 +-
 drivers/acpi/acpica/rscreate.c  |   3 +
 drivers/acpi/acpica/tbdata.c    |   3 +
 drivers/acpi/acpica/tbxfload.c  |  40 ++++++++++-
 drivers/acpi/acpica/utbuffer.c  |  52 ++++++++-------
 drivers/acpi/acpica/utids.c     |   2 -
 drivers/acpi/acpica/uttrack.c   |   2 +-
 drivers/firmware/efi/efi.c      |   2 +-
 include/acpi/acpixf.h           |   8 ++-
 31 files changed, 290 insertions(+), 74 deletions(-)

-- 
2.21.0


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

* [PATCH 01/12] ACPICA: Results from Clang changes/fixes From Clang V5.0.1. Mostly "set but never read" warnings.
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-24 18:55 ` [PATCH 02/12] ACPICA: Win OSL: Replace get_tick_count with get_tick_count64 Erik Schmauss
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Bob Moore, Erik Schmauss

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

ACPICA commit 1f08279b3eb13f17004159c28c391a390cd68feb

Link: https://github.com/acpica/acpica/commit/1f08279b
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
---
 drivers/acpi/acpica/dbdisply.c  |  2 --
 drivers/acpi/acpica/dbinput.c   |  1 -
 drivers/acpi/acpica/dbmethod.c  |  4 ++++
 drivers/acpi/acpica/dbobject.c  |  1 -
 drivers/acpi/acpica/dsfield.c   |  3 ---
 drivers/acpi/acpica/evgpeblk.c  | 11 +++++++----
 drivers/acpi/acpica/evgpeinit.c |  3 ---
 drivers/acpi/acpica/evmisc.c    | 12 ++++++++++--
 drivers/acpi/acpica/evregion.c  |  4 ++--
 drivers/acpi/acpica/evrgnini.c  |  1 -
 drivers/acpi/acpica/nsdump.c    |  4 ++--
 drivers/acpi/acpica/psobject.c  |  5 ++---
 drivers/acpi/acpica/uttrack.c   |  2 +-
 13 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/drivers/acpi/acpica/dbdisply.c b/drivers/acpi/acpica/dbdisply.c
index 30ab62b0fec8..f2df416d0d2d 100644
--- a/drivers/acpi/acpica/dbdisply.c
+++ b/drivers/acpi/acpica/dbdisply.c
@@ -513,7 +513,6 @@ void acpi_db_display_results(void)
 		return;
 	}
 
-	obj_desc = walk_state->method_desc;
 	node = walk_state->method_node;
 
 	if (walk_state->results) {
@@ -565,7 +564,6 @@ void acpi_db_display_calling_tree(void)
 		return;
 	}
 
-	node = walk_state->method_node;
 	acpi_os_printf("Current Control Method Call Tree\n");
 
 	while (walk_state) {
diff --git a/drivers/acpi/acpica/dbinput.c b/drivers/acpi/acpica/dbinput.c
index 55a7e10998d8..95738313916b 100644
--- a/drivers/acpi/acpica/dbinput.c
+++ b/drivers/acpi/acpica/dbinput.c
@@ -689,7 +689,6 @@ acpi_db_command_dispatch(char *input_buffer,
 
 	param_count = acpi_db_get_line(input_buffer);
 	command_index = acpi_db_match_command(acpi_gbl_db_args[0]);
-	temp = 0;
 
 	/*
 	 * We don't want to add the !! command to the history buffer. It
diff --git a/drivers/acpi/acpica/dbmethod.c b/drivers/acpi/acpica/dbmethod.c
index 76a15b6ffc5d..4e48a7de7413 100644
--- a/drivers/acpi/acpica/dbmethod.c
+++ b/drivers/acpi/acpica/dbmethod.c
@@ -321,6 +321,10 @@ acpi_status acpi_db_disassemble_method(char *name)
 	walk_state->parse_flags |= ACPI_PARSE_DISASSEMBLE;
 
 	status = acpi_ps_parse_aml(walk_state);
+	if (ACPI_FAILURE(status)) {
+		return (status);
+	}
+
 	(void)acpi_dm_parse_deferred_ops(op);
 
 	/* Now we can disassemble the method */
diff --git a/drivers/acpi/acpica/dbobject.c b/drivers/acpi/acpica/dbobject.c
index f9fc84bc3e84..4b4c530a0654 100644
--- a/drivers/acpi/acpica/dbobject.c
+++ b/drivers/acpi/acpica/dbobject.c
@@ -464,7 +464,6 @@ void acpi_db_decode_arguments(struct acpi_walk_state *walk_state)
 	u8 display_args = FALSE;
 
 	node = walk_state->method_node;
-	obj_desc = walk_state->method_desc;
 
 	/* There are no arguments for the module-level code case */
 
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c
index cf4e061bb0f0..9151f00dfbdc 100644
--- a/drivers/acpi/acpica/dsfield.c
+++ b/drivers/acpi/acpica/dsfield.c
@@ -149,7 +149,6 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
 
 	if (walk_state->deferred_node) {
 		node = walk_state->deferred_node;
-		status = AE_OK;
 	} else {
 		/* Execute flag should always be set when this function is entered */
 
@@ -636,8 +635,6 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
 				}
 
 				/* Name already exists, just ignore this error */
-
-				status = AE_OK;
 			}
 
 			arg->common.node = node;
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index fb15e9e2373b..9c7adaa7b582 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -110,6 +110,9 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
 
 	status =
 	    acpi_hw_disable_gpe_block(gpe_block->xrupt_block, gpe_block, NULL);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
 
 	if (!gpe_block->previous && !gpe_block->next) {
 
@@ -359,10 +362,10 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
 	walk_info.gpe_device = gpe_device;
 	walk_info.execute_by_owner_id = FALSE;
 
-	status = acpi_ns_walk_namespace(ACPI_TYPE_METHOD, gpe_device,
-					ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
-					acpi_ev_match_gpe_method, NULL,
-					&walk_info, NULL);
+	(void)acpi_ns_walk_namespace(ACPI_TYPE_METHOD, gpe_device,
+				     ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
+				     acpi_ev_match_gpe_method, NULL, &walk_info,
+				     NULL);
 
 	/* Return the new block */
 
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index b04f982e59fa..70d21d5ec5f3 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -156,8 +156,6 @@ acpi_status acpi_ev_gpe_initialize(void)
 			 * GPE0 and GPE1 do not have to be contiguous in the GPE number
 			 * space. However, GPE0 always starts at GPE number zero.
 			 */
-			gpe_number_max = acpi_gbl_FADT.gpe1_base +
-			    ((register_count1 * ACPI_GPE_REGISTER_WIDTH) - 1);
 		}
 	}
 
@@ -169,7 +167,6 @@ acpi_status acpi_ev_gpe_initialize(void)
 
 		ACPI_DEBUG_PRINT((ACPI_DB_INIT,
 				  "There are no GPE blocks defined in the FADT\n"));
-		status = AE_OK;
 		goto cleanup;
 	}
 
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c
index d45f7639f7ee..aa98fe07cd1b 100644
--- a/drivers/acpi/acpica/evmisc.c
+++ b/drivers/acpi/acpica/evmisc.c
@@ -230,11 +230,15 @@ void acpi_ev_terminate(void)
 		/* Disable all GPEs in all GPE blocks */
 
 		status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);
+		if (ACPI_FAILURE(status)) {
+			ACPI_EXCEPTION((AE_INFO, status,
+					"Could not disable GPEs in GPE block"));
+		}
 
 		status = acpi_ev_remove_global_lock_handler();
 		if (ACPI_FAILURE(status)) {
-			ACPI_ERROR((AE_INFO,
-				    "Could not remove Global Lock handler"));
+			ACPI_EXCEPTION((AE_INFO, status,
+					"Could not remove Global Lock handler"));
 		}
 
 		acpi_gbl_events_initialized = FALSE;
@@ -250,6 +254,10 @@ void acpi_ev_terminate(void)
 	/* Deallocate all handler objects installed within GPE info structs */
 
 	status = acpi_ev_walk_gpe_list(acpi_ev_delete_gpe_handlers, NULL);
+	if (ACPI_FAILURE(status)) {
+		ACPI_EXCEPTION((AE_INFO, status,
+				"Could not delete GPE handlers"));
+	}
 
 	/* Return to original mode if necessary */
 
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index 45dc797df05d..1ff126460007 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -836,11 +836,11 @@ acpi_ev_orphan_ec_reg_method(struct acpi_namespace_node *ec_device_node)
 	objects[1].type = ACPI_TYPE_INTEGER;
 	objects[1].integer.value = ACPI_REG_CONNECT;
 
-	status = acpi_evaluate_object(reg_method, NULL, &args, NULL);
+	(void)acpi_evaluate_object(reg_method, NULL, &args, NULL);
 
 exit:
 	/* We ignore all errors from above, don't care */
 
-	status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+	(void)acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
 	return_VOID;
 }
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c
index 0b47bbcd2a23..aee09640d710 100644
--- a/drivers/acpi/acpica/evrgnini.c
+++ b/drivers/acpi/acpica/evrgnini.c
@@ -198,7 +198,6 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
 						 * root bridge. Still need to return a context object
 						 * for the new PCI_Config operation region, however.
 						 */
-						status = AE_OK;
 					} else {
 						ACPI_EXCEPTION((AE_INFO, status,
 								"Could not install PciConfig handler "
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 9731d7cf1b83..1df6d72ae46b 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -291,7 +291,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
 					for (i = 0;
 					     (i < obj_desc->buffer.length
 					      && i < 12); i++) {
-						acpi_os_printf(" %.2hX",
+						acpi_os_printf(" %2.2X",
 							       obj_desc->buffer.
 							       pointer[i]);
 					}
@@ -404,7 +404,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
 		case ACPI_TYPE_LOCAL_BANK_FIELD:
 		case ACPI_TYPE_LOCAL_INDEX_FIELD:
 
-			acpi_os_printf(" Off %.3X Len %.2X Acc %.2hd\n",
+			acpi_os_printf(" Off %.3X Len %.2X Acc %.2X\n",
 				       (obj_desc->common_field.
 					base_byte_offset * 8)
 				       +
diff --git a/drivers/acpi/acpica/psobject.c b/drivers/acpi/acpica/psobject.c
index 98e5c7400e54..9acf5f7453e9 100644
--- a/drivers/acpi/acpica/psobject.c
+++ b/drivers/acpi/acpica/psobject.c
@@ -480,9 +480,8 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state,
 			    acpi_ps_get_opcode_info((*op)->common.aml_opcode);
 			walk_state->opcode = (*op)->common.aml_opcode;
 
-			status = walk_state->ascending_callback(walk_state);
-			status =
-			    acpi_ps_next_parse_state(walk_state, *op, status);
+			(void)walk_state->ascending_callback(walk_state);
+			(void)acpi_ps_next_parse_state(walk_state, *op, status);
 
 			status2 = acpi_ps_complete_this_op(walk_state, *op);
 			if (ACPI_FAILURE(status2)) {
diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c
index 8052f7ef5025..14de4d15e618 100644
--- a/drivers/acpi/acpica/uttrack.c
+++ b/drivers/acpi/acpica/uttrack.c
@@ -660,7 +660,7 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
 					case ACPI_DESC_TYPE_PARSER:
 
 						acpi_os_printf
-						    ("AmlOpcode 0x%04hX\n",
+						    ("AmlOpcode 0x%04X\n",
 						     descriptor->op.asl.
 						     aml_opcode);
 						break;
-- 
2.21.0


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

* [PATCH 02/12] ACPICA: Win OSL: Replace get_tick_count with get_tick_count64
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
  2019-10-24 18:55 ` [PATCH 01/12] ACPICA: Results from Clang changes/fixes From Clang V5.0.1. Mostly "set but never read" warnings Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-24 18:55 ` [PATCH 03/12] ACPICA: More Clang changes - V8.0.1 Fixed all "dead assignment" warnings Erik Schmauss
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Bob Moore, Erik Schmauss

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

ACPICA commit 7bc16c650317001bc82d4bae227b888a49c51f5e

Avoid possible overflow from get_tick_count. Also, cast math
using ACPI_100NSEC_PER_MSEC to uint64.

Link: https://github.com/acpica/acpica/commit/7bc16c65
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
---
 drivers/acpi/acpica/dscontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/dscontrol.c b/drivers/acpi/acpica/dscontrol.c
index 4847f89c678c..5034fab9cf69 100644
--- a/drivers/acpi/acpica/dscontrol.c
+++ b/drivers/acpi/acpica/dscontrol.c
@@ -85,7 +85,7 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state,
 		    walk_state->parser_state.pkg_end;
 		control_state->control.opcode = op->common.aml_opcode;
 		control_state->control.loop_timeout = acpi_os_get_timer() +
-		    (u64)(acpi_gbl_max_loop_iterations * ACPI_100NSEC_PER_SEC);
+		    ((u64)acpi_gbl_max_loop_iterations * ACPI_100NSEC_PER_SEC);
 
 		/* Push the control state on this walk's control stack */
 
-- 
2.21.0


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

* [PATCH 03/12] ACPICA: More Clang changes - V8.0.1 Fixed all "dead assignment" warnings.
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
  2019-10-24 18:55 ` [PATCH 01/12] ACPICA: Results from Clang changes/fixes From Clang V5.0.1. Mostly "set but never read" warnings Erik Schmauss
  2019-10-24 18:55 ` [PATCH 02/12] ACPICA: Win OSL: Replace get_tick_count with get_tick_count64 Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-24 18:55 ` [PATCH 04/12] ACPICA: Add new external interface, acpi_unload_table Erik Schmauss
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Bob Moore, Erik Schmauss

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

ACPICA commit 54b3aefb5de860306951c8c3339b1c37dcdf1b39

Link: https://github.com/acpica/acpica/commit/54b3aefb
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
---
 drivers/acpi/acpica/hwxfsleep.c | 3 +++
 drivers/acpi/acpica/nsconvert.c | 2 +-
 drivers/acpi/acpica/nsdump.c    | 2 --
 drivers/acpi/acpica/nsxfname.c  | 4 ++--
 drivers/acpi/acpica/psobject.c  | 6 ++----
 drivers/acpi/acpica/rscreate.c  | 3 +++
 drivers/acpi/acpica/tbdata.c    | 3 +++
 drivers/acpi/acpica/utids.c     | 2 --
 8 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index abbf9702aa7f..2919746c9041 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -166,6 +166,9 @@ acpi_status acpi_enter_sleep_state_s4bios(void)
 
 	status = acpi_hw_write_port(acpi_gbl_FADT.smi_command,
 				    (u32)acpi_gbl_FADT.s4_bios_request, 8);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
 
 	do {
 		acpi_os_stall(ACPI_USEC_PER_MSEC);
diff --git a/drivers/acpi/acpica/nsconvert.c b/drivers/acpi/acpica/nsconvert.c
index 14cbf63f1991..c86d0770ed6e 100644
--- a/drivers/acpi/acpica/nsconvert.c
+++ b/drivers/acpi/acpica/nsconvert.c
@@ -486,5 +486,5 @@ acpi_ns_convert_to_reference(struct acpi_namespace_node *scope,
 error_exit:
 	ACPI_FREE(name);
 	*return_object = new_object;
-	return (AE_OK);
+	return (status);
 }
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 1df6d72ae46b..9ad340f644a1 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -589,8 +589,6 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
 
 			goto cleanup;
 		}
-
-		obj_type = ACPI_TYPE_INVALID;	/* Terminate loop after next pass */
 	}
 
 cleanup:
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index 55b4a5b3331f..161e60ddfb69 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -425,8 +425,8 @@ acpi_get_object_info(acpi_handle handle,
 	}
 
 	if (cls) {
-		next_id_string = acpi_ns_copy_device_id(&info->class_code,
-							cls, next_id_string);
+		(void)acpi_ns_copy_device_id(&info->class_code,
+					     cls, next_id_string);
 	}
 
 	/* Copy the fixed-length data */
diff --git a/drivers/acpi/acpica/psobject.c b/drivers/acpi/acpica/psobject.c
index 9acf5f7453e9..ded2779fc8ea 100644
--- a/drivers/acpi/acpica/psobject.c
+++ b/drivers/acpi/acpica/psobject.c
@@ -480,7 +480,7 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state,
 			    acpi_ps_get_opcode_info((*op)->common.aml_opcode);
 			walk_state->opcode = (*op)->common.aml_opcode;
 
-			(void)walk_state->ascending_callback(walk_state);
+			status = walk_state->ascending_callback(walk_state);
 			(void)acpi_ps_next_parse_state(walk_state, *op, status);
 
 			status2 = acpi_ps_complete_this_op(walk_state, *op);
@@ -489,7 +489,6 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state,
 			}
 		}
 
-		status = AE_OK;
 		break;
 
 	case AE_CTRL_BREAK:
@@ -511,14 +510,13 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state,
 		walk_state->opcode = (*op)->common.aml_opcode;
 
 		status = walk_state->ascending_callback(walk_state);
-		status = acpi_ps_next_parse_state(walk_state, *op, status);
+		(void)acpi_ps_next_parse_state(walk_state, *op, status);
 
 		status2 = acpi_ps_complete_this_op(walk_state, *op);
 		if (ACPI_FAILURE(status2)) {
 			return_ACPI_STATUS(status2);
 		}
 
-		status = AE_OK;
 		break;
 
 	case AE_CTRL_TERMINATE:
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c
index 570ea0df8a1b..c659b54985a5 100644
--- a/drivers/acpi/acpica/rscreate.c
+++ b/drivers/acpi/acpica/rscreate.c
@@ -312,6 +312,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
 				path_buffer.pointer = user_prt->source;
 
 				status = acpi_ns_handle_to_pathname((acpi_handle)node, &path_buffer, FALSE);
+				if (ACPI_FAILURE(status)) {
+					return_ACPI_STATUS(status);
+				}
 
 				/* +1 to include null terminator */
 
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c
index 309440010ab2..2cf36451e46f 100644
--- a/drivers/acpi/acpica/tbdata.c
+++ b/drivers/acpi/acpica/tbdata.c
@@ -933,6 +933,9 @@ acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node)
 	}
 
 	status = acpi_ns_load_table(table_index, parent_node);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
 
 	/*
 	 * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
diff --git a/drivers/acpi/acpica/utids.c b/drivers/acpi/acpica/utids.c
index e805abdd95b8..30198c828ab6 100644
--- a/drivers/acpi/acpica/utids.c
+++ b/drivers/acpi/acpica/utids.c
@@ -289,9 +289,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node *device_node,
 						  value);
 			length = ACPI_EISAID_STRING_SIZE;
 		} else {	/* ACPI_TYPE_STRING */
-
 			/* Copy the String CID from the returned object */
-
 			strcpy(next_id_string, cid_objects[i]->string.pointer);
 			length = cid_objects[i]->string.length + 1;
 		}
-- 
2.21.0


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

* [PATCH 04/12] ACPICA: Add new external interface, acpi_unload_table
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
                   ` (2 preceding siblings ...)
  2019-10-24 18:55 ` [PATCH 03/12] ACPICA: More Clang changes - V8.0.1 Fixed all "dead assignment" warnings Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-24 18:55 ` [PATCH 05/12] ACPICA: make acpi_load_table() return table index Erik Schmauss
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Bob Moore, Erik Schmauss

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

ACPICA commit c69369cd9cf0134e1aac516e97d612947daa8dc2

Unload a table via the table_index.

Link: https://github.com/acpica/acpica/commit/c69369cd
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
---
 drivers/acpi/acpica/tbxfload.c | 32 ++++++++++++++++++++++++++++++++
 include/acpi/acpixf.h          |  3 +++
 2 files changed, 35 insertions(+)

diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index 86f1693f6d29..ce86e7945e90 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -390,3 +390,35 @@ acpi_status acpi_unload_parent_table(acpi_handle object)
 }
 
 ACPI_EXPORT_SYMBOL(acpi_unload_parent_table)
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_unload_table
+ *
+ * PARAMETERS:  table_index         - Index as returned by acpi_load_table
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Via the table_index representing an SSDT or OEMx table, unloads
+ *              the table and deletes all namespace objects associated with
+ *              that table. Unloading of the DSDT is not allowed.
+ *              Note: Mainly intended to support hotplug removal of SSDTs.
+ *
+ ******************************************************************************/
+acpi_status acpi_unload_table(u32 table_index)
+{
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE(acpi_unload_table);
+
+	if (table_index == 1) {
+
+		/* table_index==1 means DSDT is the owner. DSDT cannot be unloaded */
+
+		return_ACPI_STATUS(AE_TYPE);
+	}
+
+	status = acpi_tb_unload_table(table_index);
+	return_ACPI_STATUS(status);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_unload_table)
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index e5e041413581..109b2f14b6c6 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -460,6 +460,9 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			    acpi_load_table(struct acpi_table_header *table))
 
+ACPI_EXTERNAL_RETURN_STATUS(acpi_status
+			    acpi_unload_table(u32 table_index))
+
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			    acpi_unload_parent_table(acpi_handle object))
 
-- 
2.21.0


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

* [PATCH 05/12] ACPICA: make acpi_load_table() return table index
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
                   ` (3 preceding siblings ...)
  2019-10-24 18:55 ` [PATCH 04/12] ACPICA: Add new external interface, acpi_unload_table Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-25  8:19   ` Andy Shevchenko
  2019-10-24 18:55 ` [PATCH 06/12] ACPICA: utilities: add flag to only display data when dumping buffers Erik Schmauss
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi
  Cc: Nikolaus Voss, Andy Shevchenko, Erik Schmauss, Bob Moore

From: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>

ACPICA commit d1716a829d19be23277d9157c575a03b9abb7457

For unloading an ACPI table, it is necessary to provide the index of
the table. The method intended for dynamically loading or hotplug
addition of tables, acpi_load_table(), should provide this information
via an optional pointer to the loaded table index.

This patch fixes the table unload function of acpi_configfs.

Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Fixes: d06c47e3dd07f ("ACPI: configfs: Resolve objects on host-directed
table loads")

Link: https://github.com/acpica/acpica/commit/d1716a82
Signed-off-by: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpi_configfs.c   | 2 +-
 drivers/acpi/acpica/dbfileio.c | 2 +-
 drivers/acpi/acpica/tbxfload.c | 8 +++++++-
 drivers/firmware/efi/efi.c     | 2 +-
 include/acpi/acpixf.h          | 3 ++-
 5 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c
index 57d9d574d4dd..77f81242a28e 100644
--- a/drivers/acpi/acpi_configfs.c
+++ b/drivers/acpi/acpi_configfs.c
@@ -53,7 +53,7 @@ static ssize_t acpi_table_aml_write(struct config_item *cfg,
 	if (!table->header)
 		return -ENOMEM;
 
-	ret = acpi_load_table(table->header);
+	ret = acpi_load_table(table->header, &table->index);
 	if (ret) {
 		kfree(table->header);
 		table->header = NULL;
diff --git a/drivers/acpi/acpica/dbfileio.c b/drivers/acpi/acpica/dbfileio.c
index c6e25734dc5c..e1b6e54a96ac 100644
--- a/drivers/acpi/acpica/dbfileio.c
+++ b/drivers/acpi/acpica/dbfileio.c
@@ -93,7 +93,7 @@ acpi_status acpi_db_load_tables(struct acpi_new_table_desc *list_head)
 	while (table_list_head) {
 		table = table_list_head->table;
 
-		status = acpi_load_table(table);
+		status = acpi_load_table(table, NULL);
 		if (ACPI_FAILURE(status)) {
 			if (status == AE_ALREADY_EXISTS) {
 				acpi_os_printf
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index ce86e7945e90..0782acf85722 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -268,6 +268,8 @@ ACPI_EXPORT_SYMBOL_INIT(acpi_install_table)
  *
  * PARAMETERS:  table               - Pointer to a buffer containing the ACPI
  *                                    table to be loaded.
+ *              table_idx           - Pointer to a u32 for storing the table
+ *                                    index, might be NULL
  *
  * RETURN:      Status
  *
@@ -278,7 +280,7 @@ ACPI_EXPORT_SYMBOL_INIT(acpi_install_table)
  *              to ensure that the table is not deleted or unmapped.
  *
  ******************************************************************************/
-acpi_status acpi_load_table(struct acpi_table_header *table)
+acpi_status acpi_load_table(struct acpi_table_header *table, u32 *table_idx)
 {
 	acpi_status status;
 	u32 table_index;
@@ -297,6 +299,10 @@ acpi_status acpi_load_table(struct acpi_table_header *table)
 	status = acpi_tb_install_and_load_table(ACPI_PTR_TO_PHYSADDR(table),
 						ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL,
 						FALSE, &table_index);
+	if (table_idx) {
+		*table_idx = table_index;
+	}
+
 	if (ACPI_SUCCESS(status)) {
 
 		/* Complete the initialization/resolution of new objects */
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 69f00f7453a3..0d65cb21519d 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -296,7 +296,7 @@ static __init int efivar_ssdt_load(void)
 			goto free_data;
 		}
 
-		ret = acpi_load_table(data);
+		ret = acpi_load_table(data, NULL);
 		if (ret) {
 			pr_err("failed to load table: %d\n", ret);
 			goto free_data;
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 109b2f14b6c6..867170049b07 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -458,7 +458,8 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
 					       u8 physical))
 
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
-			    acpi_load_table(struct acpi_table_header *table))
+			    acpi_load_table(struct acpi_table_header *table,
+					    u32 *table_idx))
 
 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
 			    acpi_unload_table(u32 table_index))
-- 
2.21.0


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

* [PATCH 06/12] ACPICA: utilities: add flag to only display data when dumping buffers
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
                   ` (4 preceding siblings ...)
  2019-10-24 18:55 ` [PATCH 05/12] ACPICA: make acpi_load_table() return table index Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-24 18:55 ` [PATCH 07/12] ACPICA: Debugger: add command to dump all fields of a particular subtype Erik Schmauss
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Erik Schmauss, Bob Moore

ACPICA commit fb18935fcf940c5854a055975c6b9ee31f0e1a5a

Link: https://github.com/acpica/acpica/commit/fb18935f
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/acutils.h  |  9 +++---
 drivers/acpi/acpica/utbuffer.c | 52 +++++++++++++++++++---------------
 2 files changed, 34 insertions(+), 27 deletions(-)

diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index 601808be86d1..5fb50634e08e 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -142,10 +142,11 @@ struct acpi_pkg_info {
 
 /* acpi_ut_dump_buffer */
 
-#define DB_BYTE_DISPLAY     1
-#define DB_WORD_DISPLAY     2
-#define DB_DWORD_DISPLAY    4
-#define DB_QWORD_DISPLAY    8
+#define DB_BYTE_DISPLAY      0x01
+#define DB_WORD_DISPLAY      0x02
+#define DB_DWORD_DISPLAY     0x04
+#define DB_QWORD_DISPLAY     0x08
+#define DB_DISPLAY_DATA_ONLY 0x10
 
 /*
  * utascii - ASCII utilities
diff --git a/drivers/acpi/acpica/utbuffer.c b/drivers/acpi/acpica/utbuffer.c
index 61db9967ebe4..db897af1de05 100644
--- a/drivers/acpi/acpica/utbuffer.c
+++ b/drivers/acpi/acpica/utbuffer.c
@@ -37,7 +37,9 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
 	u32 j;
 	u32 temp32;
 	u8 buf_char;
+	u32 display_data_only = display & DB_DISPLAY_DATA_ONLY;
 
+	display &= ~DB_DISPLAY_DATA_ONLY;
 	if (!buffer) {
 		acpi_os_printf("Null Buffer Pointer in DumpBuffer!\n");
 		return;
@@ -53,7 +55,9 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
 
 		/* Print current offset */
 
-		acpi_os_printf("%8.4X: ", (base_offset + i));
+		if (!display_data_only) {
+			acpi_os_printf("%8.4X: ", (base_offset + i));
+		}
 
 		/* Print 16 hex chars */
 
@@ -109,32 +113,34 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
 		 * Print the ASCII equivalent characters but watch out for the bad
 		 * unprintable ones (printable chars are 0x20 through 0x7E)
 		 */
-		acpi_os_printf(" ");
-		for (j = 0; j < 16; j++) {
-			if (i + j >= count) {
-				acpi_os_printf("\n");
-				return;
+		if (!display_data_only) {
+			acpi_os_printf(" ");
+			for (j = 0; j < 16; j++) {
+				if (i + j >= count) {
+					acpi_os_printf("\n");
+					return;
+				}
+
+				/*
+				 * Add comment characters so rest of line is ignored when
+				 * compiled
+				 */
+				if (j == 0) {
+					acpi_os_printf("// ");
+				}
+
+				buf_char = buffer[(acpi_size)i + j];
+				if (isprint(buf_char)) {
+					acpi_os_printf("%c", buf_char);
+				} else {
+					acpi_os_printf(".");
+				}
 			}
 
-			/*
-			 * Add comment characters so rest of line is ignored when
-			 * compiled
-			 */
-			if (j == 0) {
-				acpi_os_printf("// ");
-			}
+			/* Done with that line. */
 
-			buf_char = buffer[(acpi_size)i + j];
-			if (isprint(buf_char)) {
-				acpi_os_printf("%c", buf_char);
-			} else {
-				acpi_os_printf(".");
-			}
+			acpi_os_printf("\n");
 		}
-
-		/* Done with that line. */
-
-		acpi_os_printf("\n");
 		i += 16;
 	}
 
-- 
2.21.0


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

* [PATCH 07/12] ACPICA: Debugger: add command to dump all fields of a particular subtype
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
                   ` (5 preceding siblings ...)
  2019-10-24 18:55 ` [PATCH 06/12] ACPICA: utilities: add flag to only display data when dumping buffers Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-27 20:57   ` kbuild test robot
  2019-10-27 21:33   ` kbuild test robot
  2019-10-24 18:55 ` [PATCH 08/12] ACPICA: debugger: surround field unit output with braces '{' Erik Schmauss
                   ` (5 subsequent siblings)
  12 siblings, 2 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Erik Schmauss, Bob Moore

ACPICA commit 85cbe5e8b3b077593950eaffebaf07348b73e99d

In acpiexec, this can be invoked by typing "fields" followed by a
number representing the address space ID of that field.

Link: https://github.com/acpica/acpica/commit/85cbe5e8
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/acdebug.h  |   2 +
 drivers/acpi/acpica/acstruct.h |  10 +++
 drivers/acpi/acpica/dbinput.c  |  20 ++++++
 drivers/acpi/acpica/dbnames.c  | 108 +++++++++++++++++++++++++++++++++
 4 files changed, 140 insertions(+)

diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index 32f2e38c7570..694cf206fa9a 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -148,6 +148,8 @@ void acpi_db_find_references(char *object_arg);
 
 void acpi_db_get_bus_info(void);
 
+acpi_status acpi_db_display_fields(u32 address_space_id);
+
 /*
  * dbdisply - debug display commands
  */
diff --git a/drivers/acpi/acpica/acstruct.h b/drivers/acpi/acpica/acstruct.h
index 218ff4c8b817..2043dff370b1 100644
--- a/drivers/acpi/acpica/acstruct.h
+++ b/drivers/acpi/acpica/acstruct.h
@@ -192,6 +192,16 @@ struct acpi_device_walk_info {
 	u32 num_INI;
 };
 
+/* Info used by Acpi  acpi_db_display_fields */
+
+struct acpi_region_walk_info {
+	u32 debug_level;
+	u32 count;
+	acpi_owner_id owner_id;
+	u8 display_type;
+	u32 address_space_id;
+};
+
 /* TBD: [Restructure] Merge with struct above */
 
 struct acpi_walk_info {
diff --git a/drivers/acpi/acpica/dbinput.c b/drivers/acpi/acpica/dbinput.c
index 95738313916b..44d6d7246e6e 100644
--- a/drivers/acpi/acpica/dbinput.c
+++ b/drivers/acpi/acpica/dbinput.c
@@ -50,6 +50,7 @@ enum acpi_ex_debugger_commands {
 	CMD_EVALUATE,
 	CMD_EXECUTE,
 	CMD_EXIT,
+	CMD_FIELDS,
 	CMD_FIND,
 	CMD_GO,
 	CMD_HANDLERS,
@@ -127,6 +128,7 @@ static const struct acpi_db_command_info acpi_gbl_db_commands[] = {
 	{"EVALUATE", 1},
 	{"EXECUTE", 1},
 	{"EXIT", 0},
+	{"FIELDS", 1},
 	{"FIND", 1},
 	{"GO", 0},
 	{"HANDLERS", 0},
@@ -200,6 +202,8 @@ static const struct acpi_db_command_help acpi_gbl_db_command_help[] = {
 	 "Find ACPI name(s) with wildcards\n"},
 	{1, "  Integrity", "Validate namespace integrity\n"},
 	{1, "  Methods", "Display list of loaded control methods\n"},
+	{1, "  Fields <AddressSpaceId>",
+	 "Display list of loaded field units by space ID\n"},
 	{1, "  Namespace [Object] [Depth]",
 	 "Display loaded namespace tree/subtree\n"},
 	{1, "  Notify <Object> <Value>", "Send a notification on Object\n"},
@@ -674,6 +678,7 @@ acpi_db_command_dispatch(char *input_buffer,
 			 union acpi_parse_object *op)
 {
 	u32 temp;
+	u64 temp64;
 	u32 command_index;
 	u32 param_count;
 	char *command_line;
@@ -789,6 +794,21 @@ acpi_db_command_dispatch(char *input_buffer,
 		status = acpi_db_find_name_in_namespace(acpi_gbl_db_args[1]);
 		break;
 
+	case CMD_FIELDS:
+
+		status = acpi_ut_strtoul64(acpi_gbl_db_args[1], &temp64);
+
+		if (ACPI_FAILURE(status)
+		    || temp64 >= ACPI_NUM_PREDEFINED_REGIONS) {
+			acpi_os_printf
+			    ("Invalid adress space ID: must be between 0 and %u inclusive\n",
+			     ACPI_NUM_PREDEFINED_REGIONS - 1);
+			return (AE_OK);
+		}
+
+		status = acpi_db_display_fields((u32)temp64);
+		break;
+
 	case CMD_GO:
 
 		acpi_gbl_cm_single_step = FALSE;
diff --git a/drivers/acpi/acpica/dbnames.c b/drivers/acpi/acpica/dbnames.c
index 63fe30e86807..06fe87c6647d 100644
--- a/drivers/acpi/acpica/dbnames.c
+++ b/drivers/acpi/acpica/dbnames.c
@@ -10,6 +10,7 @@
 #include "acnamesp.h"
 #include "acdebug.h"
 #include "acpredef.h"
+#include "acinterp.h"
 
 #define _COMPONENT          ACPI_CA_DEBUGGER
 ACPI_MODULE_NAME("dbnames")
@@ -502,6 +503,80 @@ acpi_db_walk_for_object_counts(acpi_handle obj_handle,
 	return (AE_OK);
 }
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_walk_for_fields
+ *
+ * PARAMETERS:  Callback from walk_namespace
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Display short info about objects in the namespace
+ *
+ ******************************************************************************/
+
+static acpi_status
+acpi_db_walk_for_fields(acpi_handle obj_handle,
+			u32 nesting_level, void *context, void **return_value)
+{
+	union acpi_object *ret_value;
+	ACPI_REGION_WALK_INFO *info = (ACPI_REGION_WALK_INFO *) context;
+	struct acpi_buffer buffer;
+	acpi_status status;
+	struct acpi_namespace_node *node = acpi_ns_validate_handle(obj_handle);
+
+	if (!node) {
+		return (AE_OK);
+	}
+	if (node->object->field.region_obj->region.space_id !=
+	    info->address_space_id) {
+		return (AE_OK);
+	}
+
+	info->count++;
+
+	/* Get and display the full pathname to this object */
+
+	buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
+	status = acpi_ns_handle_to_pathname(obj_handle, &buffer, TRUE);
+	if (ACPI_FAILURE(status)) {
+		acpi_os_printf("Could Not get pathname for object %p\n",
+			       obj_handle);
+		return (AE_OK);
+	}
+
+	acpi_os_printf("%s ", (char *)buffer.pointer);
+	ACPI_FREE(buffer.pointer);
+
+	buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
+	acpi_evaluate_object(obj_handle, NULL, NULL, &buffer);
+
+	ret_value = (union acpi_object *)buffer.pointer;
+	switch (ret_value->type) {
+	case ACPI_TYPE_INTEGER:
+
+		acpi_os_printf("%8.8X%8.8X",
+			       ACPI_FORMAT_UINT64(ret_value->integer.value));
+		break;
+
+	case ACPI_TYPE_BUFFER:
+
+		acpi_ut_dump_buffer(ret_value->buffer.pointer,
+				    ret_value->buffer.length,
+				    DB_DISPLAY_DATA_ONLY | DB_BYTE_DISPLAY, 0);
+		break;
+
+	default:
+
+		break;
+	}
+
+	acpi_os_printf("\n");
+
+	ACPI_FREE(buffer.pointer);
+	return (AE_OK);
+}
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_db_walk_for_specific_objects
@@ -628,6 +703,39 @@ acpi_status acpi_db_display_objects(char *obj_type_arg, char *display_count_arg)
 	return (AE_OK);
 }
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_db_display_fields
+ *
+ * PARAMETERS:  obj_type_arg        - Type of object to display
+ *              display_count_arg   - Max depth to display
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Display objects in the namespace of the requested type
+ *
+ ******************************************************************************/
+
+acpi_status acpi_db_display_fields(u32 address_space_id)
+{
+	ACPI_REGION_WALK_INFO info;
+
+	info.count = 0;
+	info.owner_id = ACPI_OWNER_ID_MAX;
+	info.debug_level = ACPI_UINT32_MAX;
+	info.display_type = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
+	info.address_space_id = address_space_id;
+
+	/* Walk the namespace from the root */
+
+	(void)acpi_walk_namespace(ACPI_TYPE_LOCAL_REGION_FIELD,
+				  ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
+				  acpi_db_walk_for_fields, NULL, (void *)&info,
+				  NULL);
+
+	return (AE_OK);
+}
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_db_integrity_walk
-- 
2.21.0


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

* [PATCH 08/12] ACPICA: debugger: surround field unit output with braces '{'
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
                   ` (6 preceding siblings ...)
  2019-10-24 18:55 ` [PATCH 07/12] ACPICA: Debugger: add command to dump all fields of a particular subtype Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-24 18:55 ` [PATCH 09/12] ACPICA: debugger: add field unit support for acpi_db_get_next_token Erik Schmauss
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Erik Schmauss, Bob Moore

ACPICA commit 76ca57291d007d33087982a4b28cd1ee9bcd37a6

This helps differentiate the type of named objects between field
units and buffers. In other words, without this symbol, it would be
difficult to tell whether a particular named object is a buffer or a
field unit.

Link: https://github.com/acpica/acpica/commit/76ca5729
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/dbnames.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/dbnames.c b/drivers/acpi/acpica/dbnames.c
index 06fe87c6647d..29a172869a6e 100644
--- a/drivers/acpi/acpica/dbnames.c
+++ b/drivers/acpi/acpica/dbnames.c
@@ -551,6 +551,11 @@ acpi_db_walk_for_fields(acpi_handle obj_handle,
 	buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
 	acpi_evaluate_object(obj_handle, NULL, NULL, &buffer);
 
+	/*
+	 * Since this is a field unit, surround the output in braces
+	 */
+	acpi_os_printf("{");
+
 	ret_value = (union acpi_object *)buffer.pointer;
 	switch (ret_value->type) {
 	case ACPI_TYPE_INTEGER:
@@ -571,7 +576,7 @@ acpi_db_walk_for_fields(acpi_handle obj_handle,
 		break;
 	}
 
-	acpi_os_printf("\n");
+	acpi_os_printf("}\n");
 
 	ACPI_FREE(buffer.pointer);
 	return (AE_OK);
-- 
2.21.0


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

* [PATCH 09/12] ACPICA: debugger: add field unit support for acpi_db_get_next_token
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
                   ` (7 preceding siblings ...)
  2019-10-24 18:55 ` [PATCH 08/12] ACPICA: debugger: surround field unit output with braces '{' Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-24 18:55 ` [PATCH 10/12] ACPICA: acpiexec: initialize all simple types and field units from user input Erik Schmauss
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Erik Schmauss, Bob Moore

ACPICA commit d509afa88e9415f13a3283c38ce9ee034634ae24

Since field unit data output from the debugger are now surrounded by
braces '{', support has been added to acpi_db_get_next_token to recognize
strings beginning with this character as a ACPI_TYPE_FIELD_UNIT.

Link: https://github.com/acpica/acpica/commit/d509afa8
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/dbinput.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/acpi/acpica/dbinput.c b/drivers/acpi/acpica/dbinput.c
index 44d6d7246e6e..26eee2dba0a4 100644
--- a/drivers/acpi/acpica/dbinput.c
+++ b/drivers/acpi/acpica/dbinput.c
@@ -511,6 +511,21 @@ char *acpi_db_get_next_token(char *string,
 		}
 		break;
 
+	case ' {':
+
+		/* This is the start of a field unit, scan until closing brace */
+
+		string++;
+		start = string;
+		type = ACPI_TYPE_FIELD_UNIT;
+
+		/* Find end of buffer */
+
+		while (*string && (*string != '}')) {
+			string++;
+		}
+		break;
+
 	case '[':
 
 		/* This is the start of a package, scan until closing bracket */
-- 
2.21.0


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

* [PATCH 10/12] ACPICA: acpiexec: initialize all simple types and field units from user input
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
                   ` (8 preceding siblings ...)
  2019-10-24 18:55 ` [PATCH 09/12] ACPICA: debugger: add field unit support for acpi_db_get_next_token Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-24 18:55 ` [PATCH 11/12] ACPICA: debugger: remove leading whitespaces when converting a string to a buffer Erik Schmauss
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Erik Schmauss, Bob Moore

ACPICA commit 367b363edc5fa1f93bbc14e4a1e05f34fef765a2

acpiexec allows a user to provide a file that indicates values to
initialize named objects during table load with the -fi option. This
can provide more accurate simulation by setting named objects to
values found during OS runtime.

Previously, this option only supported integer objects. This change
adds user initialization support for field units, strings, buffers,
and packages.

Link: https://github.com/acpica/acpica/commit/367b363e
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/dsfield.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c
index 9151f00dfbdc..faa38a22263a 100644
--- a/drivers/acpi/acpica/dsfield.c
+++ b/drivers/acpi/acpica/dsfield.c
@@ -263,7 +263,6 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
 	union acpi_parse_object *child;
 
 #ifdef ACPI_EXEC_APP
-	u64 value = 0;
 	union acpi_operand_object *result_desc;
 	union acpi_operand_object *obj_desc;
 	char *name_path;
@@ -405,19 +404,17 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
 					name_path =
 					    acpi_ns_get_external_pathname(info->
 									  field_node);
-					obj_desc =
-					    acpi_ut_create_integer_object
-					    (value);
 					if (ACPI_SUCCESS
 					    (ae_lookup_init_file_entry
-					     (name_path, &value))) {
+					     (name_path, &obj_desc))) {
 						acpi_ex_write_data_to_field
 						    (obj_desc,
 						     acpi_ns_get_attached_object
 						     (info->field_node),
 						     &result_desc);
+						acpi_ut_remove_reference
+						    (obj_desc);
 					}
-					acpi_ut_remove_reference(obj_desc);
 					ACPI_FREE(name_path);
 #endif
 				}
-- 
2.21.0


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

* [PATCH 11/12] ACPICA: debugger: remove leading whitespaces when converting a string to a buffer
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
                   ` (9 preceding siblings ...)
  2019-10-24 18:55 ` [PATCH 10/12] ACPICA: acpiexec: initialize all simple types and field units from user input Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-24 18:55 ` [PATCH 12/12] ACPICA: Update version to 20191018 Erik Schmauss
  2019-10-25  9:19 ` [PATCH 00/12] ACPICA version 20191018 Rafael J. Wysocki
  12 siblings, 0 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Erik Schmauss, Bob Moore

ACPICA commit 1b7228072f254a5b02625586ff7d561757b7fc2d

By removing leading whitespaces, the conversion computes the
correct number of elements in a given buffer or field encoding that
contains leading whitespaces.

Link: https://github.com/acpica/acpica/commit/1b722807
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/dbconvert.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/acpi/acpica/dbconvert.c b/drivers/acpi/acpica/dbconvert.c
index 9fd9a98a9cbe..2b84ac093698 100644
--- a/drivers/acpi/acpica/dbconvert.c
+++ b/drivers/acpi/acpica/dbconvert.c
@@ -106,6 +106,10 @@ acpi_db_convert_to_buffer(char *string, union acpi_object *object)
 	u8 *buffer;
 	acpi_status status;
 
+	/* Skip all preceding white space */
+
+	acpi_ut_remove_whitespace(&string);
+
 	/* Generate the final buffer length */
 
 	for (i = 0, length = 0; string[i];) {
-- 
2.21.0


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

* [PATCH 12/12] ACPICA: Update version to 20191018
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
                   ` (10 preceding siblings ...)
  2019-10-24 18:55 ` [PATCH 11/12] ACPICA: debugger: remove leading whitespaces when converting a string to a buffer Erik Schmauss
@ 2019-10-24 18:55 ` Erik Schmauss
  2019-10-25  9:19 ` [PATCH 00/12] ACPICA version 20191018 Rafael J. Wysocki
  12 siblings, 0 replies; 20+ messages in thread
From: Erik Schmauss @ 2019-10-24 18:55 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi; +Cc: Bob Moore, Erik Schmauss

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

ACPICA commit 3d70fd4894824ed1e685f2d059ca22ccd9ac6163

Version 20191018.

Link: https://github.com/acpica/acpica/commit/3d70fd48
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
---
 include/acpi/acpixf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 867170049b07..18790b9e16b5 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -12,7 +12,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20190816
+#define ACPI_CA_VERSION                 0x20191018
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
-- 
2.21.0


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

* Re: [PATCH 05/12] ACPICA: make acpi_load_table() return table index
  2019-10-24 18:55 ` [PATCH 05/12] ACPICA: make acpi_load_table() return table index Erik Schmauss
@ 2019-10-25  8:19   ` Andy Shevchenko
  2019-10-25  8:22     ` Rafael J. Wysocki
  0 siblings, 1 reply; 20+ messages in thread
From: Andy Shevchenko @ 2019-10-25  8:19 UTC (permalink / raw)
  To: Erik Schmauss; +Cc: Rafael J . Wysocki, linux-acpi, Nikolaus Voss, Bob Moore

On Thu, Oct 24, 2019 at 11:55:49AM -0700, Erik Schmauss wrote:
> From: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
> 
> ACPICA commit d1716a829d19be23277d9157c575a03b9abb7457
> 
> For unloading an ACPI table, it is necessary to provide the index of
> the table. The method intended for dynamically loading or hotplug
> addition of tables, acpi_load_table(), should provide this information
> via an optional pointer to the loaded table index.
> 
> This patch fixes the table unload function of acpi_configfs.
> 

Thank you!

My comments below.

First of all, can I be Cc'ed to all series to be able to test?

> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Fixes: d06c47e3dd07f ("ACPI: configfs: Resolve objects on host-directed
> table loads")

I believe this has to be one line.

> --- a/drivers/acpi/acpi_configfs.c
> +++ b/drivers/acpi/acpi_configfs.c
> @@ -53,7 +53,7 @@ static ssize_t acpi_table_aml_write(struct config_item *cfg,
>  	if (!table->header)
>  		return -ENOMEM;
>  
> -	ret = acpi_load_table(table->header);
> +	ret = acpi_load_table(table->header, &table->index);
>  	if (ret) {
>  		kfree(table->header);
>  		table->header = NULL;

As far as I understood the release notes of latest ACPICA there is also a
counterpart function being provided. That said, we need to modify ConfigFS
removing path to use the new API.

Am I correct?

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 05/12] ACPICA: make acpi_load_table() return table index
  2019-10-25  8:19   ` Andy Shevchenko
@ 2019-10-25  8:22     ` Rafael J. Wysocki
  0 siblings, 0 replies; 20+ messages in thread
From: Rafael J. Wysocki @ 2019-10-25  8:22 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Erik Schmauss, Rafael J . Wysocki, ACPI Devel Maling List,
	Nikolaus Voss, Bob Moore

On Fri, Oct 25, 2019 at 10:19 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Oct 24, 2019 at 11:55:49AM -0700, Erik Schmauss wrote:
> > From: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
> >
> > ACPICA commit d1716a829d19be23277d9157c575a03b9abb7457
> >
> > For unloading an ACPI table, it is necessary to provide the index of
> > the table. The method intended for dynamically loading or hotplug
> > addition of tables, acpi_load_table(), should provide this information
> > via an optional pointer to the loaded table index.
> >
> > This patch fixes the table unload function of acpi_configfs.
> >
>
> Thank you!
>
> My comments below.
>
> First of all, can I be Cc'ed to all series to be able to test?
>
> > Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> > Fixes: d06c47e3dd07f ("ACPI: configfs: Resolve objects on host-directed
> > table loads")
>
> I believe this has to be one line.

Yes, it does, but I fix up such things, so no worries.

> > --- a/drivers/acpi/acpi_configfs.c
> > +++ b/drivers/acpi/acpi_configfs.c
> > @@ -53,7 +53,7 @@ static ssize_t acpi_table_aml_write(struct config_item *cfg,
> >       if (!table->header)
> >               return -ENOMEM;
> >
> > -     ret = acpi_load_table(table->header);
> > +     ret = acpi_load_table(table->header, &table->index);
> >       if (ret) {
> >               kfree(table->header);
> >               table->header = NULL;
>
> As far as I understood the release notes of latest ACPICA there is also a
> counterpart function being provided. That said, we need to modify ConfigFS
> removing path to use the new API.
>
> Am I correct?

Yes, you are.  These are just ACPICA changes and we still need to
update the configfs I/F on top of them.

Cheers!

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

* Re: [PATCH 00/12] ACPICA version 20191018
  2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
                   ` (11 preceding siblings ...)
  2019-10-24 18:55 ` [PATCH 12/12] ACPICA: Update version to 20191018 Erik Schmauss
@ 2019-10-25  9:19 ` Rafael J. Wysocki
  2019-10-25 17:08   ` Schmauss, Erik
  12 siblings, 1 reply; 20+ messages in thread
From: Rafael J. Wysocki @ 2019-10-25  9:19 UTC (permalink / raw)
  To: Erik Schmauss; +Cc: Rafael J . Wysocki, ACPI Devel Maling List

On Thu, Oct 24, 2019 at 9:13 PM Erik Schmauss <erik.schmauss@intel.com> wrote:
>
> This patchset contains the linuxized patches for ACPICA version
> 20191018. There are several debugger changes but they are meant for
> acpiexec at this time. acpi_load_table definition has been modified and
> a new acpi_unload_table has been added. These new interfaces can be used
> as a part of config fs to load and unload tables.
>
> Other than that, Bob has run clang on our code base and removed several
> compiler warnings.
>
> This patchset is also available here:
> https://github.com/SchmErik/linux/tree/v20191018
>
> Bob Moore (5):
>   ACPICA: Results from Clang changes/fixes From Clang V5.0.1. Mostly
>     "set but never read" warnings.
>   ACPICA: Win OSL: Replace get_tick_count with get_tick_count64
>   ACPICA: More Clang changes - V8.0.1 Fixed all "dead assignment"
>     warnings.
>   ACPICA: Add new external interface, acpi_unload_table
>   ACPICA: Update version to 20191018
>
> Erik Schmauss (6):
>   ACPICA: utilities: add flag to only display data when dumping buffers
>   ACPICA: Debugger: add command to dump all fields of a particular
>     subtype
>   ACPICA: debugger: surround field unit output with braces '{'
>   ACPICA: debugger: add field unit support for acpi_db_get_next_token
>   ACPICA: acpiexec: initialize all simple types and field units from
>     user input
>   ACPICA: debugger: remove leading whitespaces when converting a string
>     to a buffer
>
> Nikolaus Voss (1):
>   ACPICA: make acpi_load_table() return table index

Queuing up as 5.5 material with some minor subject/changelog modifications.

Thanks!

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

* RE: [PATCH 00/12] ACPICA version 20191018
  2019-10-25  9:19 ` [PATCH 00/12] ACPICA version 20191018 Rafael J. Wysocki
@ 2019-10-25 17:08   ` Schmauss, Erik
  2019-10-28 15:08     ` Rafael J. Wysocki
  0 siblings, 1 reply; 20+ messages in thread
From: Schmauss, Erik @ 2019-10-25 17:08 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: ACPI Devel Maling List



> -----Original Message-----
> From: Rafael J. Wysocki <rafael@kernel.org>
> Sent: Friday, October 25, 2019 2:19 AM
> To: Schmauss, Erik <erik.schmauss@intel.com>
> Cc: Rafael J . Wysocki <rafael@kernel.org>; ACPI Devel Maling List <linux-
> acpi@vger.kernel.org>
> Subject: Re: [PATCH 00/12] ACPICA version 20191018
> 
> On Thu, Oct 24, 2019 at 9:13 PM Erik Schmauss <erik.schmauss@intel.com>
> wrote:
> >
> > This patchset contains the linuxized patches for ACPICA version
> > 20191018. There are several debugger changes but they are meant for
> > acpiexec at this time. acpi_load_table definition has been modified
> > and a new acpi_unload_table has been added. These new interfaces can
> > be used as a part of config fs to load and unload tables.
> >
> > Other than that, Bob has run clang on our code base and removed
> > several compiler warnings.
> >
> > This patchset is also available here:
> > https://github.com/SchmErik/linux/tree/v20191018
> >
> > Bob Moore (5):
> >   ACPICA: Results from Clang changes/fixes From Clang V5.0.1. Mostly
> >     "set but never read" warnings.
> >   ACPICA: Win OSL: Replace get_tick_count with get_tick_count64
> >   ACPICA: More Clang changes - V8.0.1 Fixed all "dead assignment"
> >     warnings.
> >   ACPICA: Add new external interface, acpi_unload_table
> >   ACPICA: Update version to 20191018
> >
> > Erik Schmauss (6):
> >   ACPICA: utilities: add flag to only display data when dumping buffers
> >   ACPICA: Debugger: add command to dump all fields of a particular
> >     subtype
> >   ACPICA: debugger: surround field unit output with braces '{'
> >   ACPICA: debugger: add field unit support for acpi_db_get_next_token
> >   ACPICA: acpiexec: initialize all simple types and field units from
> >     user input
> >   ACPICA: debugger: remove leading whitespaces when converting a string
> >     to a buffer
> >
> > Nikolaus Voss (1):
> >   ACPICA: make acpi_load_table() return table index
> 
> Queuing up as 5.5 material with some minor subject/changelog modifications.
[Schmauss, Erik]

Sorry about the build errors...I'll send a v2 today.
> 
> Thanks!

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

* Re: [PATCH 07/12] ACPICA: Debugger: add command to dump all fields of a particular subtype
  2019-10-24 18:55 ` [PATCH 07/12] ACPICA: Debugger: add command to dump all fields of a particular subtype Erik Schmauss
@ 2019-10-27 20:57   ` kbuild test robot
  2019-10-27 21:33   ` kbuild test robot
  1 sibling, 0 replies; 20+ messages in thread
From: kbuild test robot @ 2019-10-27 20:57 UTC (permalink / raw)
  To: Erik Schmauss
  Cc: kbuild-all, Rafael J . Wysocki, linux-acpi, Erik Schmauss, Bob Moore

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

Hi Erik,

I love your patch! Perhaps something to improve:

[auto build test WARNING on pm/linux-next]
[also build test WARNING on v5.4-rc5 next-20191025]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Erik-Schmauss/ACPICA-version-20191018/20191028-014314
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: i386-randconfig-e001-201943 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/acpi/acpica/dbnames.c: In function 'acpi_db_walk_for_fields':
   drivers/acpi/acpica/dbnames.c:523:2: error: unknown type name 'ACPI_REGION_WALK_INFO'; did you mean 'ACPI_COMMON_FIELD_INFO'?
     ACPI_REGION_WALK_INFO *info = (ACPI_REGION_WALK_INFO *) context;
     ^~~~~~~~~~~~~~~~~~~~~
     ACPI_COMMON_FIELD_INFO
   drivers/acpi/acpica/dbnames.c:523:33: error: 'ACPI_REGION_WALK_INFO' undeclared (first use in this function); did you mean 'ACPI_COMMON_FIELD_INFO'?
     ACPI_REGION_WALK_INFO *info = (ACPI_REGION_WALK_INFO *) context;
                                    ^~~~~~~~~~~~~~~~~~~~~
                                    ACPI_COMMON_FIELD_INFO
   drivers/acpi/acpica/dbnames.c:523:33: note: each undeclared identifier is reported only once for each function it appears in
   drivers/acpi/acpica/dbnames.c:523:56: error: expected expression before ')' token
     ACPI_REGION_WALK_INFO *info = (ACPI_REGION_WALK_INFO *) context;
                                                           ^
   In file included from include/linux/string.h:6:0,
                    from include/acpi/platform/aclinux.h:52,
                    from include/acpi/platform/acenv.h:152,
                    from include/acpi/acpi.h:22,
                    from drivers/acpi/acpica/dbnames.c:8:
   drivers/acpi/acpica/dbnames.c:532:10: error: request for member 'address_space_id' in something not a structure or union
         info->address_space_id) {
             ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> drivers/acpi/acpica/dbnames.c:531:2: note: in expansion of macro 'if'
     if (node->object->field.region_obj->region.space_id !=
     ^~
   drivers/acpi/acpica/dbnames.c:532:10: error: request for member 'address_space_id' in something not a structure or union
         info->address_space_id) {
             ^
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                ^~~~
>> drivers/acpi/acpica/dbnames.c:531:2: note: in expansion of macro 'if'
     if (node->object->field.region_obj->region.space_id !=
     ^~
   drivers/acpi/acpica/dbnames.c:532:10: error: request for member 'address_space_id' in something not a structure or union
         info->address_space_id) {
             ^
   include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
     (cond) ?     \
      ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
    #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                               ^~~~~~~~~~~~~~
>> drivers/acpi/acpica/dbnames.c:531:2: note: in expansion of macro 'if'
     if (node->object->field.region_obj->region.space_id !=
     ^~
   drivers/acpi/acpica/dbnames.c:536:6: error: request for member 'count' in something not a structure or union
     info->count++;
         ^~
   drivers/acpi/acpica/dbnames.c: In function 'acpi_db_display_fields':
   drivers/acpi/acpica/dbnames.c:721:2: error: unknown type name 'ACPI_REGION_WALK_INFO'; did you mean 'ACPI_COMMON_FIELD_INFO'?
     ACPI_REGION_WALK_INFO info;
     ^~~~~~~~~~~~~~~~~~~~~
     ACPI_COMMON_FIELD_INFO
   drivers/acpi/acpica/dbnames.c:723:6: error: request for member 'count' in something not a structure or union
     info.count = 0;
         ^
   drivers/acpi/acpica/dbnames.c:724:6: error: request for member 'owner_id' in something not a structure or union
     info.owner_id = ACPI_OWNER_ID_MAX;
         ^
   drivers/acpi/acpica/dbnames.c:725:6: error: request for member 'debug_level' in something not a structure or union
     info.debug_level = ACPI_UINT32_MAX;
         ^
   drivers/acpi/acpica/dbnames.c:726:6: error: request for member 'display_type' in something not a structure or union
     info.display_type = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
         ^
   drivers/acpi/acpica/dbnames.c:727:6: error: request for member 'address_space_id' in something not a structure or union
     info.address_space_id = address_space_id;
         ^

vim +/if +531 drivers/acpi/acpica/dbnames.c

   505	
   506	/*******************************************************************************
   507	 *
   508	 * FUNCTION:    acpi_db_walk_for_fields
   509	 *
   510	 * PARAMETERS:  Callback from walk_namespace
   511	 *
   512	 * RETURN:      Status
   513	 *
   514	 * DESCRIPTION: Display short info about objects in the namespace
   515	 *
   516	 ******************************************************************************/
   517	
   518	static acpi_status
   519	acpi_db_walk_for_fields(acpi_handle obj_handle,
   520				u32 nesting_level, void *context, void **return_value)
   521	{
   522		union acpi_object *ret_value;
   523		ACPI_REGION_WALK_INFO *info = (ACPI_REGION_WALK_INFO *) context;
   524		struct acpi_buffer buffer;
   525		acpi_status status;
   526		struct acpi_namespace_node *node = acpi_ns_validate_handle(obj_handle);
   527	
   528		if (!node) {
   529			return (AE_OK);
   530		}
 > 531		if (node->object->field.region_obj->region.space_id !=
   532		    info->address_space_id) {
   533			return (AE_OK);
   534		}
   535	
   536		info->count++;
   537	
   538		/* Get and display the full pathname to this object */
   539	
   540		buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
   541		status = acpi_ns_handle_to_pathname(obj_handle, &buffer, TRUE);
   542		if (ACPI_FAILURE(status)) {
   543			acpi_os_printf("Could Not get pathname for object %p\n",
   544				       obj_handle);
   545			return (AE_OK);
   546		}
   547	
   548		acpi_os_printf("%s ", (char *)buffer.pointer);
   549		ACPI_FREE(buffer.pointer);
   550	
   551		buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
   552		acpi_evaluate_object(obj_handle, NULL, NULL, &buffer);
   553	
   554		ret_value = (union acpi_object *)buffer.pointer;
   555		switch (ret_value->type) {
   556		case ACPI_TYPE_INTEGER:
   557	
   558			acpi_os_printf("%8.8X%8.8X",
   559				       ACPI_FORMAT_UINT64(ret_value->integer.value));
   560			break;
   561	
   562		case ACPI_TYPE_BUFFER:
   563	
   564			acpi_ut_dump_buffer(ret_value->buffer.pointer,
   565					    ret_value->buffer.length,
   566					    DB_DISPLAY_DATA_ONLY | DB_BYTE_DISPLAY, 0);
   567			break;
   568	
   569		default:
   570	
   571			break;
   572		}
   573	
   574		acpi_os_printf("\n");
   575	
   576		ACPI_FREE(buffer.pointer);
   577		return (AE_OK);
   578	}
   579	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35281 bytes --]

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

* Re: [PATCH 07/12] ACPICA: Debugger: add command to dump all fields of a particular subtype
  2019-10-24 18:55 ` [PATCH 07/12] ACPICA: Debugger: add command to dump all fields of a particular subtype Erik Schmauss
  2019-10-27 20:57   ` kbuild test robot
@ 2019-10-27 21:33   ` kbuild test robot
  1 sibling, 0 replies; 20+ messages in thread
From: kbuild test robot @ 2019-10-27 21:33 UTC (permalink / raw)
  To: Erik Schmauss
  Cc: kbuild-all, Rafael J . Wysocki, linux-acpi, Erik Schmauss, Bob Moore

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

Hi Erik,

I love your patch! Yet something to improve:

[auto build test ERROR on pm/linux-next]
[cannot apply to v5.4-rc5 next-20191025]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Erik-Schmauss/ACPICA-version-20191018/20191028-014314
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-randconfig-a002-201943 (attached as .config)
compiler: gcc-6 (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/acpi/acpica/dbnames.c: In function 'acpi_db_walk_for_fields':
>> drivers/acpi/acpica/dbnames.c:523:2: error: unknown type name 'ACPI_REGION_WALK_INFO'
     ACPI_REGION_WALK_INFO *info = (ACPI_REGION_WALK_INFO *) context;
     ^~~~~~~~~~~~~~~~~~~~~
>> drivers/acpi/acpica/dbnames.c:523:33: error: 'ACPI_REGION_WALK_INFO' undeclared (first use in this function)
     ACPI_REGION_WALK_INFO *info = (ACPI_REGION_WALK_INFO *) context;
                                    ^~~~~~~~~~~~~~~~~~~~~
   drivers/acpi/acpica/dbnames.c:523:33: note: each undeclared identifier is reported only once for each function it appears in
   drivers/acpi/acpica/dbnames.c:523:56: error: expected expression before ')' token
     ACPI_REGION_WALK_INFO *info = (ACPI_REGION_WALK_INFO *) context;
                                                           ^
   drivers/acpi/acpica/dbnames.c:532:10: error: request for member 'address_space_id' in something not a structure or union
         info->address_space_id) {
             ^~
   drivers/acpi/acpica/dbnames.c:536:6: error: request for member 'count' in something not a structure or union
     info->count++;
         ^~
   drivers/acpi/acpica/dbnames.c: In function 'acpi_db_display_fields':
   drivers/acpi/acpica/dbnames.c:721:2: error: unknown type name 'ACPI_REGION_WALK_INFO'
     ACPI_REGION_WALK_INFO info;
     ^~~~~~~~~~~~~~~~~~~~~
   drivers/acpi/acpica/dbnames.c:723:6: error: request for member 'count' in something not a structure or union
     info.count = 0;
         ^
   drivers/acpi/acpica/dbnames.c:724:6: error: request for member 'owner_id' in something not a structure or union
     info.owner_id = ACPI_OWNER_ID_MAX;
         ^
   drivers/acpi/acpica/dbnames.c:725:6: error: request for member 'debug_level' in something not a structure or union
     info.debug_level = ACPI_UINT32_MAX;
         ^
   drivers/acpi/acpica/dbnames.c:726:6: error: request for member 'display_type' in something not a structure or union
     info.display_type = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
         ^
   drivers/acpi/acpica/dbnames.c:727:6: error: request for member 'address_space_id' in something not a structure or union
     info.address_space_id = address_space_id;
         ^

vim +/ACPI_REGION_WALK_INFO +523 drivers/acpi/acpica/dbnames.c

   505	
   506	/*******************************************************************************
   507	 *
   508	 * FUNCTION:    acpi_db_walk_for_fields
   509	 *
   510	 * PARAMETERS:  Callback from walk_namespace
   511	 *
   512	 * RETURN:      Status
   513	 *
   514	 * DESCRIPTION: Display short info about objects in the namespace
   515	 *
   516	 ******************************************************************************/
   517	
   518	static acpi_status
   519	acpi_db_walk_for_fields(acpi_handle obj_handle,
   520				u32 nesting_level, void *context, void **return_value)
   521	{
   522		union acpi_object *ret_value;
 > 523		ACPI_REGION_WALK_INFO *info = (ACPI_REGION_WALK_INFO *) context;
   524		struct acpi_buffer buffer;
   525		acpi_status status;
   526		struct acpi_namespace_node *node = acpi_ns_validate_handle(obj_handle);
   527	
   528		if (!node) {
   529			return (AE_OK);
   530		}
   531		if (node->object->field.region_obj->region.space_id !=
   532		    info->address_space_id) {
   533			return (AE_OK);
   534		}
   535	
   536		info->count++;
   537	
   538		/* Get and display the full pathname to this object */
   539	
   540		buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
   541		status = acpi_ns_handle_to_pathname(obj_handle, &buffer, TRUE);
   542		if (ACPI_FAILURE(status)) {
   543			acpi_os_printf("Could Not get pathname for object %p\n",
   544				       obj_handle);
   545			return (AE_OK);
   546		}
   547	
   548		acpi_os_printf("%s ", (char *)buffer.pointer);
   549		ACPI_FREE(buffer.pointer);
   550	
   551		buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
   552		acpi_evaluate_object(obj_handle, NULL, NULL, &buffer);
   553	
   554		ret_value = (union acpi_object *)buffer.pointer;
   555		switch (ret_value->type) {
   556		case ACPI_TYPE_INTEGER:
   557	
   558			acpi_os_printf("%8.8X%8.8X",
   559				       ACPI_FORMAT_UINT64(ret_value->integer.value));
   560			break;
   561	
   562		case ACPI_TYPE_BUFFER:
   563	
   564			acpi_ut_dump_buffer(ret_value->buffer.pointer,
   565					    ret_value->buffer.length,
   566					    DB_DISPLAY_DATA_ONLY | DB_BYTE_DISPLAY, 0);
   567			break;
   568	
   569		default:
   570	
   571			break;
   572		}
   573	
   574		acpi_os_printf("\n");
   575	
   576		ACPI_FREE(buffer.pointer);
   577		return (AE_OK);
   578	}
   579	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36772 bytes --]

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

* Re: [PATCH 00/12] ACPICA version 20191018
  2019-10-25 17:08   ` Schmauss, Erik
@ 2019-10-28 15:08     ` Rafael J. Wysocki
  0 siblings, 0 replies; 20+ messages in thread
From: Rafael J. Wysocki @ 2019-10-28 15:08 UTC (permalink / raw)
  To: Schmauss, Erik; +Cc: Rafael J. Wysocki, ACPI Devel Maling List

On Friday, October 25, 2019 7:08:14 PM CET Schmauss, Erik wrote:
> 
> > -----Original Message-----
> > From: Rafael J. Wysocki <rafael@kernel.org>
> > Sent: Friday, October 25, 2019 2:19 AM
> > To: Schmauss, Erik <erik.schmauss@intel.com>
> > Cc: Rafael J . Wysocki <rafael@kernel.org>; ACPI Devel Maling List <linux-
> > acpi@vger.kernel.org>
> > Subject: Re: [PATCH 00/12] ACPICA version 20191018
> > 
> > On Thu, Oct 24, 2019 at 9:13 PM Erik Schmauss <erik.schmauss@intel.com>
> > wrote:
> > >
> > > This patchset contains the linuxized patches for ACPICA version
> > > 20191018. There are several debugger changes but they are meant for
> > > acpiexec at this time. acpi_load_table definition has been modified
> > > and a new acpi_unload_table has been added. These new interfaces can
> > > be used as a part of config fs to load and unload tables.
> > >
> > > Other than that, Bob has run clang on our code base and removed
> > > several compiler warnings.
> > >
> > > This patchset is also available here:
> > > https://github.com/SchmErik/linux/tree/v20191018
> > >
> > > Bob Moore (5):
> > >   ACPICA: Results from Clang changes/fixes From Clang V5.0.1. Mostly
> > >     "set but never read" warnings.
> > >   ACPICA: Win OSL: Replace get_tick_count with get_tick_count64
> > >   ACPICA: More Clang changes - V8.0.1 Fixed all "dead assignment"
> > >     warnings.
> > >   ACPICA: Add new external interface, acpi_unload_table
> > >   ACPICA: Update version to 20191018
> > >
> > > Erik Schmauss (6):
> > >   ACPICA: utilities: add flag to only display data when dumping buffers
> > >   ACPICA: Debugger: add command to dump all fields of a particular
> > >     subtype
> > >   ACPICA: debugger: surround field unit output with braces '{'
> > >   ACPICA: debugger: add field unit support for acpi_db_get_next_token
> > >   ACPICA: acpiexec: initialize all simple types and field units from
> > >     user input
> > >   ACPICA: debugger: remove leading whitespaces when converting a string
> > >     to a buffer
> > >
> > > Nikolaus Voss (1):
> > >   ACPICA: make acpi_load_table() return table index
> > 
> > Queuing up as 5.5 material with some minor subject/changelog modifications.
> [Schmauss, Erik]
> 
> Sorry about the build errors...I'll send a v2 today.

Replacing this one with the v2 in my tree, thanks!




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

end of thread, other threads:[~2019-10-28 15:08 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24 18:55 [PATCH 00/12] ACPICA version 20191018 Erik Schmauss
2019-10-24 18:55 ` [PATCH 01/12] ACPICA: Results from Clang changes/fixes From Clang V5.0.1. Mostly "set but never read" warnings Erik Schmauss
2019-10-24 18:55 ` [PATCH 02/12] ACPICA: Win OSL: Replace get_tick_count with get_tick_count64 Erik Schmauss
2019-10-24 18:55 ` [PATCH 03/12] ACPICA: More Clang changes - V8.0.1 Fixed all "dead assignment" warnings Erik Schmauss
2019-10-24 18:55 ` [PATCH 04/12] ACPICA: Add new external interface, acpi_unload_table Erik Schmauss
2019-10-24 18:55 ` [PATCH 05/12] ACPICA: make acpi_load_table() return table index Erik Schmauss
2019-10-25  8:19   ` Andy Shevchenko
2019-10-25  8:22     ` Rafael J. Wysocki
2019-10-24 18:55 ` [PATCH 06/12] ACPICA: utilities: add flag to only display data when dumping buffers Erik Schmauss
2019-10-24 18:55 ` [PATCH 07/12] ACPICA: Debugger: add command to dump all fields of a particular subtype Erik Schmauss
2019-10-27 20:57   ` kbuild test robot
2019-10-27 21:33   ` kbuild test robot
2019-10-24 18:55 ` [PATCH 08/12] ACPICA: debugger: surround field unit output with braces '{' Erik Schmauss
2019-10-24 18:55 ` [PATCH 09/12] ACPICA: debugger: add field unit support for acpi_db_get_next_token Erik Schmauss
2019-10-24 18:55 ` [PATCH 10/12] ACPICA: acpiexec: initialize all simple types and field units from user input Erik Schmauss
2019-10-24 18:55 ` [PATCH 11/12] ACPICA: debugger: remove leading whitespaces when converting a string to a buffer Erik Schmauss
2019-10-24 18:55 ` [PATCH 12/12] ACPICA: Update version to 20191018 Erik Schmauss
2019-10-25  9:19 ` [PATCH 00/12] ACPICA version 20191018 Rafael J. Wysocki
2019-10-25 17:08   ` Schmauss, Erik
2019-10-28 15:08     ` Rafael J. Wysocki

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