All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] ACPICA 20130823 Release
@ 2013-09-12  8:54 Lv Zheng
  2013-09-12  8:54 ` [PATCH 01/14] ACPICA: Improve error message for "too many parent prefixes" condition Lv Zheng
                   ` (15 more replies)
  0 siblings, 16 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:54 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

The 20130823 ACPICA kernel resident system updates is linuxized based on
the pm/linux-next branch.

The patch set has passed a build/boot test on the following machines:
Dell Inspiron Mini 1010 (i386)
HP Compaq 8200 Elite SFF PC (x86-64)
With the following kernel configuration items enabled:
  CONFIG_ACPI_AC
  CONFIG_ACPI_BATTERY
  CONFIG_ACPI_NUMA
  CONFIG_ACPI_PROCESSOR
  CONFIG_ACPI_THERMAL
  CONFIG_ACPI_VIDEO
  CONFIG_CPU_FREQ
  CONFIG_I2C_SCMI
  CONFIG_SENSORS_ACPI_POWER
  CONFIG_PANASONIC_LAPTOP
  CONFIG_XO15_EBOOK
  CONFIG_DMAR_TABLE
  CONFIG_INTEL_IOMMU
  CONFIG_IRQ_REMAP
New divergences are introduced in this release due to the deletion of
the following patches:
  ACPICA: iASL/disassembler: Add support for external method reference
    file.
  ACPICA: Tables: Add multiple table instances support.
They are AcpiDump specific updates and will appear along with AcpiDump
release during next release.

NOTE: Label indentation is not fixed in this series, it can be fixed
      by another ACPICA commit that changes the indent option to do so.

Please review.

Bjorn Helgaas (1):
  ACPICA: acpi_read: On error, do not modify the return value target
    location.

Bob Moore (7):
  ACPICA: Improve error message for "too many parent prefixes"
    condition.
  ACPICA: Debug output: small formatting update, no functional change.
  ACPICA: Debugger: Prevent possible command line buffer overflow.
  ACPICA: Validate start object for acpi_walk_namespace.
  ACPICA: Debugger: Add new command to display full namespace
    pathnames.
  ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary
    argument.
  ACPICA: Update version to 20130823.

David E. Box (1):
  ACPICA: Operation region support: Never free the handler "context"
    pointer.

Lv Zheng (4):
  ACPICA: Add support for host-installed SCI handlers.
  ACPICA: Tables: Cleanup table checksum verification code.
  ACPICA: Tables: Cleanup RSDP signature codes.
  ACPICA: Cleanup exception codes.

Naresh Bhat (1):
  ACPICA: Linux-specific header: enable "aarch64" 64-bit build.

 drivers/acpi/acpica/acdebug.h   |    5 +-
 drivers/acpi/acpica/acevents.h  |    6 +-
 drivers/acpi/acpica/acglobal.h  |   18 +++--
 drivers/acpi/acpica/aclocal.h   |    8 +++
 drivers/acpi/acpica/acnamesp.h  |    6 ++
 drivers/acpi/acpica/evgpeutil.c |    2 +-
 drivers/acpi/acpica/evmisc.c    |   14 ++--
 drivers/acpi/acpica/evregion.c  |   23 ++++---
 drivers/acpi/acpica/evsci.c     |   78 ++++++++++++++++++++--
 drivers/acpi/acpica/evxface.c   |  139 +++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/hwxface.c   |   26 ++++----
 drivers/acpi/acpica/nsaccess.c  |    5 +-
 drivers/acpi/acpica/nsdump.c    |  134 +++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/nsxfeval.c  |    8 +++
 drivers/acpi/acpica/tbinstal.c  |   12 +---
 drivers/acpi/acpica/tbprint.c   |   12 +++-
 drivers/acpi/acpica/tbxfroot.c  |    3 +-
 drivers/acpi/acpica/utdebug.c   |    2 +-
 drivers/acpi/acpica/utglobal.c  |    3 +-
 include/acpi/acexcep.h          |    8 ++-
 include/acpi/acpixf.h           |   15 +++--
 include/acpi/actypes.h          |    8 +++
 include/acpi/platform/aclinux.h |    2 +-
 23 files changed, 465 insertions(+), 72 deletions(-)

-- 
1.7.10


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

* [PATCH 01/14] ACPICA: Improve error message for "too many parent prefixes" condition.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
@ 2013-09-12  8:54 ` Lv Zheng
  2013-09-12  8:54 ` [PATCH 02/14] ACPICA: acpi_read: On error, do not modify the return value target location Lv Zheng
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:54 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Emit the full offending pathname in the error message.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/nsaccess.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index c5316e5..aff79c7 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -424,8 +424,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
 					/* Current scope has no parent scope */
 
 					ACPI_ERROR((AE_INFO,
-						    "ACPI path has too many parent prefixes (^) "
-						    "- reached beyond root node"));
+						    "%s: Path has too many parent prefixes (^) "
+						    "- reached beyond root node",
+						    pathname));
 					return_ACPI_STATUS(AE_NOT_FOUND);
 				}
 			}
-- 
1.7.10


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

* [PATCH 02/14] ACPICA: acpi_read: On error, do not modify the return value target location.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
  2013-09-12  8:54 ` [PATCH 01/14] ACPICA: Improve error message for "too many parent prefixes" condition Lv Zheng
@ 2013-09-12  8:54 ` Lv Zheng
  2013-09-12  8:54 ` [PATCH 03/14] ACPICA: Debug output: small formatting update, no functional change Lv Zheng
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:54 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown
  Cc: Lv Zheng, linux-acpi, Bjorn Helgaas

From: Bjorn Helgaas <bjorn.helgaas@hp.com>

If an error happens in the middle of a split 32/32 64-bit I/O
operation, do not modify the target of the return value pointer.
Makes the code consistent with the rest of ACPICA. Bjorn Helgaas.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/hwxface.c |   26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index 5ee7a81..f81fb06 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -119,7 +119,8 @@ ACPI_EXPORT_SYMBOL(acpi_reset)
  ******************************************************************************/
 acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
 {
-	u32 value;
+	u32 value_lo;
+	u32 value_hi;
 	u32 width;
 	u64 address;
 	acpi_status status;
@@ -137,13 +138,8 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
 		return (status);
 	}
 
-	/* Initialize entire 64-bit return value to zero */
-
-	*return_value = 0;
-	value = 0;
-
 	/*
-	 * Two address spaces supported: Memory or IO. PCI_Config is
+	 * Two address spaces supported: Memory or I/O. PCI_Config is
 	 * not supported here because the GAS structure is insufficient
 	 */
 	if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
@@ -155,29 +151,35 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
 		}
 	} else {		/* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
 
+		value_lo = 0;
+		value_hi = 0;
+
 		width = reg->bit_width;
 		if (width == 64) {
 			width = 32;	/* Break into two 32-bit transfers */
 		}
 
 		status = acpi_hw_read_port((acpi_io_address)
-					   address, &value, width);
+					   address, &value_lo, width);
 		if (ACPI_FAILURE(status)) {
 			return (status);
 		}
-		*return_value = value;
 
 		if (reg->bit_width == 64) {
 
 			/* Read the top 32 bits */
 
 			status = acpi_hw_read_port((acpi_io_address)
-						   (address + 4), &value, 32);
+						   (address + 4), &value_hi,
+						   32);
 			if (ACPI_FAILURE(status)) {
 				return (status);
 			}
-			*return_value |= ((u64)value << 32);
 		}
+
+		/* Set the return value only if status is AE_OK */
+
+		*return_value = (value_lo | ((u64)value_hi << 32));
 	}
 
 	ACPI_DEBUG_PRINT((ACPI_DB_IO,
@@ -186,7 +188,7 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
 			  ACPI_FORMAT_UINT64(address),
 			  acpi_ut_get_region_name(reg->space_id)));
 
-	return (status);
+	return (AE_OK);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_read)
-- 
1.7.10


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

* [PATCH 03/14] ACPICA: Debug output: small formatting update, no functional change.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
  2013-09-12  8:54 ` [PATCH 01/14] ACPICA: Improve error message for "too many parent prefixes" condition Lv Zheng
  2013-09-12  8:54 ` [PATCH 02/14] ACPICA: acpi_read: On error, do not modify the return value target location Lv Zheng
@ 2013-09-12  8:54 ` Lv Zheng
  2013-09-12  8:54 ` [PATCH 04/14] ACPICA: Linux-specific header: enable "aarch64" 64-bit build Lv Zheng
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:54 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Allow for longer filenames in the module name output during
trace operations.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/utdebug.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index 5796e11..ffd0db5 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -190,7 +190,7 @@ acpi_debug_print(u32 requested_debug_level,
 	 * Display the module name, current line number, thread ID (if requested),
 	 * current procedure nesting level, and the current procedure name
 	 */
-	acpi_os_printf("%8s-%04ld ", module_name, line_number);
+	acpi_os_printf("%9s-%04ld ", module_name, line_number);
 
 	if (ACPI_LV_THREADS & acpi_dbg_level) {
 		acpi_os_printf("[%u] ", (u32)thread_id);
-- 
1.7.10


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

* [PATCH 04/14] ACPICA: Linux-specific header: enable "aarch64" 64-bit build.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (2 preceding siblings ...)
  2013-09-12  8:54 ` [PATCH 03/14] ACPICA: Debug output: small formatting update, no functional change Lv Zheng
@ 2013-09-12  8:54 ` Lv Zheng
  2013-09-12  8:54 ` [PATCH 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow Lv Zheng
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:54 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown
  Cc: Lv Zheng, linux-acpi, Naresh Bhat

From: Naresh Bhat <naresh.bhat@linaro.org>

Add support for the __aarch64__ define for 64-bit builds.

Signed-off-by: Naresh Bhat <naresh.bhat@linaro.org>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 include/acpi/platform/aclinux.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 68534ef..fda0f3e 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -87,7 +87,7 @@
 #define ACPI_FLUSH_CPU_CACHE()
 #define ACPI_CAST_PTHREAD_T(pthread) ((acpi_thread_id) (pthread))
 
-#if defined(__ia64__) || defined(__x86_64__)
+#if defined(__ia64__) || defined(__x86_64__) || defined(__aarch64__)
 #define ACPI_MACHINE_WIDTH          64
 #define COMPILER_DEPENDENT_INT64    long
 #define COMPILER_DEPENDENT_UINT64   unsigned long
-- 
1.7.10


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

* [PATCH 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (3 preceding siblings ...)
  2013-09-12  8:54 ` [PATCH 04/14] ACPICA: Linux-specific header: enable "aarch64" 64-bit build Lv Zheng
@ 2013-09-12  8:54 ` Lv Zheng
  2013-09-17  0:42   ` Len Brown
  2013-09-12  8:55 ` [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace Lv Zheng
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:54 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Increase the size of a couple of the debugger line buffers.
ACPICA BZ 1037.

Buglink: http://bugs.acpica.org/show_bug.cgi?id=1037
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/acglobal.h |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 90e846f..c9ad2e1 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -445,13 +445,6 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
 ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
 ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
 ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support;
-
-ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
-ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
-ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
-ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
-ACPI_EXTERN char acpi_gbl_db_scope_buf[80];
-ACPI_EXTERN char acpi_gbl_db_debug_filename[80];
 ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
 ACPI_EXTERN char *acpi_gbl_db_buffer;
 ACPI_EXTERN char *acpi_gbl_db_filename;
@@ -459,6 +452,16 @@ ACPI_EXTERN u32 acpi_gbl_db_debug_level;
 ACPI_EXTERN u32 acpi_gbl_db_console_debug_level;
 ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node;
 
+ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
+ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
+
+/* These buffers should all be the same size */
+
+ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_EXTERN char acpi_gbl_db_scope_buf[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_EXTERN char acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE];
+
 /*
  * Statistic globals
  */
-- 
1.7.10


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

* [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (4 preceding siblings ...)
  2013-09-12  8:54 ` [PATCH 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow Lv Zheng
@ 2013-09-12  8:55 ` Lv Zheng
  2013-09-17  0:44   ` Len Brown
  2013-09-12  8:55 ` [PATCH 07/14] ACPICA: Add support for host-installed SCI handlers Lv Zheng
                   ` (9 subsequent siblings)
  15 siblings, 1 reply; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:55 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Perform a sanity check on the start object to prevent problems
later. ACPICA BZ 1025.

Buglink: http://bugs.acpica.org/show_bug.cgi?id=1025
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/nsxfeval.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index b38b4b0..481a6b4 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -605,11 +605,19 @@ acpi_walk_namespace(acpi_object_type type,
 		goto unlock_and_exit;
 	}
 
+	/* Now we can validate the starting node */
+
+	if (!acpi_ns_validate_handle(start_object)) {
+		status = AE_BAD_PARAMETER;
+		goto unlock_and_exit2;
+	}
+
 	status = acpi_ns_walk_namespace(type, start_object, max_depth,
 					ACPI_NS_WALK_UNLOCK,
 					descending_callback, ascending_callback,
 					context, return_value);
 
+      unlock_and_exit2:
 	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 
       unlock_and_exit:
-- 
1.7.10


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

* [PATCH 07/14] ACPICA: Add support for host-installed SCI handlers.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (5 preceding siblings ...)
  2013-09-12  8:55 ` [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace Lv Zheng
@ 2013-09-12  8:55 ` Lv Zheng
  2013-09-17  0:48   ` Len Brown
  2013-09-12  8:55 ` [PATCH 08/14] ACPICA: Operation region support: Never free the handler "context" pointer Lv Zheng
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:55 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

This change adds support to allow hosts to install System Control
Interrupt handlers. Certain ACPI functionality requires the host
to handle raw SCIs. For example, the "SCI Doorbell" that is defined
for memory power state support requires the host device driver to
handle SCIs to examine if the doorbell has been activated. Multiple
SCI handlers can be installed to allow for future expansion.
Debugger support is included.
Lv Zheng, Bob Moore. ACPICA BZ 1032.

Buglink: http://bugs.acpica.org/show_bug.cgi?id=1032
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/acdebug.h   |    3 +-
 drivers/acpi/acpica/acevents.h  |    6 +-
 drivers/acpi/acpica/acglobal.h  |    1 +
 drivers/acpi/acpica/aclocal.h   |    8 +++
 drivers/acpi/acpica/evgpeutil.c |    2 +-
 drivers/acpi/acpica/evmisc.c    |   14 ++--
 drivers/acpi/acpica/evsci.c     |   80 ++++++++++++++++++++--
 drivers/acpi/acpica/evxface.c   |  139 +++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/utglobal.c  |    3 +-
 include/acpi/acpixf.h           |   13 +++-
 include/acpi/actypes.h          |    3 +
 11 files changed, 249 insertions(+), 23 deletions(-)

diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index 9feba08..30c2d69 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -113,11 +113,12 @@ void acpi_db_display_handlers(void);
 ACPI_HW_DEPENDENT_RETURN_VOID(void
 			      acpi_db_generate_gpe(char *gpe_arg,
 						   char *block_arg))
+ ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_generate_sci(void))
 
 /*
  * dbconvert - miscellaneous conversion routines
  */
- acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value);
+acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value);
 
 acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object);
 
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index ab0e977..3ae5fd0 100644
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@ -242,11 +242,11 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
  */
 u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context);
 
-u32 acpi_ev_install_sci_handler(void);
+u32 acpi_ev_sci_dispatch(void);
 
-acpi_status acpi_ev_remove_sci_handler(void);
+u32 acpi_ev_install_sci_handler(void);
 
-u32 acpi_ev_initialize_SCI(u32 program_SCI);
+acpi_status acpi_ev_remove_all_sci_handlers(void);
 
 ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void))
 #endif				/* __ACEVENTS_H__  */
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index c9ad2e1..0fba431 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -269,6 +269,7 @@ ACPI_EXTERN acpi_table_handler acpi_gbl_table_handler;
 ACPI_EXTERN void *acpi_gbl_table_handler_context;
 ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
 ACPI_EXTERN acpi_interface_handler acpi_gbl_interface_handler;
+ACPI_EXTERN struct acpi_sci_handler_info *acpi_gbl_sci_handler_list;
 
 /* Owner ID support */
 
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 0ed0066..be9e30e 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -398,6 +398,14 @@ struct acpi_simple_repair_info {
  *
  ****************************************************************************/
 
+/* Dispatch info for each host-installed SCI handler */
+
+struct acpi_sci_handler_info {
+	struct acpi_sci_handler_info *next;
+	acpi_sci_handler address;	/* Address of handler */
+	void *context;		/* Context to be passed to handler */
+};
+
 /* Dispatch info for each GPE -- either a method or handler, cannot be both */
 
 struct acpi_gpe_handler_info {
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c
index b24dbb8..d523390 100644
--- a/drivers/acpi/acpica/evgpeutil.c
+++ b/drivers/acpi/acpica/evgpeutil.c
@@ -196,7 +196,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  *
  * FUNCTION:    acpi_ev_get_gpe_xrupt_block
  *
- * PARAMETERS:  interrupt_number     - Interrupt for a GPE block
+ * PARAMETERS:  interrupt_number            - Interrupt for a GPE block
  *
  * RETURN:      A GPE interrupt block
  *
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c
index 1b111ef..a568754 100644
--- a/drivers/acpi/acpica/evmisc.c
+++ b/drivers/acpi/acpica/evmisc.c
@@ -264,13 +264,6 @@ void acpi_ev_terminate(void)
 
 		status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);
 
-		/* Remove SCI handler */
-
-		status = acpi_ev_remove_sci_handler();
-		if (ACPI_FAILURE(status)) {
-			ACPI_ERROR((AE_INFO, "Could not remove SCI handler"));
-		}
-
 		status = acpi_ev_remove_global_lock_handler();
 		if (ACPI_FAILURE(status)) {
 			ACPI_ERROR((AE_INFO,
@@ -280,6 +273,13 @@ void acpi_ev_terminate(void)
 		acpi_gbl_events_initialized = FALSE;
 	}
 
+	/* Remove SCI handlers */
+
+	status = acpi_ev_remove_all_sci_handlers();
+	if (ACPI_FAILURE(status)) {
+		ACPI_ERROR((AE_INFO, "Could not remove SCI handler"));
+	}
+
 	/* Deallocate all handler objects installed within GPE info structs */
 
 	status = acpi_ev_walk_gpe_list(acpi_ev_delete_gpe_handlers, NULL);
diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
index b905acf..b2f0fb2 100644
--- a/drivers/acpi/acpica/evsci.c
+++ b/drivers/acpi/acpica/evsci.c
@@ -54,6 +54,52 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context);
 
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_ev_sci_dispatch
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      Status code indicates whether interrupt was handled.
+ *
+ * DESCRIPTION: Dispatch the SCI to all host-installed SCI handlers.
+ *
+ ******************************************************************************/
+
+u32 acpi_ev_sci_dispatch(void)
+{
+	struct acpi_sci_handler_info *sci_handler;
+	acpi_cpu_flags flags;
+	u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
+
+	ACPI_FUNCTION_NAME(ev_sci_dispatch);
+
+	/* Are there any host-installed SCI handlers? */
+
+	if (!acpi_gbl_sci_handler_list) {
+		return (int_status);
+	}
+
+	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
+
+	/* Invoke all host-installed SCI handlers */
+
+	sci_handler = acpi_gbl_sci_handler_list;
+	while (sci_handler) {
+
+		/* Invoke the installed handler (at interrupt level) */
+
+		int_status |= sci_handler->address((u32)acpi_gbl_FADT.
+						   sci_interrupt,
+						   sci_handler->context);
+
+		sci_handler = sci_handler->next;
+	}
+
+	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
+	return (int_status);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_ev_sci_xrupt_handler
  *
  * PARAMETERS:  context   - Calling Context
@@ -89,6 +135,10 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)
 	 */
 	interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
 
+	/* Invoke all host-installed SCI handlers */
+
+	interrupt_handled |= acpi_ev_sci_dispatch();
+
 	return_UINT32(interrupt_handled);
 }
 
@@ -112,14 +162,13 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)
 	ACPI_FUNCTION_TRACE(ev_gpe_xrupt_handler);
 
 	/*
-	 * We are guaranteed by the ACPI CA initialization/shutdown code that
+	 * We are guaranteed by the ACPICA initialization/shutdown code that
 	 * if this interrupt handler is installed, ACPI is enabled.
 	 */
 
 	/* GPEs: Check for and dispatch any GPEs that have occurred */
 
 	interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
-
 	return_UINT32(interrupt_handled);
 }
 
@@ -150,15 +199,15 @@ u32 acpi_ev_install_sci_handler(void)
 
 /******************************************************************************
  *
- * FUNCTION:    acpi_ev_remove_sci_handler
+ * FUNCTION:    acpi_ev_remove_all_sci_handlers
  *
  * PARAMETERS:  none
  *
- * RETURN:      E_OK if handler uninstalled OK, E_ERROR if handler was not
+ * RETURN:      AE_OK if handler uninstalled, AE_ERROR if handler was not
  *              installed to begin with
  *
  * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be
- *              taken.
+ *              taken. Remove all host-installed SCI handlers.
  *
  * Note:  It doesn't seem important to disable all events or set the event
  *        enable registers to their original values. The OS should disable
@@ -167,11 +216,13 @@ u32 acpi_ev_install_sci_handler(void)
  *
  ******************************************************************************/
 
-acpi_status acpi_ev_remove_sci_handler(void)
+acpi_status acpi_ev_remove_all_sci_handlers(void)
 {
+	struct acpi_sci_handler_info *sci_handler;
+	acpi_cpu_flags flags;
 	acpi_status status;
 
-	ACPI_FUNCTION_TRACE(ev_remove_sci_handler);
+	ACPI_FUNCTION_TRACE(ev_remove_all_sci_handlers);
 
 	/* Just let the OS remove the handler and disable the level */
 
@@ -179,6 +230,21 @@ acpi_status acpi_ev_remove_sci_handler(void)
 	    acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt,
 					     acpi_ev_sci_xrupt_handler);
 
+	if (!acpi_gbl_sci_handler_list) {
+		return (status);
+	}
+
+	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
+
+	/* Free all host-installed SCI handlers */
+
+	while (acpi_gbl_sci_handler_list) {
+		sci_handler = acpi_gbl_sci_handler_list;
+		acpi_gbl_sci_handler_list = sci_handler->next;
+		ACPI_FREE(sci_handler);
+	}
+
+	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
 	return_ACPI_STATUS(status);
 }
 
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index ca5fba9..6f56146 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -385,6 +385,144 @@ ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
 #if (!ACPI_REDUCED_HARDWARE)
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_install_sci_handler
+ *
+ * PARAMETERS:  address             - Address of the handler
+ *              context             - Value passed to the handler on each SCI
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Install a handler for a System Control Interrupt.
+ *
+ ******************************************************************************/
+acpi_status acpi_install_sci_handler(acpi_sci_handler address, void *context)
+{
+	struct acpi_sci_handler_info *new_sci_handler;
+	struct acpi_sci_handler_info *sci_handler;
+	acpi_cpu_flags flags;
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE(acpi_install_sci_handler);
+
+	if (!address) {
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
+	}
+
+	/* Allocate and init a handler object */
+
+	new_sci_handler = ACPI_ALLOCATE(sizeof(struct acpi_sci_handler_info));
+	if (!new_sci_handler) {
+		return_ACPI_STATUS(AE_NO_MEMORY);
+	}
+
+	new_sci_handler->address = address;
+	new_sci_handler->context = context;
+
+	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
+	if (ACPI_FAILURE(status)) {
+		goto exit;
+	}
+
+	/* Lock list during installation */
+
+	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
+	sci_handler = acpi_gbl_sci_handler_list;
+
+	/* Ensure handler does not already exist */
+
+	while (sci_handler) {
+		if (address == sci_handler->address) {
+			status = AE_ALREADY_EXISTS;
+			goto unlock_and_exit;
+		}
+
+		sci_handler = sci_handler->next;
+	}
+
+	/* Install the new handler into the global list (at head) */
+
+	new_sci_handler->next = acpi_gbl_sci_handler_list;
+	acpi_gbl_sci_handler_list = new_sci_handler;
+
+      unlock_and_exit:
+
+	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
+	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+
+      exit:
+	if (ACPI_FAILURE(status)) {
+		ACPI_FREE(new_sci_handler);
+	}
+	return_ACPI_STATUS(status);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_remove_sci_handler
+ *
+ * PARAMETERS:  address             - Address of the handler
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Remove a handler for a System Control Interrupt.
+ *
+ ******************************************************************************/
+
+acpi_status acpi_remove_sci_handler(acpi_sci_handler address)
+{
+	struct acpi_sci_handler_info *prev_sci_handler;
+	struct acpi_sci_handler_info *next_sci_handler;
+	acpi_cpu_flags flags;
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE(acpi_remove_sci_handler);
+
+	if (!address) {
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
+	}
+
+	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	/* Remove the SCI handler with lock */
+
+	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
+
+	prev_sci_handler = NULL;
+	next_sci_handler = acpi_gbl_sci_handler_list;
+	while (next_sci_handler) {
+		if (next_sci_handler->address == address) {
+
+			/* Unlink and free the SCI handler info block */
+
+			if (prev_sci_handler) {
+				prev_sci_handler->next = next_sci_handler->next;
+			} else {
+				acpi_gbl_sci_handler_list =
+				    next_sci_handler->next;
+			}
+
+			acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
+			ACPI_FREE(next_sci_handler);
+			goto unlock_and_exit;
+		}
+
+		prev_sci_handler = next_sci_handler;
+		next_sci_handler = next_sci_handler->next;
+	}
+
+	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
+	status = AE_NOT_EXIST;
+
+      unlock_and_exit:
+	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+	return_ACPI_STATUS(status);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_install_global_event_handler
  *
  * PARAMETERS:  handler         - Pointer to the global event handler function
@@ -398,6 +536,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
  *              Can be used to update event counters, etc.
  *
  ******************************************************************************/
+
 acpi_status
 acpi_install_global_event_handler(acpi_gbl_event_handler handler, void *context)
 {
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index d6f26bf..046d5b0 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -291,7 +291,7 @@ acpi_status acpi_ut_init_globals(void)
 
 #if (!ACPI_REDUCED_HARDWARE)
 
-	/* GPE support */
+	/* GPE/SCI support */
 
 	acpi_gbl_all_gpes_initialized = FALSE;
 	acpi_gbl_gpe_xrupt_list_head = NULL;
@@ -300,6 +300,7 @@ acpi_status acpi_ut_init_globals(void)
 	acpi_current_gpe_count = 0;
 
 	acpi_gbl_global_event_handler = NULL;
+	acpi_gbl_sci_handler_list = NULL;
 
 #endif				/* !ACPI_REDUCED_HARDWARE */
 
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 85bfdbe..55a4d3a 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -280,9 +280,16 @@ acpi_status
 acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
 
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
-				acpi_install_global_event_handler
-				(acpi_gbl_event_handler handler, void *context))
-
+				acpi_install_sci_handler(acpi_sci_handler
+							 address,
+							 void *context))
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
+				 acpi_remove_sci_handler(acpi_sci_handler
+							 address))
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
+				 acpi_install_global_event_handler
+				 (acpi_gbl_event_handler handler,
+				  void *context))
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 				 acpi_install_fixed_event_handler(u32
 								  acpi_event,
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index b748aef..850f750 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -946,6 +946,9 @@ typedef void
  * Various handlers and callback procedures
  */
 typedef
+u32 (*acpi_sci_handler) (u32 interrupt_number, void *context);
+
+typedef
 void (*acpi_gbl_event_handler) (u32 event_type,
 			       acpi_handle device,
 			       u32 event_number, void *context);
-- 
1.7.10


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

* [PATCH 08/14] ACPICA: Operation region support: Never free the handler "context" pointer.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (6 preceding siblings ...)
  2013-09-12  8:55 ` [PATCH 07/14] ACPICA: Add support for host-installed SCI handlers Lv Zheng
@ 2013-09-12  8:55 ` Lv Zheng
  2013-09-12  8:55 ` [PATCH 09/14] ACPICA: Debugger: Add new command to display full namespace pathnames Lv Zheng
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:55 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown
  Cc: Lv Zheng, linux-acpi, David E. Box

From: "David E. Box" <david.e.box@intel.com>

This change removes some dangerous code that attempts to free the
handler context pointer in some (rare) circumstances. The owner of
the handler owns this pointer and the ACPICA code should never
touch it. Although not seen to be an issue in any kernel, it did
show up as a problem under AcpiExec. Also, set the internal storage
field for the context pointer to zero when the region is deactivated,
simply for sanity. David Box.

Signed-off-by: David E. Box <david.e.box@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/evregion.c |   23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index cea14d6..6293d6b 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -217,16 +217,11 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
 		if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) {
 			region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE;
 
-			if (region_obj2->extra.region_context) {
-
-				/* The handler for this region was already installed */
-
-				ACPI_FREE(region_context);
-			} else {
-				/*
-				 * Save the returned context for use in all accesses to
-				 * this particular region
-				 */
+			/*
+			 * Save the returned context for use in all accesses to
+			 * the handler for this particular region
+			 */
+			if (!(region_obj2->extra.region_context)) {
 				region_obj2->extra.region_context =
 				    region_context;
 			}
@@ -402,6 +397,14 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
 						 handler_obj->address_space.
 						 context, region_context);
 
+				/*
+				 * region_context should have been released by the deactivate
+				 * operation. We don't need access to it anymore here.
+				 */
+				if (region_context) {
+					*region_context = NULL;
+				}
+
 				/* Init routine may fail, Just ignore errors */
 
 				if (ACPI_FAILURE(status)) {
-- 
1.7.10


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

* [PATCH 09/14] ACPICA: Debugger: Add new command to display full namespace pathnames.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (7 preceding siblings ...)
  2013-09-12  8:55 ` [PATCH 08/14] ACPICA: Operation region support: Never free the handler "context" pointer Lv Zheng
@ 2013-09-12  8:55 ` Lv Zheng
  2013-09-12  8:55 ` [PATCH 10/14] ACPICA: Tables: Cleanup table checksum verification code Lv Zheng
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:55 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Paths command displays the full pathname and object type for
the entire namespace. Alternative to the Namespace command.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/acdebug.h  |    2 +
 drivers/acpi/acpica/acnamesp.h |    6 ++
 drivers/acpi/acpica/nsdump.c   |  134 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 142 insertions(+)

diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index 30c2d69..27c36a5 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -155,6 +155,8 @@ void acpi_db_set_scope(char *name);
 
 void acpi_db_dump_namespace(char *start_arg, char *depth_arg);
 
+void acpi_db_dump_namespace_paths(void);
+
 void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg);
 
 acpi_status acpi_db_find_name_in_namespace(char *name_arg);
diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h
index 40b04bd..e6138ac 100644
--- a/drivers/acpi/acpica/acnamesp.h
+++ b/drivers/acpi/acpica/acnamesp.h
@@ -213,6 +213,12 @@ acpi_ns_dump_objects(acpi_object_type type,
 		     u8 display_type,
 		     u32 max_depth,
 		     acpi_owner_id owner_id, acpi_handle start_handle);
+
+void
+acpi_ns_dump_object_paths(acpi_object_type type,
+			  u8 display_type,
+			  u32 max_depth,
+			  acpi_owner_id owner_id, acpi_handle start_handle);
 #endif				/* ACPI_FUTURE_USAGE */
 
 /*
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 7418c77..8063385 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -59,6 +59,17 @@ acpi_ns_dump_one_device(acpi_handle obj_handle,
 #endif
 
 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
+
+#ifdef	ACPI_FUTURE_USAGE
+static acpi_status
+acpi_ns_dump_one_object_path(acpi_handle obj_handle,
+			     u32 level, void *context, void **return_value);
+
+static acpi_status
+acpi_ns_get_max_depth(acpi_handle obj_handle,
+		      u32 level, void *context, void **return_value);
+#endif				/* ACPI_FUTURE_USAGE */
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ns_print_pathname
@@ -671,6 +682,129 @@ acpi_ns_dump_objects(acpi_object_type type,
 }
 #endif				/* ACPI_FUTURE_USAGE */
 
+#ifdef	ACPI_FUTURE_USAGE
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ns_dump_one_object_path, acpi_ns_get_max_depth
+ *
+ * PARAMETERS:  obj_handle          - Node to be dumped
+ *              level               - Nesting level of the handle
+ *              context             - Passed into walk_namespace
+ *              return_value        - Not used
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Dump the full pathname to a namespace object. acp_ns_get_max_depth
+ *              computes the maximum nesting depth in the namespace tree, in
+ *              order to simplify formatting in acpi_ns_dump_one_object_path.
+ *              These procedures are user_functions called by acpi_ns_walk_namespace.
+ *
+ ******************************************************************************/
+
+static acpi_status
+acpi_ns_dump_one_object_path(acpi_handle obj_handle,
+			     u32 level, void *context, void **return_value)
+{
+	u32 max_level = *((u32 *)context);
+	char *pathname;
+	struct acpi_namespace_node *node;
+	int path_indent;
+
+	if (!obj_handle) {
+		return (AE_OK);
+	}
+
+	node = acpi_ns_validate_handle(obj_handle);
+	pathname = acpi_ns_get_external_pathname(node);
+
+	path_indent = 1;
+	if (level <= max_level) {
+		path_indent = max_level - level + 1;
+	}
+
+	acpi_os_printf("%2d%*s%-12s%*s",
+		       level, level, " ", acpi_ut_get_type_name(node->type),
+		       path_indent, " ");
+
+	acpi_os_printf("%s\n", &pathname[1]);
+	ACPI_FREE(pathname);
+	return (AE_OK);
+}
+
+static acpi_status
+acpi_ns_get_max_depth(acpi_handle obj_handle,
+		      u32 level, void *context, void **return_value)
+{
+	u32 *max_level = (u32 *)context;
+
+	if (level > *max_level) {
+		*max_level = level;
+	}
+	return (AE_OK);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ns_dump_object_paths
+ *
+ * PARAMETERS:  type                - Object type to be dumped
+ *              display_type        - 0 or ACPI_DISPLAY_SUMMARY
+ *              max_depth           - Maximum depth of dump. Use ACPI_UINT32_MAX
+ *                                    for an effectively unlimited depth.
+ *              owner_id            - Dump only objects owned by this ID. Use
+ *                                    ACPI_UINT32_MAX to match all owners.
+ *              start_handle        - Where in namespace to start/end search
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Dump full object pathnames within the loaded namespace. Uses
+ *              acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object_path.
+ *
+ ******************************************************************************/
+
+void
+acpi_ns_dump_object_paths(acpi_object_type type,
+			  u8 display_type,
+			  u32 max_depth,
+			  acpi_owner_id owner_id, acpi_handle start_handle)
+{
+	acpi_status status;
+	u32 max_level = 0;
+
+	ACPI_FUNCTION_ENTRY();
+
+	/*
+	 * Just lock the entire namespace for the duration of the dump.
+	 * We don't want any changes to the namespace during this time,
+	 * especially the temporary nodes since we are going to display
+	 * them also.
+	 */
+	status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+	if (ACPI_FAILURE(status)) {
+		acpi_os_printf("Could not acquire namespace mutex\n");
+		return;
+	}
+
+	/* Get the max depth of the namespace tree, for formatting later */
+
+	(void)acpi_ns_walk_namespace(type, start_handle, max_depth,
+				     ACPI_NS_WALK_NO_UNLOCK |
+				     ACPI_NS_WALK_TEMP_NODES,
+				     acpi_ns_get_max_depth, NULL,
+				     (void *)&max_level, NULL);
+
+	/* Now dump the entire namespace */
+
+	(void)acpi_ns_walk_namespace(type, start_handle, max_depth,
+				     ACPI_NS_WALK_NO_UNLOCK |
+				     ACPI_NS_WALK_TEMP_NODES,
+				     acpi_ns_dump_one_object_path, NULL,
+				     (void *)&max_level, NULL);
+
+	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
+}
+#endif				/* ACPI_FUTURE_USAGE */
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ns_dump_entry
-- 
1.7.10


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

* [PATCH 10/14] ACPICA: Tables: Cleanup table checksum verification code.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (8 preceding siblings ...)
  2013-09-12  8:55 ` [PATCH 09/14] ACPICA: Debugger: Add new command to display full namespace pathnames Lv Zheng
@ 2013-09-12  8:55 ` Lv Zheng
  2013-09-12  8:55 ` [PATCH 11/14] ACPICA: Tables: Cleanup RSDP signature codes Lv Zheng
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:55 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

This patch reduces code redundancy by moving the FACS/S3PT checksum
verification skip logic into acpi_tb_verify_checksum() and other
calls of this function also get benefit from this change.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/tbinstal.c |   12 +++---------
 drivers/acpi/acpica/tbprint.c  |   10 ++++++++++
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index 42a13c0..9e6788f 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -80,16 +80,10 @@ acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc)
 		}
 	}
 
-	/* FACS is the odd table, has no standard ACPI header and no checksum */
+	/* Always calculate checksum, ignore bad checksum if requested */
 
-	if (!ACPI_COMPARE_NAME(&table_desc->signature, ACPI_SIG_FACS)) {
-
-		/* Always calculate checksum, ignore bad checksum if requested */
-
-		status =
-		    acpi_tb_verify_checksum(table_desc->pointer,
-					    table_desc->length);
-	}
+	status =
+	    acpi_tb_verify_checksum(table_desc->pointer, table_desc->length);
 
 	return_ACPI_STATUS(status);
 }
diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
index dc963f8..499759a 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -190,6 +190,16 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length)
 {
 	u8 checksum;
 
+	/*
+	 * FACS/S3PT:
+	 * They are the odd tables, have no standard ACPI header and no checksum
+	 */
+
+	if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_S3PT) ||
+	    ACPI_COMPARE_NAME(table->signature, ACPI_SIG_FACS)) {
+		return (AE_OK);
+	}
+
 	/* Compute the checksum on the table */
 
 	checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, table), length);
-- 
1.7.10


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

* [PATCH 11/14] ACPICA: Tables: Cleanup RSDP signature codes.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (9 preceding siblings ...)
  2013-09-12  8:55 ` [PATCH 10/14] ACPICA: Tables: Cleanup table checksum verification code Lv Zheng
@ 2013-09-12  8:55 ` Lv Zheng
  2013-09-17  0:51   ` Len Brown
  2013-09-12  8:55 ` [PATCH 12/14] ACPICA: Cleanup exception codes Lv Zheng
                   ` (4 subsequent siblings)
  15 siblings, 1 reply; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:55 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

This patch introduces new macors to handle RSDP signature and cleans up the
affected codes.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/tbprint.c  |    2 +-
 drivers/acpi/acpica/tbxfroot.c |    3 +--
 include/acpi/actypes.h         |    5 +++++
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
index 499759a..9a47715 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -138,7 +138,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
 		ACPI_INFO((AE_INFO, "%4.4s %p %05X",
 			   header->signature, ACPI_CAST_PTR(void, address),
 			   header->length));
-	} else if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_RSDP)) {
+	} else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) {
 
 		/* RSDP has no common fields */
 
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index 948c95e..1c95fab 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -68,8 +68,7 @@ acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
 	 * Note: Sometimes there exists more than one RSDP in memory; the valid
 	 * RSDP has a valid checksum, all others have an invalid checksum.
 	 */
-	if (ACPI_STRNCMP((char *)rsdp->signature, ACPI_SIG_RSDP,
-			 sizeof(ACPI_SIG_RSDP) - 1) != 0) {
+	if (!ACPI_VALIDATE_RSDP_SIG(rsdp->signature)) {
 
 		/* Nope, BAD Signature */
 
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 850f750..5400672 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -474,6 +474,11 @@ typedef u64 acpi_integer;
 #define ACPI_MOVE_NAME(dest,src)        (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))
 #endif
 
+/* Support for the special RSDP signature (8 characters) */
+
+#define ACPI_VALIDATE_RSDP_SIG(a)       (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
+#define ACPI_MAKE_RSDP_SIG(dest)        (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
+
 /*******************************************************************************
  *
  * Miscellaneous constants
-- 
1.7.10


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

* [PATCH 12/14] ACPICA: Cleanup exception codes.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (10 preceding siblings ...)
  2013-09-12  8:55 ` [PATCH 11/14] ACPICA: Tables: Cleanup RSDP signature codes Lv Zheng
@ 2013-09-12  8:55 ` Lv Zheng
  2013-09-12  8:55 ` [PATCH 13/14] ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument Lv Zheng
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:55 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

This patch adds AE_ACCESS for EACCES or EPERM.  Some error prompts are
also cleaned up in this patch.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 include/acpi/acexcep.h |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index cf051e0..4e280bd 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -125,8 +125,9 @@ struct acpi_exception_info {
 #define AE_NO_HANDLER                   EXCEP_ENV (0x001A)
 #define AE_OWNER_ID_LIMIT               EXCEP_ENV (0x001B)
 #define AE_NOT_CONFIGURED               EXCEP_ENV (0x001C)
+#define AE_ACCESS                       EXCEP_ENV (0x001D)
 
-#define AE_CODE_ENV_MAX                 0x001C
+#define AE_CODE_ENV_MAX                 0x001D
 
 /*
  * Programmer exceptions
@@ -227,7 +228,7 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = {
 	EXCEP_TXT("AE_NO_ACPI_TABLES", "ACPI tables could not be found"),
 	EXCEP_TXT("AE_NO_NAMESPACE", "A namespace has not been loaded"),
 	EXCEP_TXT("AE_NO_MEMORY", "Insufficient dynamic memory"),
-	EXCEP_TXT("AE_NOT_FOUND", "The name was not found in the namespace"),
+	EXCEP_TXT("AE_NOT_FOUND", "A requested entity is not found"),
 	EXCEP_TXT("AE_NOT_EXIST", "A required entity does not exist"),
 	EXCEP_TXT("AE_ALREADY_EXISTS", "An entity already exists"),
 	EXCEP_TXT("AE_TYPE", "The object type is incorrect"),
@@ -259,7 +260,8 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = {
 	EXCEP_TXT("AE_OWNER_ID_LIMIT",
 		  "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")
+		  "The interface is not part of the current subsystem configuration"),
+	EXCEP_TXT("AE_ACCESS", "Permission denied for the requested operation")
 };
 
 static const struct acpi_exception_info acpi_gbl_exception_names_pgm[] = {
-- 
1.7.10


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

* [PATCH 13/14] ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (11 preceding siblings ...)
  2013-09-12  8:55 ` [PATCH 12/14] ACPICA: Cleanup exception codes Lv Zheng
@ 2013-09-12  8:55 ` Lv Zheng
  2013-09-12  8:55 ` [PATCH 14/14] ACPICA: Update version to 20130823 Lv Zheng
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:55 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

The SCI interrupt number is not needed for the SCI handlers, and was
just unnecessary overhead.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/evsci.c |    4 +---
 include/acpi/actypes.h      |    2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
index b2f0fb2..94d9ebd 100644
--- a/drivers/acpi/acpica/evsci.c
+++ b/drivers/acpi/acpica/evsci.c
@@ -87,9 +87,7 @@ u32 acpi_ev_sci_dispatch(void)
 
 		/* Invoke the installed handler (at interrupt level) */
 
-		int_status |= sci_handler->address((u32)acpi_gbl_FADT.
-						   sci_interrupt,
-						   sci_handler->context);
+		int_status |= sci_handler->address(sci_handler->context);
 
 		sci_handler = sci_handler->next;
 	}
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 5400672..f6abf23 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -951,7 +951,7 @@ typedef void
  * Various handlers and callback procedures
  */
 typedef
-u32 (*acpi_sci_handler) (u32 interrupt_number, void *context);
+u32 (*acpi_sci_handler) (void *context);
 
 typedef
 void (*acpi_gbl_event_handler) (u32 event_type,
-- 
1.7.10


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

* [PATCH 14/14] ACPICA: Update version to 20130823.
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (12 preceding siblings ...)
  2013-09-12  8:55 ` [PATCH 13/14] ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument Lv Zheng
@ 2013-09-12  8:55 ` Lv Zheng
  2013-09-17  0:54 ` [PATCH 00/14] ACPICA 20130823 Release Len Brown
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-12  8:55 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Version 20130823.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@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 55a4d3a..c7b1475 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20130725
+#define ACPI_CA_VERSION                 0x20130823
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
-- 
1.7.10


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

* Re: [PATCH 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow.
  2013-09-12  8:54 ` [PATCH 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow Lv Zheng
@ 2013-09-17  0:42   ` Len Brown
  2013-09-17  1:15     ` Zheng, Lv
  0 siblings, 1 reply; 49+ messages in thread
From: Len Brown @ 2013-09-17  0:42 UTC (permalink / raw
  To: Lv Zheng; +Cc: Rafael J. Wysocki, Robert Moore, Len Brown, linux acpi

On Thu, Sep 12, 2013 at 4:54 AM, Lv Zheng <lv.zheng@intel.com> wrote:
> From: Bob Moore <robert.moore@intel.com>
>
> Increase the size of a couple of the debugger line buffers.
> ACPICA BZ 1037.
>
> Buglink: http://bugs.acpica.org/show_bug.cgi?id=1037
> Signed-off-by: Bob Moore <robert.moore@intel.com>
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> ---
>  drivers/acpi/acpica/acglobal.h |   17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
> index 90e846f..c9ad2e1 100644
> --- a/drivers/acpi/acpica/acglobal.h
> +++ b/drivers/acpi/acpica/acglobal.h
> @@ -445,13 +445,6 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
>  ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
>  ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
>  ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support;
> -
> -ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
> -ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
> -ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
> -ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
> -ACPI_EXTERN char acpi_gbl_db_scope_buf[80];
> -ACPI_EXTERN char acpi_gbl_db_debug_filename[80];

If I read the code correctly, these are all inside #ifdefs that are
not defined in kernel mode,
and so the kernel will not be impacted by this buffer growth from 80 to 512,
and this patch is just to keep shared w/ acpiexec the same, yes?

thanks,
Len Brown, Intel Open Source Technology Center

>  ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
>  ACPI_EXTERN char *acpi_gbl_db_buffer;
>  ACPI_EXTERN char *acpi_gbl_db_filename;
> @@ -459,6 +452,16 @@ ACPI_EXTERN u32 acpi_gbl_db_debug_level;
>  ACPI_EXTERN u32 acpi_gbl_db_console_debug_level;
>  ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node;
>
> +ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
> +ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
> +
> +/* These buffers should all be the same size */
> +
> +ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
> +ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
> +ACPI_EXTERN char acpi_gbl_db_scope_buf[ACPI_DB_LINE_BUFFER_SIZE];
> +ACPI_EXTERN char acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE];
> +
>  /*
>   * Statistic globals
>   */
> --
> 1.7.10

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

* Re: [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace.
  2013-09-12  8:55 ` [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace Lv Zheng
@ 2013-09-17  0:44   ` Len Brown
  2013-09-17  1:25     ` Zheng, Lv
  0 siblings, 1 reply; 49+ messages in thread
From: Len Brown @ 2013-09-17  0:44 UTC (permalink / raw
  To: Lv Zheng; +Cc: Rafael J. Wysocki, Robert Moore, Len Brown, linux acpi

This was filed an fixed very quickly.
Is it something we see in the field?
The patch is small, should we mark it for -stable?

thanks

On Thu, Sep 12, 2013 at 4:55 AM, Lv Zheng <lv.zheng@intel.com> wrote:
> From: Bob Moore <robert.moore@intel.com>
>
> Perform a sanity check on the start object to prevent problems
> later. ACPICA BZ 1025.
>
> Buglink: http://bugs.acpica.org/show_bug.cgi?id=1025
> Signed-off-by: Bob Moore <robert.moore@intel.com>
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> ---
>  drivers/acpi/acpica/nsxfeval.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
> index b38b4b0..481a6b4 100644
> --- a/drivers/acpi/acpica/nsxfeval.c
> +++ b/drivers/acpi/acpica/nsxfeval.c
> @@ -605,11 +605,19 @@ acpi_walk_namespace(acpi_object_type type,
>                 goto unlock_and_exit;
>         }
>
> +       /* Now we can validate the starting node */
> +
> +       if (!acpi_ns_validate_handle(start_object)) {
> +               status = AE_BAD_PARAMETER;
> +               goto unlock_and_exit2;
> +       }
> +
>         status = acpi_ns_walk_namespace(type, start_object, max_depth,
>                                         ACPI_NS_WALK_UNLOCK,
>                                         descending_callback, ascending_callback,
>                                         context, return_value);
>
> +      unlock_and_exit2:
>         (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
>
>        unlock_and_exit:
> --
> 1.7.10
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Len Brown, Intel Open Source Technology Center

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

* Re: [PATCH 07/14] ACPICA: Add support for host-installed SCI handlers.
  2013-09-12  8:55 ` [PATCH 07/14] ACPICA: Add support for host-installed SCI handlers Lv Zheng
@ 2013-09-17  0:48   ` Len Brown
  2013-09-17  1:07     ` Zheng, Lv
  2013-09-17 17:47     ` Moore, Robert
  0 siblings, 2 replies; 49+ messages in thread
From: Len Brown @ 2013-09-17  0:48 UTC (permalink / raw
  To: Lv Zheng; +Cc: Rafael J. Wysocki, Robert Moore, Len Brown, linux acpi

On Thu, Sep 12, 2013 at 4:55 AM, Lv Zheng <lv.zheng@intel.com> wrote:
> This change adds support to allow hosts to install System Control
> Interrupt handlers. Certain ACPI functionality requires the host
> to handle raw SCIs. For example, the "SCI Doorbell" that is defined
> for memory power state support requires the host device driver to
> handle SCIs to examine if the doorbell has been activated. Multiple
> SCI handlers can be installed to allow for future expansion.
> Debugger support is included.
> Lv Zheng, Bob Moore. ACPICA BZ 1032.
>
> Buglink: http://bugs.acpica.org/show_bug.cgi?id=1032
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> Signed-off-by: Bob Moore <robert.moore@intel.com>


The bug report references PCC -- is that _PCC events, or Processor
Clocking Control?
We think we support both of those before this patch -- so how can PCC
require this change?

thanks,
-Len

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

* Re: [PATCH 11/14] ACPICA: Tables: Cleanup RSDP signature codes.
  2013-09-12  8:55 ` [PATCH 11/14] ACPICA: Tables: Cleanup RSDP signature codes Lv Zheng
@ 2013-09-17  0:51   ` Len Brown
  2013-09-17  1:11     ` Zheng, Lv
  0 siblings, 1 reply; 49+ messages in thread
From: Len Brown @ 2013-09-17  0:51 UTC (permalink / raw
  To: Lv Zheng; +Cc: Rafael J. Wysocki, Robert Moore, Len Brown, linux acpi

On Thu, Sep 12, 2013 at 4:55 AM, Lv Zheng <lv.zheng@intel.com> wrote:
> This patch introduces new macors to handle RSDP signature and cleans up the
> affected codes.  Lv Zheng.
>
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> Signed-off-by: Bob Moore <robert.moore@intel.com>
> ---
>  drivers/acpi/acpica/tbprint.c  |    2 +-
>  drivers/acpi/acpica/tbxfroot.c |    3 +--
>  include/acpi/actypes.h         |    5 +++++
>  3 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
> index 499759a..9a47715 100644
> --- a/drivers/acpi/acpica/tbprint.c
> +++ b/drivers/acpi/acpica/tbprint.c
> @@ -138,7 +138,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
>                 ACPI_INFO((AE_INFO, "%4.4s %p %05X",
>                            header->signature, ACPI_CAST_PTR(void, address),
>                            header->length));
> -       } else if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_RSDP)) {
> +       } else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) {
>
>                 /* RSDP has no common fields */
>
> diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
> index 948c95e..1c95fab 100644
> --- a/drivers/acpi/acpica/tbxfroot.c
> +++ b/drivers/acpi/acpica/tbxfroot.c
> @@ -68,8 +68,7 @@ acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
>          * Note: Sometimes there exists more than one RSDP in memory; the valid
>          * RSDP has a valid checksum, all others have an invalid checksum.
>          */
> -       if (ACPI_STRNCMP((char *)rsdp->signature, ACPI_SIG_RSDP,
> -                        sizeof(ACPI_SIG_RSDP) - 1) != 0) {
> +       if (!ACPI_VALIDATE_RSDP_SIG(rsdp->signature)) {
>
>                 /* Nope, BAD Signature */
>
> diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
> index 850f750..5400672 100644
> --- a/include/acpi/actypes.h
> +++ b/include/acpi/actypes.h
> @@ -474,6 +474,11 @@ typedef u64 acpi_integer;
>  #define ACPI_MOVE_NAME(dest,src)        (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))
>  #endif
>
> +/* Support for the special RSDP signature (8 characters) */
> +
> +#define ACPI_VALIDATE_RSDP_SIG(a)       (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
> +#define ACPI_MAKE_RSDP_SIG(dest)        (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))

is ACPI_MAKE_RSDP_SIGI(), defined, but not used?
If so, don't define it.

Len Brown, Intel Open Source Technology Center

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

* Re: [PATCH 00/14] ACPICA 20130823 Release
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (13 preceding siblings ...)
  2013-09-12  8:55 ` [PATCH 14/14] ACPICA: Update version to 20130823 Lv Zheng
@ 2013-09-17  0:54 ` Len Brown
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
  15 siblings, 0 replies; 49+ messages in thread
From: Len Brown @ 2013-09-17  0:54 UTC (permalink / raw
  To: Lv Zheng; +Cc: Rafael J. Wysocki, Robert Moore, Len Brown, linux acpi

this series is...
Reviewed-by: Len Brown <len.brown@intel.com>

with satisfactory reply to the individual questions asked.

thanks,
Len Brown, Intel Open Source Technology Center

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

* RE: [PATCH 07/14] ACPICA: Add support for host-installed SCI handlers.
  2013-09-17  0:48   ` Len Brown
@ 2013-09-17  1:07     ` Zheng, Lv
  2013-09-17 17:47     ` Moore, Robert
  1 sibling, 0 replies; 49+ messages in thread
From: Zheng, Lv @ 2013-09-17  1:07 UTC (permalink / raw
  To: Len Brown; +Cc: Wysocki, Rafael J, Moore, Robert, Brown, Len, linux acpi

> From: lenb417@gmail.com [mailto:lenb417@gmail.com] On Behalf Of Len Brown
> Sent: Tuesday, September 17, 2013 8:48 AM
> To: Zheng, Lv
> Cc: Wysocki, Rafael J; Moore, Robert; Brown, Len; linux acpi
> Subject: Re: [PATCH 07/14] ACPICA: Add support for host-installed SCI handlers.
> 
> On Thu, Sep 12, 2013 at 4:55 AM, Lv Zheng <lv.zheng@intel.com> wrote:
> > This change adds support to allow hosts to install System Control
> > Interrupt handlers. Certain ACPI functionality requires the host
> > to handle raw SCIs. For example, the "SCI Doorbell" that is defined
> > for memory power state support requires the host device driver to
> > handle SCIs to examine if the doorbell has been activated. Multiple
> > SCI handlers can be installed to allow for future expansion.
> > Debugger support is included.
> > Lv Zheng, Bob Moore. ACPICA BZ 1032.
> >
> > Buglink: http://bugs.acpica.org/show_bug.cgi?id=1032
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > Signed-off-by: Bob Moore <robert.moore@intel.com>
> 
> 
> The bug report references PCC -- is that _PCC events, or Processor
> Clocking Control?
> We think we support both of those before this patch -- so how can PCC
> require this change?

The PCC here refers to Platform Communications Channel (PCC) which is defined in the Chap 14 of the ACPI specification.
It said that "the PCC completion check is not factored into the ACPICA in upstream kernel yet".
So the installable SCI handlers are expected.

Thanks
-Lv

> 
> thanks,
> -Len

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

* RE: [PATCH 11/14] ACPICA: Tables: Cleanup RSDP signature codes.
  2013-09-17  0:51   ` Len Brown
@ 2013-09-17  1:11     ` Zheng, Lv
  0 siblings, 0 replies; 49+ messages in thread
From: Zheng, Lv @ 2013-09-17  1:11 UTC (permalink / raw
  To: Len Brown; +Cc: Wysocki, Rafael J, Moore, Robert, Brown, Len, linux acpi

> From: lenb417@gmail.com [mailto:lenb417@gmail.com] On Behalf Of Len Brown
> Sent: Tuesday, September 17, 2013 8:52 AM
> 
> On Thu, Sep 12, 2013 at 4:55 AM, Lv Zheng <lv.zheng@intel.com> wrote:
> > This patch introduces new macors to handle RSDP signature and cleans up the
> > affected codes.  Lv Zheng.
> >
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > Signed-off-by: Bob Moore <robert.moore@intel.com>
> > ---
> >  drivers/acpi/acpica/tbprint.c  |    2 +-
> >  drivers/acpi/acpica/tbxfroot.c |    3 +--
> >  include/acpi/actypes.h         |    5 +++++
> >  3 files changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
> > index 499759a..9a47715 100644
> > --- a/drivers/acpi/acpica/tbprint.c
> > +++ b/drivers/acpi/acpica/tbprint.c
> > @@ -138,7 +138,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
> >                 ACPI_INFO((AE_INFO, "%4.4s %p %05X",
> >                            header->signature, ACPI_CAST_PTR(void, address),
> >                            header->length));
> > -       } else if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_RSDP)) {
> > +       } else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) {
> >
> >                 /* RSDP has no common fields */
> >
> > diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
> > index 948c95e..1c95fab 100644
> > --- a/drivers/acpi/acpica/tbxfroot.c
> > +++ b/drivers/acpi/acpica/tbxfroot.c
> > @@ -68,8 +68,7 @@ acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
> >          * Note: Sometimes there exists more than one RSDP in memory; the valid
> >          * RSDP has a valid checksum, all others have an invalid checksum.
> >          */
> > -       if (ACPI_STRNCMP((char *)rsdp->signature, ACPI_SIG_RSDP,
> > -                        sizeof(ACPI_SIG_RSDP) - 1) != 0) {
> > +       if (!ACPI_VALIDATE_RSDP_SIG(rsdp->signature)) {
> >
> >                 /* Nope, BAD Signature */
> >
> > diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
> > index 850f750..5400672 100644
> > --- a/include/acpi/actypes.h
> > +++ b/include/acpi/actypes.h
> > @@ -474,6 +474,11 @@ typedef u64 acpi_integer;
> >  #define ACPI_MOVE_NAME(dest,src)        (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)),
> ACPI_NAME_SIZE))
> >  #endif
> >
> > +/* Support for the special RSDP signature (8 characters) */
> > +
> > +#define ACPI_VALIDATE_RSDP_SIG(a)       (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
> > +#define ACPI_MAKE_RSDP_SIG(dest)        (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
> 
> is ACPI_MAKE_RSDP_SIGI(), defined, but not used?
> If so, don't define it.

The macro is used by ACPICA user space utilities like AcpiDump.
We've a plan to update the AcpiDump in the tools/acpi folder.
So it's likely we'll see users of this macro in the kernel tree.

And, if we delete the piece of codes like this, then it will generate new source code differences between Linux and ACPICA, which will hurt the automation of the ACPICA release process.
I'm sorry for that.

Thanks and best regards
-Lv

> 
> Len Brown, Intel Open Source Technology Center

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

* RE: [PATCH 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow.
  2013-09-17  0:42   ` Len Brown
@ 2013-09-17  1:15     ` Zheng, Lv
  2013-09-17 19:31       ` Brown, Len
  0 siblings, 1 reply; 49+ messages in thread
From: Zheng, Lv @ 2013-09-17  1:15 UTC (permalink / raw
  To: Len Brown; +Cc: Wysocki, Rafael J, Moore, Robert, Brown, Len, linux acpi

> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Len Brown
> Sent: Tuesday, September 17, 2013 8:43 AM
> 
> On Thu, Sep 12, 2013 at 4:54 AM, Lv Zheng <lv.zheng@intel.com> wrote:
> > From: Bob Moore <robert.moore@intel.com>
> >
> > Increase the size of a couple of the debugger line buffers.
> > ACPICA BZ 1037.
> >
> > Buglink: http://bugs.acpica.org/show_bug.cgi?id=1037
> > Signed-off-by: Bob Moore <robert.moore@intel.com>
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > ---
> >  drivers/acpi/acpica/acglobal.h |   17 ++++++++++-------
> >  1 file changed, 10 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
> > index 90e846f..c9ad2e1 100644
> > --- a/drivers/acpi/acpica/acglobal.h
> > +++ b/drivers/acpi/acpica/acglobal.h
> > @@ -445,13 +445,6 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
> >  ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
> >  ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
> >  ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support;
> > -
> > -ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
> > -ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
> > -ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
> > -ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
> > -ACPI_EXTERN char acpi_gbl_db_scope_buf[80];
> > -ACPI_EXTERN char acpi_gbl_db_debug_filename[80];
> 
> If I read the code correctly, these are all inside #ifdefs that are
> not defined in kernel mode,
> and so the kernel will not be impacted by this buffer growth from 80 to 512,
> and this patch is just to keep shared w/ acpiexec the same, yes?

Yes, the codes belongs to the AML debugger which is defined by ACPI specification, implemented in the ACPICA but not shipped in the Linux kernel.
We've a plan to port the debugger/disassmebler to the kernel.
So it's likely we'll see users of such globals in the kernel tree.
Currently, kernel behaviors are not affected by this patch.

And, if we delete the piece of codes like this, then it will generate new source code differences between Linux and ACPICA, which will hurt the automation of the ACPICA release process.
I'm sorry for that.

Thanks and best regards
-Lv
> 
> thanks,
> Len Brown, Intel Open Source Technology Center
> 
> >  ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
> >  ACPI_EXTERN char *acpi_gbl_db_buffer;
> >  ACPI_EXTERN char *acpi_gbl_db_filename;
> > @@ -459,6 +452,16 @@ ACPI_EXTERN u32 acpi_gbl_db_debug_level;
> >  ACPI_EXTERN u32 acpi_gbl_db_console_debug_level;
> >  ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node;
> >
> > +ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
> > +ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
> > +
> > +/* These buffers should all be the same size */
> > +
> > +ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
> > +ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
> > +ACPI_EXTERN char acpi_gbl_db_scope_buf[ACPI_DB_LINE_BUFFER_SIZE];
> > +ACPI_EXTERN char acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE];
> > +
> >  /*
> >   * Statistic globals
> >   */
> > --
> > 1.7.10
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace.
  2013-09-17  0:44   ` Len Brown
@ 2013-09-17  1:25     ` Zheng, Lv
  2013-09-17  2:56       ` Moore, Robert
  0 siblings, 1 reply; 49+ messages in thread
From: Zheng, Lv @ 2013-09-17  1:25 UTC (permalink / raw
  To: Len Brown; +Cc: Wysocki, Rafael J, Moore, Robert, Brown, Len, linux acpi

Hi, Bob

Could you help to answer this?
Thanks in advance.

Best regards
-Lv

> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Len Brown
> Sent: Tuesday, September 17, 2013 8:44 AM
> 
> This was filed an fixed very quickly.
> Is it something we see in the field?
> The patch is small, should we mark it for -stable?
> 
> thanks
> 
> On Thu, Sep 12, 2013 at 4:55 AM, Lv Zheng <lv.zheng@intel.com> wrote:
> > From: Bob Moore <robert.moore@intel.com>
> >
> > Perform a sanity check on the start object to prevent problems
> > later. ACPICA BZ 1025.
> >
> > Buglink: http://bugs.acpica.org/show_bug.cgi?id=1025
> > Signed-off-by: Bob Moore <robert.moore@intel.com>
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > ---
> >  drivers/acpi/acpica/nsxfeval.c |    8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
> > index b38b4b0..481a6b4 100644
> > --- a/drivers/acpi/acpica/nsxfeval.c
> > +++ b/drivers/acpi/acpica/nsxfeval.c
> > @@ -605,11 +605,19 @@ acpi_walk_namespace(acpi_object_type type,
> >                 goto unlock_and_exit;
> >         }
> >
> > +       /* Now we can validate the starting node */
> > +
> > +       if (!acpi_ns_validate_handle(start_object)) {
> > +               status = AE_BAD_PARAMETER;
> > +               goto unlock_and_exit2;
> > +       }
> > +
> >         status = acpi_ns_walk_namespace(type, start_object, max_depth,
> >                                         ACPI_NS_WALK_UNLOCK,
> >                                         descending_callback, ascending_callback,
> >                                         context, return_value);
> >
> > +      unlock_and_exit2:
> >         (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
> >
> >        unlock_and_exit:
> > --
> > 1.7.10
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 
> --
> Len Brown, Intel Open Source Technology Center
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace.
  2013-09-17  1:25     ` Zheng, Lv
@ 2013-09-17  2:56       ` Moore, Robert
  2013-09-17 19:46         ` Brown, Len
  0 siblings, 1 reply; 49+ messages in thread
From: Moore, Robert @ 2013-09-17  2:56 UTC (permalink / raw
  To: Zheng, Lv, Len Brown; +Cc: Wysocki, Rafael J, Brown, Len, linux acpi

Just adds a sanity check. I don't think we see it, otherwise the caller would fault dead in its tracks.


> -----Original Message-----
> From: Zheng, Lv
> Sent: Monday, September 16, 2013 6:26 PM
> To: Len Brown
> Cc: Wysocki, Rafael J; Moore, Robert; Brown, Len; linux acpi
> Subject: RE: [PATCH 06/14] ACPICA: Validate start object for
> acpi_walk_namespace.
> 
> Hi, Bob
> 
> Could you help to answer this?
> Thanks in advance.
> 
> Best regards
> -Lv
> 
> > From: linux-acpi-owner@vger.kernel.org
> > [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Len Brown
> > Sent: Tuesday, September 17, 2013 8:44 AM
> >
> > This was filed an fixed very quickly.
> > Is it something we see in the field?
> > The patch is small, should we mark it for -stable?
> >
> > thanks
> >
> > On Thu, Sep 12, 2013 at 4:55 AM, Lv Zheng <lv.zheng@intel.com> wrote:
> > > From: Bob Moore <robert.moore@intel.com>
> > >
> > > Perform a sanity check on the start object to prevent problems
> > > later. ACPICA BZ 1025.
> > >
> > > Buglink: http://bugs.acpica.org/show_bug.cgi?id=1025
> > > Signed-off-by: Bob Moore <robert.moore@intel.com>
> > > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > > ---
> > >  drivers/acpi/acpica/nsxfeval.c |    8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > >
> > > diff --git a/drivers/acpi/acpica/nsxfeval.c
> > > b/drivers/acpi/acpica/nsxfeval.c index b38b4b0..481a6b4 100644
> > > --- a/drivers/acpi/acpica/nsxfeval.c
> > > +++ b/drivers/acpi/acpica/nsxfeval.c
> > > @@ -605,11 +605,19 @@ acpi_walk_namespace(acpi_object_type type,
> > >                 goto unlock_and_exit;
> > >         }
> > >
> > > +       /* Now we can validate the starting node */
> > > +
> > > +       if (!acpi_ns_validate_handle(start_object)) {
> > > +               status = AE_BAD_PARAMETER;
> > > +               goto unlock_and_exit2;
> > > +       }
> > > +
> > >         status = acpi_ns_walk_namespace(type, start_object, max_depth,
> > >                                         ACPI_NS_WALK_UNLOCK,
> > >                                         descending_callback,
> ascending_callback,
> > >                                         context, return_value);
> > >
> > > +      unlock_and_exit2:
> > >         (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
> > >
> > >        unlock_and_exit:
> > > --
> > > 1.7.10
> > >
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe
> > > linux-acpi" in the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> >
> >
> > --
> > Len Brown, Intel Open Source Technology Center
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-acpi"
> > in the body of a message to majordomo@vger.kernel.org More majordomo
> > info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH 07/14] ACPICA: Add support for host-installed SCI handlers.
  2013-09-17  0:48   ` Len Brown
  2013-09-17  1:07     ` Zheng, Lv
@ 2013-09-17 17:47     ` Moore, Robert
  1 sibling, 0 replies; 49+ messages in thread
From: Moore, Robert @ 2013-09-17 17:47 UTC (permalink / raw
  To: Len Brown, Zheng, Lv; +Cc: Wysocki, Rafael J, Brown, Len, linux acpi

> -----Original Message-----
> From: lenb417@gmail.com [mailto:lenb417@gmail.com] On Behalf Of Len Brown
> Sent: Monday, September 16, 2013 5:48 PM
> To: Zheng, Lv
> Cc: Wysocki, Rafael J; Moore, Robert; Brown, Len; linux acpi
> Subject: Re: [PATCH 07/14] ACPICA: Add support for host-installed SCI
> handlers.
> 
> On Thu, Sep 12, 2013 at 4:55 AM, Lv Zheng <lv.zheng@intel.com> wrote:
> > This change adds support to allow hosts to install System Control
> > Interrupt handlers. Certain ACPI functionality requires the host to
> > handle raw SCIs. For example, the "SCI Doorbell" that is defined for
> > memory power state support requires the host device driver to handle
> > SCIs to examine if the doorbell has been activated. Multiple SCI
> > handlers can be installed to allow for future expansion.
> > Debugger support is included.
> > Lv Zheng, Bob Moore. ACPICA BZ 1032.
> >
> > Buglink: http://bugs.acpica.org/show_bug.cgi?id=1032
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > Signed-off-by: Bob Moore <robert.moore@intel.com>
> 
> 
> The bug report references PCC -- is that _PCC events, or Processor
> Clocking Control?
> We think we support both of those before this patch -- so how can PCC
> require this change?

Platform Communication Channel, via the MPST table (new for ACPI 5.0)

When the PCC subchannel responds to the host, it issues an SCI and the host must probe the subchannel for channel status.





> 
> thanks,
> -Len

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

* RE: [PATCH 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow.
  2013-09-17  1:15     ` Zheng, Lv
@ 2013-09-17 19:31       ` Brown, Len
  2013-09-23  1:36         ` Zheng, Lv
  0 siblings, 1 reply; 49+ messages in thread
From: Brown, Len @ 2013-09-17 19:31 UTC (permalink / raw
  To: Zheng, Lv; +Cc: Wysocki, Rafael J, Moore, Robert, linux acpi

> Currently, kernel behaviors are not affected by this patch.

This is exactly what you want to write in the commit message.

Imagine, for a minute, a distro scanning thousands of
patches and reading the title of this one -- they would
be alarmed by the phrase "buffer overflow" on a kernel patch --
so you need to tell them not to be alarmed.

thanks,
-Len


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

* RE: [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace.
  2013-09-17  2:56       ` Moore, Robert
@ 2013-09-17 19:46         ` Brown, Len
  2013-09-17 19:48           ` Moore, Robert
  2013-09-23  1:37           ` Zheng, Lv
  0 siblings, 2 replies; 49+ messages in thread
From: Brown, Len @ 2013-09-17 19:46 UTC (permalink / raw
  To: Moore, Robert, Zheng, Lv; +Cc: Wysocki, Rafael J, linux acpi

> Just adds a sanity check.

Ideal if commit messages answer the question:

"Is this patch important?"
"If yes, what bad things happen if I don't have it in my kernel?"

Remember, the commit messages have customers.
Nice to have a BZ referenced, but this BZ entry
had no such information, and
"prevent problems later" didn't answer that key question either.

thanks,
-Len


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

* RE: [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace.
  2013-09-17 19:46         ` Brown, Len
@ 2013-09-17 19:48           ` Moore, Robert
  2013-09-23  1:37           ` Zheng, Lv
  1 sibling, 0 replies; 49+ messages in thread
From: Moore, Robert @ 2013-09-17 19:48 UTC (permalink / raw
  To: Brown, Len, Zheng, Lv; +Cc: Wysocki, Rafael J, linux acpi

I would also say something like:

"Adds additional input parameter validation"

> -----Original Message-----
> From: Brown, Len
> Sent: Tuesday, September 17, 2013 12:46 PM
> To: Moore, Robert; Zheng, Lv
> Cc: Wysocki, Rafael J; linux acpi
> Subject: RE: [PATCH 06/14] ACPICA: Validate start object for
> acpi_walk_namespace.
> 
> > Just adds a sanity check.
> 
> Ideal if commit messages answer the question:
> 
> "Is this patch important?"
> "If yes, what bad things happen if I don't have it in my kernel?"
> 
> Remember, the commit messages have customers.
> Nice to have a BZ referenced, but this BZ entry had no such information,
> and "prevent problems later" didn't answer that key question either.
> 
> thanks,
> -Len


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

* RE: [PATCH 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow.
  2013-09-17 19:31       ` Brown, Len
@ 2013-09-23  1:36         ` Zheng, Lv
  0 siblings, 0 replies; 49+ messages in thread
From: Zheng, Lv @ 2013-09-23  1:36 UTC (permalink / raw
  To: Brown, Len; +Cc: Wysocki, Rafael J, Moore, Robert, linux acpi

OK, I'll add this line to the subject.

Thanks and best regards
-Lv

> From: Brown, Len
> Sent: Wednesday, September 18, 2013 3:31 AM
> 
> > Currently, kernel behaviors are not affected by this patch.
> 
> This is exactly what you want to write in the commit message.
> 
> Imagine, for a minute, a distro scanning thousands of
> patches and reading the title of this one -- they would
> be alarmed by the phrase "buffer overflow" on a kernel patch --
> so you need to tell them not to be alarmed.
> 
> thanks,
> -Len


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

* RE: [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace.
  2013-09-17 19:46         ` Brown, Len
  2013-09-17 19:48           ` Moore, Robert
@ 2013-09-23  1:37           ` Zheng, Lv
  1 sibling, 0 replies; 49+ messages in thread
From: Zheng, Lv @ 2013-09-23  1:37 UTC (permalink / raw
  To: Brown, Len, Moore, Robert; +Cc: Wysocki, Rafael J, linux acpi

OK, I'll clarify that currently kernel is not suffering from this issue in the patch description.

Thanks and best regards
-Lv

> -----Original Message-----
> From: Brown, Len
> Sent: Wednesday, September 18, 2013 3:46 AM
> To: Moore, Robert; Zheng, Lv
> Cc: Wysocki, Rafael J; linux acpi
> Subject: RE: [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace.
> 
> > Just adds a sanity check.
> 
> Ideal if commit messages answer the question:
> 
> "Is this patch important?"
> "If yes, what bad things happen if I don't have it in my kernel?"
> 
> Remember, the commit messages have customers.
> Nice to have a BZ referenced, but this BZ entry
> had no such information, and
> "prevent problems later" didn't answer that key question either.
> 
> thanks,
> -Len


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

* [PATCH v2 00/14] ACPICA 20130823 Release
  2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
                   ` (14 preceding siblings ...)
  2013-09-17  0:54 ` [PATCH 00/14] ACPICA 20130823 Release Len Brown
@ 2013-09-23  1:50 ` Lv Zheng
  2013-09-23  1:51   ` [PATCH v2 01/14] ACPICA: Improve error message for "too many parent prefixes" condition Lv Zheng
                     ` (15 more replies)
  15 siblings, 16 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:50 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

The 20130823 ACPICA kernel resident system updates is linuxized based on
the pm/linux-next branch.

The patch set has passed a build/boot test on the following machines:
Dell Inspiron Mini 1010 (i386)
HP Compaq 8200 Elite SFF PC (x86-64)
With the following kernel configuration items enabled:
  CONFIG_ACPI_AC
  CONFIG_ACPI_BATTERY
  CONFIG_ACPI_NUMA
  CONFIG_ACPI_PROCESSOR
  CONFIG_ACPI_THERMAL
  CONFIG_ACPI_VIDEO
  CONFIG_CPU_FREQ
  CONFIG_I2C_SCMI
  CONFIG_SENSORS_ACPI_POWER
  CONFIG_PANASONIC_LAPTOP
  CONFIG_XO15_EBOOK
  CONFIG_DMAR_TABLE
  CONFIG_INTEL_IOMMU
  CONFIG_IRQ_REMAP

Bjorn Helgaas (1):
  ACPICA: acpi_read: On error, do not modify the return value target
    location.

Bob Moore (7):
  ACPICA: Improve error message for "too many parent prefixes"
    condition.
  ACPICA: Debug output: small formatting update, no functional change.
  ACPICA: Debugger: Prevent possible command line buffer overflow,
    kernel behavior is not affected.
  ACPICA: Validate start object for acpi_walk_namespace.
  ACPICA: Debugger: Add new command to display full namespace
    pathnames.
  ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary
    argument.
  ACPICA: Update version to 20130823.

David E. Box (1):
  ACPICA: Operation region support: Never free the handler "context"
    pointer.

Lv Zheng (4):
  ACPICA: Add support for host-installed SCI handlers.
  ACPICA: Tables: Cleanup table checksum verification code.
  ACPICA: Tables: Cleanup RSDP signature codes.
  ACPICA: Cleanup exception codes.

Naresh Bhat (1):
  ACPICA: Linux-specific header: enable "aarch64" 64-bit build.

 drivers/acpi/acpica/acdebug.h   |    5 +-
 drivers/acpi/acpica/acevents.h  |    6 +-
 drivers/acpi/acpica/acglobal.h  |   18 +++--
 drivers/acpi/acpica/aclocal.h   |    8 +++
 drivers/acpi/acpica/acnamesp.h  |    6 ++
 drivers/acpi/acpica/evgpeutil.c |    2 +-
 drivers/acpi/acpica/evmisc.c    |   14 ++--
 drivers/acpi/acpica/evregion.c  |   23 ++++---
 drivers/acpi/acpica/evsci.c     |   78 ++++++++++++++++++++--
 drivers/acpi/acpica/evxface.c   |  139 +++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/hwxface.c   |   26 ++++----
 drivers/acpi/acpica/nsaccess.c  |    5 +-
 drivers/acpi/acpica/nsdump.c    |  134 +++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/nsxfeval.c  |    8 +++
 drivers/acpi/acpica/tbinstal.c  |   12 +---
 drivers/acpi/acpica/tbprint.c   |   12 +++-
 drivers/acpi/acpica/tbxfroot.c  |    3 +-
 drivers/acpi/acpica/utdebug.c   |    2 +-
 drivers/acpi/acpica/utglobal.c  |    3 +-
 include/acpi/acexcep.h          |    8 ++-
 include/acpi/acpixf.h           |   15 +++--
 include/acpi/actypes.h          |    8 +++
 include/acpi/platform/aclinux.h |    2 +-
 23 files changed, 465 insertions(+), 72 deletions(-)

-- 
1.7.10


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

* [PATCH v2 01/14] ACPICA: Improve error message for "too many parent prefixes" condition.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
@ 2013-09-23  1:51   ` Lv Zheng
  2013-09-23  1:51   ` [PATCH v2 02/14] ACPICA: acpi_read: On error, do not modify the return value target location Lv Zheng
                     ` (14 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:51 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Emit the full offending pathname in the error message.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/nsaccess.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index c5316e5..aff79c7 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -424,8 +424,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
 					/* Current scope has no parent scope */
 
 					ACPI_ERROR((AE_INFO,
-						    "ACPI path has too many parent prefixes (^) "
-						    "- reached beyond root node"));
+						    "%s: Path has too many parent prefixes (^) "
+						    "- reached beyond root node",
+						    pathname));
 					return_ACPI_STATUS(AE_NOT_FOUND);
 				}
 			}
-- 
1.7.10


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

* [PATCH v2 02/14] ACPICA: acpi_read: On error, do not modify the return value target location.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
  2013-09-23  1:51   ` [PATCH v2 01/14] ACPICA: Improve error message for "too many parent prefixes" condition Lv Zheng
@ 2013-09-23  1:51   ` Lv Zheng
  2013-09-23  1:51   ` [PATCH v2 03/14] ACPICA: Debug output: small formatting update, no functional change Lv Zheng
                     ` (13 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:51 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown
  Cc: Lv Zheng, linux-acpi, Bjorn Helgaas

From: Bjorn Helgaas <bjorn.helgaas@hp.com>

If an error happens in the middle of a split 32/32 64-bit I/O
operation, do not modify the target of the return value pointer.
Makes the code consistent with the rest of ACPICA. Bjorn Helgaas.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/hwxface.c |   26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index 5ee7a81..f81fb06 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -119,7 +119,8 @@ ACPI_EXPORT_SYMBOL(acpi_reset)
  ******************************************************************************/
 acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
 {
-	u32 value;
+	u32 value_lo;
+	u32 value_hi;
 	u32 width;
 	u64 address;
 	acpi_status status;
@@ -137,13 +138,8 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
 		return (status);
 	}
 
-	/* Initialize entire 64-bit return value to zero */
-
-	*return_value = 0;
-	value = 0;
-
 	/*
-	 * Two address spaces supported: Memory or IO. PCI_Config is
+	 * Two address spaces supported: Memory or I/O. PCI_Config is
 	 * not supported here because the GAS structure is insufficient
 	 */
 	if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
@@ -155,29 +151,35 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
 		}
 	} else {		/* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
 
+		value_lo = 0;
+		value_hi = 0;
+
 		width = reg->bit_width;
 		if (width == 64) {
 			width = 32;	/* Break into two 32-bit transfers */
 		}
 
 		status = acpi_hw_read_port((acpi_io_address)
-					   address, &value, width);
+					   address, &value_lo, width);
 		if (ACPI_FAILURE(status)) {
 			return (status);
 		}
-		*return_value = value;
 
 		if (reg->bit_width == 64) {
 
 			/* Read the top 32 bits */
 
 			status = acpi_hw_read_port((acpi_io_address)
-						   (address + 4), &value, 32);
+						   (address + 4), &value_hi,
+						   32);
 			if (ACPI_FAILURE(status)) {
 				return (status);
 			}
-			*return_value |= ((u64)value << 32);
 		}
+
+		/* Set the return value only if status is AE_OK */
+
+		*return_value = (value_lo | ((u64)value_hi << 32));
 	}
 
 	ACPI_DEBUG_PRINT((ACPI_DB_IO,
@@ -186,7 +188,7 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
 			  ACPI_FORMAT_UINT64(address),
 			  acpi_ut_get_region_name(reg->space_id)));
 
-	return (status);
+	return (AE_OK);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_read)
-- 
1.7.10


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

* [PATCH v2 03/14] ACPICA: Debug output: small formatting update, no functional change.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
  2013-09-23  1:51   ` [PATCH v2 01/14] ACPICA: Improve error message for "too many parent prefixes" condition Lv Zheng
  2013-09-23  1:51   ` [PATCH v2 02/14] ACPICA: acpi_read: On error, do not modify the return value target location Lv Zheng
@ 2013-09-23  1:51   ` Lv Zheng
  2013-09-23  1:51   ` [PATCH v2 04/14] ACPICA: Linux-specific header: enable "aarch64" 64-bit build Lv Zheng
                     ` (12 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:51 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Allow for longer filenames in the module name output during
trace operations.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/utdebug.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index 5796e11..ffd0db5 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -190,7 +190,7 @@ acpi_debug_print(u32 requested_debug_level,
 	 * Display the module name, current line number, thread ID (if requested),
 	 * current procedure nesting level, and the current procedure name
 	 */
-	acpi_os_printf("%8s-%04ld ", module_name, line_number);
+	acpi_os_printf("%9s-%04ld ", module_name, line_number);
 
 	if (ACPI_LV_THREADS & acpi_dbg_level) {
 		acpi_os_printf("[%u] ", (u32)thread_id);
-- 
1.7.10


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

* [PATCH v2 04/14] ACPICA: Linux-specific header: enable "aarch64" 64-bit build.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (2 preceding siblings ...)
  2013-09-23  1:51   ` [PATCH v2 03/14] ACPICA: Debug output: small formatting update, no functional change Lv Zheng
@ 2013-09-23  1:51   ` Lv Zheng
  2013-09-23  1:51   ` [PATCH v2 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow, kernel behavior is not affected Lv Zheng
                     ` (11 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:51 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown
  Cc: Lv Zheng, linux-acpi, Naresh Bhat

From: Naresh Bhat <naresh.bhat@linaro.org>

Add support for the __aarch64__ define for 64-bit builds.

Signed-off-by: Naresh Bhat <naresh.bhat@linaro.org>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 include/acpi/platform/aclinux.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 68534ef..fda0f3e 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -87,7 +87,7 @@
 #define ACPI_FLUSH_CPU_CACHE()
 #define ACPI_CAST_PTHREAD_T(pthread) ((acpi_thread_id) (pthread))
 
-#if defined(__ia64__) || defined(__x86_64__)
+#if defined(__ia64__) || defined(__x86_64__) || defined(__aarch64__)
 #define ACPI_MACHINE_WIDTH          64
 #define COMPILER_DEPENDENT_INT64    long
 #define COMPILER_DEPENDENT_UINT64   unsigned long
-- 
1.7.10


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

* [PATCH v2 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow, kernel behavior is not affected.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (3 preceding siblings ...)
  2013-09-23  1:51   ` [PATCH v2 04/14] ACPICA: Linux-specific header: enable "aarch64" 64-bit build Lv Zheng
@ 2013-09-23  1:51   ` Lv Zheng
  2013-09-23  1:51   ` [PATCH v2 06/14] ACPICA: Validate start object for acpi_walk_namespace Lv Zheng
                     ` (10 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:51 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Increase the size of a couple of the debugger line buffers.
ACPICA BZ 1037.

The debugger related code is not in the kernel so the behavior of the
kernel is not affected.

Buglink: http://bugs.acpica.org/show_bug.cgi?id=1037
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/acglobal.h |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 90e846f..c9ad2e1 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -445,13 +445,6 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
 ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
 ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
 ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support;
-
-ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
-ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
-ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
-ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
-ACPI_EXTERN char acpi_gbl_db_scope_buf[80];
-ACPI_EXTERN char acpi_gbl_db_debug_filename[80];
 ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
 ACPI_EXTERN char *acpi_gbl_db_buffer;
 ACPI_EXTERN char *acpi_gbl_db_filename;
@@ -459,6 +452,16 @@ ACPI_EXTERN u32 acpi_gbl_db_debug_level;
 ACPI_EXTERN u32 acpi_gbl_db_console_debug_level;
 ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node;
 
+ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
+ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
+
+/* These buffers should all be the same size */
+
+ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_EXTERN char acpi_gbl_db_scope_buf[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_EXTERN char acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE];
+
 /*
  * Statistic globals
  */
-- 
1.7.10


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

* [PATCH v2 06/14] ACPICA: Validate start object for acpi_walk_namespace.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (4 preceding siblings ...)
  2013-09-23  1:51   ` [PATCH v2 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow, kernel behavior is not affected Lv Zheng
@ 2013-09-23  1:51   ` Lv Zheng
  2013-09-23  1:52   ` [PATCH v2 07/14] ACPICA: Add support for host-installed SCI handlers Lv Zheng
                     ` (9 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:51 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Perform a sanity check on the start object to prevent problems
later. ACPICA BZ 1025.
This patch only adds additional input parameter validation, no actual
kernel suffering has been discovered.

Buglink: http://bugs.acpica.org/show_bug.cgi?id=1025
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/nsxfeval.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index b38b4b0..481a6b4 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -605,11 +605,19 @@ acpi_walk_namespace(acpi_object_type type,
 		goto unlock_and_exit;
 	}
 
+	/* Now we can validate the starting node */
+
+	if (!acpi_ns_validate_handle(start_object)) {
+		status = AE_BAD_PARAMETER;
+		goto unlock_and_exit2;
+	}
+
 	status = acpi_ns_walk_namespace(type, start_object, max_depth,
 					ACPI_NS_WALK_UNLOCK,
 					descending_callback, ascending_callback,
 					context, return_value);
 
+      unlock_and_exit2:
 	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 
       unlock_and_exit:
-- 
1.7.10


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

* [PATCH v2 07/14] ACPICA: Add support for host-installed SCI handlers.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (5 preceding siblings ...)
  2013-09-23  1:51   ` [PATCH v2 06/14] ACPICA: Validate start object for acpi_walk_namespace Lv Zheng
@ 2013-09-23  1:52   ` Lv Zheng
  2013-09-23  1:52   ` [PATCH v2 08/14] ACPICA: Operation region support: Never free the handler "context" pointer Lv Zheng
                     ` (8 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:52 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

This change adds support to allow hosts to install System Control
Interrupt handlers. Certain ACPI functionality requires the host
to handle raw SCIs. For example, the "SCI Doorbell" that is defined
for memory power state support requires the host device driver to
handle SCIs to examine if the doorbell has been activated. Multiple
SCI handlers can be installed to allow for future expansion.
Debugger support is included.
Lv Zheng, Bob Moore. ACPICA BZ 1032.

Bug summary:
It is reported when the PCC (Platform Communication Channel, via
MPST table, defined in ACPI specification 5.0) subchannel responds
to the host, it issues an SCI and the host must probe the subchannel
for channel status.

Buglink: http://bugs.acpica.org/show_bug.cgi?id=1032
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/acdebug.h   |    3 +-
 drivers/acpi/acpica/acevents.h  |    6 +-
 drivers/acpi/acpica/acglobal.h  |    1 +
 drivers/acpi/acpica/aclocal.h   |    8 +++
 drivers/acpi/acpica/evgpeutil.c |    2 +-
 drivers/acpi/acpica/evmisc.c    |   14 ++--
 drivers/acpi/acpica/evsci.c     |   80 ++++++++++++++++++++--
 drivers/acpi/acpica/evxface.c   |  139 +++++++++++++++++++++++++++++++++++++++
 drivers/acpi/acpica/utglobal.c  |    3 +-
 include/acpi/acpixf.h           |   13 +++-
 include/acpi/actypes.h          |    3 +
 11 files changed, 249 insertions(+), 23 deletions(-)

diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index 9feba08..30c2d69 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -113,11 +113,12 @@ void acpi_db_display_handlers(void);
 ACPI_HW_DEPENDENT_RETURN_VOID(void
 			      acpi_db_generate_gpe(char *gpe_arg,
 						   char *block_arg))
+ ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_generate_sci(void))
 
 /*
  * dbconvert - miscellaneous conversion routines
  */
- acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value);
+acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value);
 
 acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object);
 
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index ab0e977..3ae5fd0 100644
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@ -242,11 +242,11 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
  */
 u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context);
 
-u32 acpi_ev_install_sci_handler(void);
+u32 acpi_ev_sci_dispatch(void);
 
-acpi_status acpi_ev_remove_sci_handler(void);
+u32 acpi_ev_install_sci_handler(void);
 
-u32 acpi_ev_initialize_SCI(u32 program_SCI);
+acpi_status acpi_ev_remove_all_sci_handlers(void);
 
 ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void))
 #endif				/* __ACEVENTS_H__  */
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index c9ad2e1..0fba431 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -269,6 +269,7 @@ ACPI_EXTERN acpi_table_handler acpi_gbl_table_handler;
 ACPI_EXTERN void *acpi_gbl_table_handler_context;
 ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
 ACPI_EXTERN acpi_interface_handler acpi_gbl_interface_handler;
+ACPI_EXTERN struct acpi_sci_handler_info *acpi_gbl_sci_handler_list;
 
 /* Owner ID support */
 
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 0ed0066..be9e30e 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -398,6 +398,14 @@ struct acpi_simple_repair_info {
  *
  ****************************************************************************/
 
+/* Dispatch info for each host-installed SCI handler */
+
+struct acpi_sci_handler_info {
+	struct acpi_sci_handler_info *next;
+	acpi_sci_handler address;	/* Address of handler */
+	void *context;		/* Context to be passed to handler */
+};
+
 /* Dispatch info for each GPE -- either a method or handler, cannot be both */
 
 struct acpi_gpe_handler_info {
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c
index b24dbb8..d523390 100644
--- a/drivers/acpi/acpica/evgpeutil.c
+++ b/drivers/acpi/acpica/evgpeutil.c
@@ -196,7 +196,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  *
  * FUNCTION:    acpi_ev_get_gpe_xrupt_block
  *
- * PARAMETERS:  interrupt_number     - Interrupt for a GPE block
+ * PARAMETERS:  interrupt_number            - Interrupt for a GPE block
  *
  * RETURN:      A GPE interrupt block
  *
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c
index 1b111ef..a568754 100644
--- a/drivers/acpi/acpica/evmisc.c
+++ b/drivers/acpi/acpica/evmisc.c
@@ -264,13 +264,6 @@ void acpi_ev_terminate(void)
 
 		status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);
 
-		/* Remove SCI handler */
-
-		status = acpi_ev_remove_sci_handler();
-		if (ACPI_FAILURE(status)) {
-			ACPI_ERROR((AE_INFO, "Could not remove SCI handler"));
-		}
-
 		status = acpi_ev_remove_global_lock_handler();
 		if (ACPI_FAILURE(status)) {
 			ACPI_ERROR((AE_INFO,
@@ -280,6 +273,13 @@ void acpi_ev_terminate(void)
 		acpi_gbl_events_initialized = FALSE;
 	}
 
+	/* Remove SCI handlers */
+
+	status = acpi_ev_remove_all_sci_handlers();
+	if (ACPI_FAILURE(status)) {
+		ACPI_ERROR((AE_INFO, "Could not remove SCI handler"));
+	}
+
 	/* Deallocate all handler objects installed within GPE info structs */
 
 	status = acpi_ev_walk_gpe_list(acpi_ev_delete_gpe_handlers, NULL);
diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
index b905acf..b2f0fb2 100644
--- a/drivers/acpi/acpica/evsci.c
+++ b/drivers/acpi/acpica/evsci.c
@@ -54,6 +54,52 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context);
 
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_ev_sci_dispatch
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      Status code indicates whether interrupt was handled.
+ *
+ * DESCRIPTION: Dispatch the SCI to all host-installed SCI handlers.
+ *
+ ******************************************************************************/
+
+u32 acpi_ev_sci_dispatch(void)
+{
+	struct acpi_sci_handler_info *sci_handler;
+	acpi_cpu_flags flags;
+	u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
+
+	ACPI_FUNCTION_NAME(ev_sci_dispatch);
+
+	/* Are there any host-installed SCI handlers? */
+
+	if (!acpi_gbl_sci_handler_list) {
+		return (int_status);
+	}
+
+	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
+
+	/* Invoke all host-installed SCI handlers */
+
+	sci_handler = acpi_gbl_sci_handler_list;
+	while (sci_handler) {
+
+		/* Invoke the installed handler (at interrupt level) */
+
+		int_status |= sci_handler->address((u32)acpi_gbl_FADT.
+						   sci_interrupt,
+						   sci_handler->context);
+
+		sci_handler = sci_handler->next;
+	}
+
+	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
+	return (int_status);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_ev_sci_xrupt_handler
  *
  * PARAMETERS:  context   - Calling Context
@@ -89,6 +135,10 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)
 	 */
 	interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
 
+	/* Invoke all host-installed SCI handlers */
+
+	interrupt_handled |= acpi_ev_sci_dispatch();
+
 	return_UINT32(interrupt_handled);
 }
 
@@ -112,14 +162,13 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)
 	ACPI_FUNCTION_TRACE(ev_gpe_xrupt_handler);
 
 	/*
-	 * We are guaranteed by the ACPI CA initialization/shutdown code that
+	 * We are guaranteed by the ACPICA initialization/shutdown code that
 	 * if this interrupt handler is installed, ACPI is enabled.
 	 */
 
 	/* GPEs: Check for and dispatch any GPEs that have occurred */
 
 	interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
-
 	return_UINT32(interrupt_handled);
 }
 
@@ -150,15 +199,15 @@ u32 acpi_ev_install_sci_handler(void)
 
 /******************************************************************************
  *
- * FUNCTION:    acpi_ev_remove_sci_handler
+ * FUNCTION:    acpi_ev_remove_all_sci_handlers
  *
  * PARAMETERS:  none
  *
- * RETURN:      E_OK if handler uninstalled OK, E_ERROR if handler was not
+ * RETURN:      AE_OK if handler uninstalled, AE_ERROR if handler was not
  *              installed to begin with
  *
  * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be
- *              taken.
+ *              taken. Remove all host-installed SCI handlers.
  *
  * Note:  It doesn't seem important to disable all events or set the event
  *        enable registers to their original values. The OS should disable
@@ -167,11 +216,13 @@ u32 acpi_ev_install_sci_handler(void)
  *
  ******************************************************************************/
 
-acpi_status acpi_ev_remove_sci_handler(void)
+acpi_status acpi_ev_remove_all_sci_handlers(void)
 {
+	struct acpi_sci_handler_info *sci_handler;
+	acpi_cpu_flags flags;
 	acpi_status status;
 
-	ACPI_FUNCTION_TRACE(ev_remove_sci_handler);
+	ACPI_FUNCTION_TRACE(ev_remove_all_sci_handlers);
 
 	/* Just let the OS remove the handler and disable the level */
 
@@ -179,6 +230,21 @@ acpi_status acpi_ev_remove_sci_handler(void)
 	    acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt,
 					     acpi_ev_sci_xrupt_handler);
 
+	if (!acpi_gbl_sci_handler_list) {
+		return (status);
+	}
+
+	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
+
+	/* Free all host-installed SCI handlers */
+
+	while (acpi_gbl_sci_handler_list) {
+		sci_handler = acpi_gbl_sci_handler_list;
+		acpi_gbl_sci_handler_list = sci_handler->next;
+		ACPI_FREE(sci_handler);
+	}
+
+	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
 	return_ACPI_STATUS(status);
 }
 
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index ca5fba9..6f56146 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -385,6 +385,144 @@ ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
 #if (!ACPI_REDUCED_HARDWARE)
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_install_sci_handler
+ *
+ * PARAMETERS:  address             - Address of the handler
+ *              context             - Value passed to the handler on each SCI
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Install a handler for a System Control Interrupt.
+ *
+ ******************************************************************************/
+acpi_status acpi_install_sci_handler(acpi_sci_handler address, void *context)
+{
+	struct acpi_sci_handler_info *new_sci_handler;
+	struct acpi_sci_handler_info *sci_handler;
+	acpi_cpu_flags flags;
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE(acpi_install_sci_handler);
+
+	if (!address) {
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
+	}
+
+	/* Allocate and init a handler object */
+
+	new_sci_handler = ACPI_ALLOCATE(sizeof(struct acpi_sci_handler_info));
+	if (!new_sci_handler) {
+		return_ACPI_STATUS(AE_NO_MEMORY);
+	}
+
+	new_sci_handler->address = address;
+	new_sci_handler->context = context;
+
+	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
+	if (ACPI_FAILURE(status)) {
+		goto exit;
+	}
+
+	/* Lock list during installation */
+
+	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
+	sci_handler = acpi_gbl_sci_handler_list;
+
+	/* Ensure handler does not already exist */
+
+	while (sci_handler) {
+		if (address == sci_handler->address) {
+			status = AE_ALREADY_EXISTS;
+			goto unlock_and_exit;
+		}
+
+		sci_handler = sci_handler->next;
+	}
+
+	/* Install the new handler into the global list (at head) */
+
+	new_sci_handler->next = acpi_gbl_sci_handler_list;
+	acpi_gbl_sci_handler_list = new_sci_handler;
+
+      unlock_and_exit:
+
+	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
+	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+
+      exit:
+	if (ACPI_FAILURE(status)) {
+		ACPI_FREE(new_sci_handler);
+	}
+	return_ACPI_STATUS(status);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_remove_sci_handler
+ *
+ * PARAMETERS:  address             - Address of the handler
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Remove a handler for a System Control Interrupt.
+ *
+ ******************************************************************************/
+
+acpi_status acpi_remove_sci_handler(acpi_sci_handler address)
+{
+	struct acpi_sci_handler_info *prev_sci_handler;
+	struct acpi_sci_handler_info *next_sci_handler;
+	acpi_cpu_flags flags;
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE(acpi_remove_sci_handler);
+
+	if (!address) {
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
+	}
+
+	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	/* Remove the SCI handler with lock */
+
+	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
+
+	prev_sci_handler = NULL;
+	next_sci_handler = acpi_gbl_sci_handler_list;
+	while (next_sci_handler) {
+		if (next_sci_handler->address == address) {
+
+			/* Unlink and free the SCI handler info block */
+
+			if (prev_sci_handler) {
+				prev_sci_handler->next = next_sci_handler->next;
+			} else {
+				acpi_gbl_sci_handler_list =
+				    next_sci_handler->next;
+			}
+
+			acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
+			ACPI_FREE(next_sci_handler);
+			goto unlock_and_exit;
+		}
+
+		prev_sci_handler = next_sci_handler;
+		next_sci_handler = next_sci_handler->next;
+	}
+
+	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
+	status = AE_NOT_EXIST;
+
+      unlock_and_exit:
+	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+	return_ACPI_STATUS(status);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_install_global_event_handler
  *
  * PARAMETERS:  handler         - Pointer to the global event handler function
@@ -398,6 +536,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
  *              Can be used to update event counters, etc.
  *
  ******************************************************************************/
+
 acpi_status
 acpi_install_global_event_handler(acpi_gbl_event_handler handler, void *context)
 {
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index d6f26bf..046d5b0 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -291,7 +291,7 @@ acpi_status acpi_ut_init_globals(void)
 
 #if (!ACPI_REDUCED_HARDWARE)
 
-	/* GPE support */
+	/* GPE/SCI support */
 
 	acpi_gbl_all_gpes_initialized = FALSE;
 	acpi_gbl_gpe_xrupt_list_head = NULL;
@@ -300,6 +300,7 @@ acpi_status acpi_ut_init_globals(void)
 	acpi_current_gpe_count = 0;
 
 	acpi_gbl_global_event_handler = NULL;
+	acpi_gbl_sci_handler_list = NULL;
 
 #endif				/* !ACPI_REDUCED_HARDWARE */
 
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 85bfdbe..55a4d3a 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -280,9 +280,16 @@ acpi_status
 acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
 
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
-				acpi_install_global_event_handler
-				(acpi_gbl_event_handler handler, void *context))
-
+				acpi_install_sci_handler(acpi_sci_handler
+							 address,
+							 void *context))
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
+				 acpi_remove_sci_handler(acpi_sci_handler
+							 address))
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
+				 acpi_install_global_event_handler
+				 (acpi_gbl_event_handler handler,
+				  void *context))
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 				 acpi_install_fixed_event_handler(u32
 								  acpi_event,
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index b748aef..850f750 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -946,6 +946,9 @@ typedef void
  * Various handlers and callback procedures
  */
 typedef
+u32 (*acpi_sci_handler) (u32 interrupt_number, void *context);
+
+typedef
 void (*acpi_gbl_event_handler) (u32 event_type,
 			       acpi_handle device,
 			       u32 event_number, void *context);
-- 
1.7.10


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

* [PATCH v2 08/14] ACPICA: Operation region support: Never free the handler "context" pointer.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (6 preceding siblings ...)
  2013-09-23  1:52   ` [PATCH v2 07/14] ACPICA: Add support for host-installed SCI handlers Lv Zheng
@ 2013-09-23  1:52   ` Lv Zheng
  2013-09-23  1:52   ` [PATCH v2 09/14] ACPICA: Debugger: Add new command to display full namespace pathnames Lv Zheng
                     ` (7 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:52 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown
  Cc: Lv Zheng, linux-acpi, David E. Box

From: "David E. Box" <david.e.box@intel.com>

This change removes some dangerous code that attempts to free the
handler context pointer in some (rare) circumstances. The owner of
the handler owns this pointer and the ACPICA code should never
touch it. Although not seen to be an issue in any kernel, it did
show up as a problem under AcpiExec. Also, set the internal storage
field for the context pointer to zero when the region is deactivated,
simply for sanity. David Box.

Signed-off-by: David E. Box <david.e.box@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/evregion.c |   23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index cea14d6..6293d6b 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -217,16 +217,11 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
 		if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) {
 			region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE;
 
-			if (region_obj2->extra.region_context) {
-
-				/* The handler for this region was already installed */
-
-				ACPI_FREE(region_context);
-			} else {
-				/*
-				 * Save the returned context for use in all accesses to
-				 * this particular region
-				 */
+			/*
+			 * Save the returned context for use in all accesses to
+			 * the handler for this particular region
+			 */
+			if (!(region_obj2->extra.region_context)) {
 				region_obj2->extra.region_context =
 				    region_context;
 			}
@@ -402,6 +397,14 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
 						 handler_obj->address_space.
 						 context, region_context);
 
+				/*
+				 * region_context should have been released by the deactivate
+				 * operation. We don't need access to it anymore here.
+				 */
+				if (region_context) {
+					*region_context = NULL;
+				}
+
 				/* Init routine may fail, Just ignore errors */
 
 				if (ACPI_FAILURE(status)) {
-- 
1.7.10


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

* [PATCH v2 09/14] ACPICA: Debugger: Add new command to display full namespace pathnames.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (7 preceding siblings ...)
  2013-09-23  1:52   ` [PATCH v2 08/14] ACPICA: Operation region support: Never free the handler "context" pointer Lv Zheng
@ 2013-09-23  1:52   ` Lv Zheng
  2013-09-23  1:52   ` [PATCH v2 10/14] ACPICA: Tables: Cleanup table checksum verification code Lv Zheng
                     ` (6 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:52 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Paths command displays the full pathname and object type for
the entire namespace. Alternative to the Namespace command.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/acdebug.h  |    2 +
 drivers/acpi/acpica/acnamesp.h |    6 ++
 drivers/acpi/acpica/nsdump.c   |  134 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 142 insertions(+)

diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index 30c2d69..27c36a5 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -155,6 +155,8 @@ void acpi_db_set_scope(char *name);
 
 void acpi_db_dump_namespace(char *start_arg, char *depth_arg);
 
+void acpi_db_dump_namespace_paths(void);
+
 void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg);
 
 acpi_status acpi_db_find_name_in_namespace(char *name_arg);
diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h
index 40b04bd..e6138ac 100644
--- a/drivers/acpi/acpica/acnamesp.h
+++ b/drivers/acpi/acpica/acnamesp.h
@@ -213,6 +213,12 @@ acpi_ns_dump_objects(acpi_object_type type,
 		     u8 display_type,
 		     u32 max_depth,
 		     acpi_owner_id owner_id, acpi_handle start_handle);
+
+void
+acpi_ns_dump_object_paths(acpi_object_type type,
+			  u8 display_type,
+			  u32 max_depth,
+			  acpi_owner_id owner_id, acpi_handle start_handle);
 #endif				/* ACPI_FUTURE_USAGE */
 
 /*
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 7418c77..8063385 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -59,6 +59,17 @@ acpi_ns_dump_one_device(acpi_handle obj_handle,
 #endif
 
 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
+
+#ifdef	ACPI_FUTURE_USAGE
+static acpi_status
+acpi_ns_dump_one_object_path(acpi_handle obj_handle,
+			     u32 level, void *context, void **return_value);
+
+static acpi_status
+acpi_ns_get_max_depth(acpi_handle obj_handle,
+		      u32 level, void *context, void **return_value);
+#endif				/* ACPI_FUTURE_USAGE */
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ns_print_pathname
@@ -671,6 +682,129 @@ acpi_ns_dump_objects(acpi_object_type type,
 }
 #endif				/* ACPI_FUTURE_USAGE */
 
+#ifdef	ACPI_FUTURE_USAGE
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ns_dump_one_object_path, acpi_ns_get_max_depth
+ *
+ * PARAMETERS:  obj_handle          - Node to be dumped
+ *              level               - Nesting level of the handle
+ *              context             - Passed into walk_namespace
+ *              return_value        - Not used
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Dump the full pathname to a namespace object. acp_ns_get_max_depth
+ *              computes the maximum nesting depth in the namespace tree, in
+ *              order to simplify formatting in acpi_ns_dump_one_object_path.
+ *              These procedures are user_functions called by acpi_ns_walk_namespace.
+ *
+ ******************************************************************************/
+
+static acpi_status
+acpi_ns_dump_one_object_path(acpi_handle obj_handle,
+			     u32 level, void *context, void **return_value)
+{
+	u32 max_level = *((u32 *)context);
+	char *pathname;
+	struct acpi_namespace_node *node;
+	int path_indent;
+
+	if (!obj_handle) {
+		return (AE_OK);
+	}
+
+	node = acpi_ns_validate_handle(obj_handle);
+	pathname = acpi_ns_get_external_pathname(node);
+
+	path_indent = 1;
+	if (level <= max_level) {
+		path_indent = max_level - level + 1;
+	}
+
+	acpi_os_printf("%2d%*s%-12s%*s",
+		       level, level, " ", acpi_ut_get_type_name(node->type),
+		       path_indent, " ");
+
+	acpi_os_printf("%s\n", &pathname[1]);
+	ACPI_FREE(pathname);
+	return (AE_OK);
+}
+
+static acpi_status
+acpi_ns_get_max_depth(acpi_handle obj_handle,
+		      u32 level, void *context, void **return_value)
+{
+	u32 *max_level = (u32 *)context;
+
+	if (level > *max_level) {
+		*max_level = level;
+	}
+	return (AE_OK);
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ns_dump_object_paths
+ *
+ * PARAMETERS:  type                - Object type to be dumped
+ *              display_type        - 0 or ACPI_DISPLAY_SUMMARY
+ *              max_depth           - Maximum depth of dump. Use ACPI_UINT32_MAX
+ *                                    for an effectively unlimited depth.
+ *              owner_id            - Dump only objects owned by this ID. Use
+ *                                    ACPI_UINT32_MAX to match all owners.
+ *              start_handle        - Where in namespace to start/end search
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Dump full object pathnames within the loaded namespace. Uses
+ *              acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object_path.
+ *
+ ******************************************************************************/
+
+void
+acpi_ns_dump_object_paths(acpi_object_type type,
+			  u8 display_type,
+			  u32 max_depth,
+			  acpi_owner_id owner_id, acpi_handle start_handle)
+{
+	acpi_status status;
+	u32 max_level = 0;
+
+	ACPI_FUNCTION_ENTRY();
+
+	/*
+	 * Just lock the entire namespace for the duration of the dump.
+	 * We don't want any changes to the namespace during this time,
+	 * especially the temporary nodes since we are going to display
+	 * them also.
+	 */
+	status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+	if (ACPI_FAILURE(status)) {
+		acpi_os_printf("Could not acquire namespace mutex\n");
+		return;
+	}
+
+	/* Get the max depth of the namespace tree, for formatting later */
+
+	(void)acpi_ns_walk_namespace(type, start_handle, max_depth,
+				     ACPI_NS_WALK_NO_UNLOCK |
+				     ACPI_NS_WALK_TEMP_NODES,
+				     acpi_ns_get_max_depth, NULL,
+				     (void *)&max_level, NULL);
+
+	/* Now dump the entire namespace */
+
+	(void)acpi_ns_walk_namespace(type, start_handle, max_depth,
+				     ACPI_NS_WALK_NO_UNLOCK |
+				     ACPI_NS_WALK_TEMP_NODES,
+				     acpi_ns_dump_one_object_path, NULL,
+				     (void *)&max_level, NULL);
+
+	(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
+}
+#endif				/* ACPI_FUTURE_USAGE */
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ns_dump_entry
-- 
1.7.10


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

* [PATCH v2 10/14] ACPICA: Tables: Cleanup table checksum verification code.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (8 preceding siblings ...)
  2013-09-23  1:52   ` [PATCH v2 09/14] ACPICA: Debugger: Add new command to display full namespace pathnames Lv Zheng
@ 2013-09-23  1:52   ` Lv Zheng
  2013-09-23  1:52   ` [PATCH v2 11/14] ACPICA: Tables: Cleanup RSDP signature codes Lv Zheng
                     ` (5 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:52 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

This patch reduces code redundancy by moving the FACS/S3PT checksum
verification skip logic into acpi_tb_verify_checksum() and other
calls of this function also get benefit from this change.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/tbinstal.c |   12 +++---------
 drivers/acpi/acpica/tbprint.c  |   10 ++++++++++
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index 42a13c0..9e6788f 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -80,16 +80,10 @@ acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc)
 		}
 	}
 
-	/* FACS is the odd table, has no standard ACPI header and no checksum */
+	/* Always calculate checksum, ignore bad checksum if requested */
 
-	if (!ACPI_COMPARE_NAME(&table_desc->signature, ACPI_SIG_FACS)) {
-
-		/* Always calculate checksum, ignore bad checksum if requested */
-
-		status =
-		    acpi_tb_verify_checksum(table_desc->pointer,
-					    table_desc->length);
-	}
+	status =
+	    acpi_tb_verify_checksum(table_desc->pointer, table_desc->length);
 
 	return_ACPI_STATUS(status);
 }
diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
index dc963f8..499759a 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -190,6 +190,16 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length)
 {
 	u8 checksum;
 
+	/*
+	 * FACS/S3PT:
+	 * They are the odd tables, have no standard ACPI header and no checksum
+	 */
+
+	if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_S3PT) ||
+	    ACPI_COMPARE_NAME(table->signature, ACPI_SIG_FACS)) {
+		return (AE_OK);
+	}
+
 	/* Compute the checksum on the table */
 
 	checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, table), length);
-- 
1.7.10


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

* [PATCH v2 11/14] ACPICA: Tables: Cleanup RSDP signature codes.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (9 preceding siblings ...)
  2013-09-23  1:52   ` [PATCH v2 10/14] ACPICA: Tables: Cleanup table checksum verification code Lv Zheng
@ 2013-09-23  1:52   ` Lv Zheng
  2013-09-23  1:52   ` [PATCH v2 12/14] ACPICA: Cleanup exception codes Lv Zheng
                     ` (4 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:52 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

This patch introduces new macors to handle RSDP signature and cleans up the
affected codes.  Lv Zheng.
Some updates are only used for ACPICA utilities which are not shipped in
the kernel yet.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/tbprint.c  |    2 +-
 drivers/acpi/acpica/tbxfroot.c |    3 +--
 include/acpi/actypes.h         |    5 +++++
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
index 499759a..9a47715 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -138,7 +138,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
 		ACPI_INFO((AE_INFO, "%4.4s %p %05X",
 			   header->signature, ACPI_CAST_PTR(void, address),
 			   header->length));
-	} else if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_RSDP)) {
+	} else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) {
 
 		/* RSDP has no common fields */
 
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index 948c95e..1c95fab 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -68,8 +68,7 @@ acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
 	 * Note: Sometimes there exists more than one RSDP in memory; the valid
 	 * RSDP has a valid checksum, all others have an invalid checksum.
 	 */
-	if (ACPI_STRNCMP((char *)rsdp->signature, ACPI_SIG_RSDP,
-			 sizeof(ACPI_SIG_RSDP) - 1) != 0) {
+	if (!ACPI_VALIDATE_RSDP_SIG(rsdp->signature)) {
 
 		/* Nope, BAD Signature */
 
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 850f750..5400672 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -474,6 +474,11 @@ typedef u64 acpi_integer;
 #define ACPI_MOVE_NAME(dest,src)        (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))
 #endif
 
+/* Support for the special RSDP signature (8 characters) */
+
+#define ACPI_VALIDATE_RSDP_SIG(a)       (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
+#define ACPI_MAKE_RSDP_SIG(dest)        (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
+
 /*******************************************************************************
  *
  * Miscellaneous constants
-- 
1.7.10


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

* [PATCH v2 12/14] ACPICA: Cleanup exception codes.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (10 preceding siblings ...)
  2013-09-23  1:52   ` [PATCH v2 11/14] ACPICA: Tables: Cleanup RSDP signature codes Lv Zheng
@ 2013-09-23  1:52   ` Lv Zheng
  2013-09-23  1:52   ` [PATCH v2 13/14] ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument Lv Zheng
                     ` (3 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:52 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

This patch adds AE_ACCESS for EACCES or EPERM.  Some error prompts are
also cleaned up in this patch.  Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 include/acpi/acexcep.h |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index cf051e0..4e280bd 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -125,8 +125,9 @@ struct acpi_exception_info {
 #define AE_NO_HANDLER                   EXCEP_ENV (0x001A)
 #define AE_OWNER_ID_LIMIT               EXCEP_ENV (0x001B)
 #define AE_NOT_CONFIGURED               EXCEP_ENV (0x001C)
+#define AE_ACCESS                       EXCEP_ENV (0x001D)
 
-#define AE_CODE_ENV_MAX                 0x001C
+#define AE_CODE_ENV_MAX                 0x001D
 
 /*
  * Programmer exceptions
@@ -227,7 +228,7 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = {
 	EXCEP_TXT("AE_NO_ACPI_TABLES", "ACPI tables could not be found"),
 	EXCEP_TXT("AE_NO_NAMESPACE", "A namespace has not been loaded"),
 	EXCEP_TXT("AE_NO_MEMORY", "Insufficient dynamic memory"),
-	EXCEP_TXT("AE_NOT_FOUND", "The name was not found in the namespace"),
+	EXCEP_TXT("AE_NOT_FOUND", "A requested entity is not found"),
 	EXCEP_TXT("AE_NOT_EXIST", "A required entity does not exist"),
 	EXCEP_TXT("AE_ALREADY_EXISTS", "An entity already exists"),
 	EXCEP_TXT("AE_TYPE", "The object type is incorrect"),
@@ -259,7 +260,8 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = {
 	EXCEP_TXT("AE_OWNER_ID_LIMIT",
 		  "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")
+		  "The interface is not part of the current subsystem configuration"),
+	EXCEP_TXT("AE_ACCESS", "Permission denied for the requested operation")
 };
 
 static const struct acpi_exception_info acpi_gbl_exception_names_pgm[] = {
-- 
1.7.10


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

* [PATCH v2 13/14] ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (11 preceding siblings ...)
  2013-09-23  1:52   ` [PATCH v2 12/14] ACPICA: Cleanup exception codes Lv Zheng
@ 2013-09-23  1:52   ` Lv Zheng
  2013-09-23  1:52   ` [PATCH v2 14/14] ACPICA: Update version to 20130823 Lv Zheng
                     ` (2 subsequent siblings)
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:52 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

The SCI interrupt number is not needed for the SCI handlers, and was
just unnecessary overhead.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/acpica/evsci.c |    4 +---
 include/acpi/actypes.h      |    2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
index b2f0fb2..94d9ebd 100644
--- a/drivers/acpi/acpica/evsci.c
+++ b/drivers/acpi/acpica/evsci.c
@@ -87,9 +87,7 @@ u32 acpi_ev_sci_dispatch(void)
 
 		/* Invoke the installed handler (at interrupt level) */
 
-		int_status |= sci_handler->address((u32)acpi_gbl_FADT.
-						   sci_interrupt,
-						   sci_handler->context);
+		int_status |= sci_handler->address(sci_handler->context);
 
 		sci_handler = sci_handler->next;
 	}
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 5400672..f6abf23 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -951,7 +951,7 @@ typedef void
  * Various handlers and callback procedures
  */
 typedef
-u32 (*acpi_sci_handler) (u32 interrupt_number, void *context);
+u32 (*acpi_sci_handler) (void *context);
 
 typedef
 void (*acpi_gbl_event_handler) (u32 event_type,
-- 
1.7.10


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

* [PATCH v2 14/14] ACPICA: Update version to 20130823.
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (12 preceding siblings ...)
  2013-09-23  1:52   ` [PATCH v2 13/14] ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument Lv Zheng
@ 2013-09-23  1:52   ` Lv Zheng
  2013-09-23 20:21   ` [PATCH v2 00/14] ACPICA 20130823 Release Brown, Len
  2013-09-25 16:00   ` Rafael J. Wysocki
  15 siblings, 0 replies; 49+ messages in thread
From: Lv Zheng @ 2013-09-23  1:52 UTC (permalink / raw
  To: Rafael J. Wysocki, Robert Moore, Len Brown; +Cc: Lv Zheng, linux-acpi

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

Version 20130823.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Reviewed-by: Len Brown <len.brown@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 55a4d3a..c7b1475 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20130725
+#define ACPI_CA_VERSION                 0x20130823
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
-- 
1.7.10


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

* RE: [PATCH v2 00/14] ACPICA 20130823 Release
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (13 preceding siblings ...)
  2013-09-23  1:52   ` [PATCH v2 14/14] ACPICA: Update version to 20130823 Lv Zheng
@ 2013-09-23 20:21   ` Brown, Len
  2013-09-25 16:00   ` Rafael J. Wysocki
  15 siblings, 0 replies; 49+ messages in thread
From: Brown, Len @ 2013-09-23 20:21 UTC (permalink / raw
  To: Zheng, Lv, Wysocki, Rafael J, Moore, Robert; +Cc: linux-acpi@vger.kernel.org

Thanks for posting the refreshed series.
It looks ready for linux-next to me.

cheers,
-Len


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

* Re: [PATCH v2 00/14] ACPICA 20130823 Release
  2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
                     ` (14 preceding siblings ...)
  2013-09-23 20:21   ` [PATCH v2 00/14] ACPICA 20130823 Release Brown, Len
@ 2013-09-25 16:00   ` Rafael J. Wysocki
  2013-09-27  7:44     ` Zheng, Lv
  15 siblings, 1 reply; 49+ messages in thread
From: Rafael J. Wysocki @ 2013-09-25 16:00 UTC (permalink / raw
  To: Lv Zheng; +Cc: Rafael J. Wysocki, Robert Moore, Len Brown, linux-acpi

On Monday, September 23, 2013 09:50:40 AM Lv Zheng wrote:
> The 20130823 ACPICA kernel resident system updates is linuxized based on
> the pm/linux-next branch.
> 
> The patch set has passed a build/boot test on the following machines:
> Dell Inspiron Mini 1010 (i386)
> HP Compaq 8200 Elite SFF PC (x86-64)
> With the following kernel configuration items enabled:
>   CONFIG_ACPI_AC
>   CONFIG_ACPI_BATTERY
>   CONFIG_ACPI_NUMA
>   CONFIG_ACPI_PROCESSOR
>   CONFIG_ACPI_THERMAL
>   CONFIG_ACPI_VIDEO
>   CONFIG_CPU_FREQ
>   CONFIG_I2C_SCMI
>   CONFIG_SENSORS_ACPI_POWER
>   CONFIG_PANASONIC_LAPTOP
>   CONFIG_XO15_EBOOK
>   CONFIG_DMAR_TABLE
>   CONFIG_INTEL_IOMMU
>   CONFIG_IRQ_REMAP
> 
> Bjorn Helgaas (1):
>   ACPICA: acpi_read: On error, do not modify the return value target
>     location.
> 
> Bob Moore (7):
>   ACPICA: Improve error message for "too many parent prefixes"
>     condition.
>   ACPICA: Debug output: small formatting update, no functional change.
>   ACPICA: Debugger: Prevent possible command line buffer overflow,
>     kernel behavior is not affected.
>   ACPICA: Validate start object for acpi_walk_namespace.
>   ACPICA: Debugger: Add new command to display full namespace
>     pathnames.
>   ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary
>     argument.
>   ACPICA: Update version to 20130823.
> 
> David E. Box (1):
>   ACPICA: Operation region support: Never free the handler "context"
>     pointer.
> 
> Lv Zheng (4):
>   ACPICA: Add support for host-installed SCI handlers.
>   ACPICA: Tables: Cleanup table checksum verification code.
>   ACPICA: Tables: Cleanup RSDP signature codes.
>   ACPICA: Cleanup exception codes.
> 
> Naresh Bhat (1):
>   ACPICA: Linux-specific header: enable "aarch64" 64-bit build.

Queued up for 3.13, thanks Lv!


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

* RE: [PATCH v2 00/14] ACPICA 20130823 Release
  2013-09-25 16:00   ` Rafael J. Wysocki
@ 2013-09-27  7:44     ` Zheng, Lv
  0 siblings, 0 replies; 49+ messages in thread
From: Zheng, Lv @ 2013-09-27  7:44 UTC (permalink / raw
  To: Rafael J. Wysocki
  Cc: Wysocki, Rafael J, Moore, Robert, Brown, Len,
	linux-acpi@vger.kernel.org



> -----Original Message-----
> From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net]
> Sent: Thursday, September 26, 2013 12:01 AM
> To: Zheng, Lv
> Cc: Wysocki, Rafael J; Moore, Robert; Brown, Len; linux-acpi@vger.kernel.org
> Subject: Re: [PATCH v2 00/14] ACPICA 20130823 Release
> 
> On Monday, September 23, 2013 09:50:40 AM Lv Zheng wrote:
> > The 20130823 ACPICA kernel resident system updates is linuxized based on
> > the pm/linux-next branch.
> >
> > The patch set has passed a build/boot test on the following machines:
> > Dell Inspiron Mini 1010 (i386)
> > HP Compaq 8200 Elite SFF PC (x86-64)
> > With the following kernel configuration items enabled:
> >   CONFIG_ACPI_AC
> >   CONFIG_ACPI_BATTERY
> >   CONFIG_ACPI_NUMA
> >   CONFIG_ACPI_PROCESSOR
> >   CONFIG_ACPI_THERMAL
> >   CONFIG_ACPI_VIDEO
> >   CONFIG_CPU_FREQ
> >   CONFIG_I2C_SCMI
> >   CONFIG_SENSORS_ACPI_POWER
> >   CONFIG_PANASONIC_LAPTOP
> >   CONFIG_XO15_EBOOK
> >   CONFIG_DMAR_TABLE
> >   CONFIG_INTEL_IOMMU
> >   CONFIG_IRQ_REMAP
> >
> > Bjorn Helgaas (1):
> >   ACPICA: acpi_read: On error, do not modify the return value target
> >     location.
> >
> > Bob Moore (7):
> >   ACPICA: Improve error message for "too many parent prefixes"
> >     condition.
> >   ACPICA: Debug output: small formatting update, no functional change.
> >   ACPICA: Debugger: Prevent possible command line buffer overflow,
> >     kernel behavior is not affected.
> >   ACPICA: Validate start object for acpi_walk_namespace.
> >   ACPICA: Debugger: Add new command to display full namespace
> >     pathnames.
> >   ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary
> >     argument.
> >   ACPICA: Update version to 20130823.
> >
> > David E. Box (1):
> >   ACPICA: Operation region support: Never free the handler "context"
> >     pointer.
> >
> > Lv Zheng (4):
> >   ACPICA: Add support for host-installed SCI handlers.
> >   ACPICA: Tables: Cleanup table checksum verification code.
> >   ACPICA: Tables: Cleanup RSDP signature codes.
> >   ACPICA: Cleanup exception codes.
> >
> > Naresh Bhat (1):
> >   ACPICA: Linux-specific header: enable "aarch64" 64-bit build.
> 
> Queued up for 3.13, thanks Lv!

Thanks for the help.

Cheers
-Lv


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

end of thread, other threads:[~2013-09-27  7:44 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-12  8:54 [PATCH 00/14] ACPICA 20130823 Release Lv Zheng
2013-09-12  8:54 ` [PATCH 01/14] ACPICA: Improve error message for "too many parent prefixes" condition Lv Zheng
2013-09-12  8:54 ` [PATCH 02/14] ACPICA: acpi_read: On error, do not modify the return value target location Lv Zheng
2013-09-12  8:54 ` [PATCH 03/14] ACPICA: Debug output: small formatting update, no functional change Lv Zheng
2013-09-12  8:54 ` [PATCH 04/14] ACPICA: Linux-specific header: enable "aarch64" 64-bit build Lv Zheng
2013-09-12  8:54 ` [PATCH 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow Lv Zheng
2013-09-17  0:42   ` Len Brown
2013-09-17  1:15     ` Zheng, Lv
2013-09-17 19:31       ` Brown, Len
2013-09-23  1:36         ` Zheng, Lv
2013-09-12  8:55 ` [PATCH 06/14] ACPICA: Validate start object for acpi_walk_namespace Lv Zheng
2013-09-17  0:44   ` Len Brown
2013-09-17  1:25     ` Zheng, Lv
2013-09-17  2:56       ` Moore, Robert
2013-09-17 19:46         ` Brown, Len
2013-09-17 19:48           ` Moore, Robert
2013-09-23  1:37           ` Zheng, Lv
2013-09-12  8:55 ` [PATCH 07/14] ACPICA: Add support for host-installed SCI handlers Lv Zheng
2013-09-17  0:48   ` Len Brown
2013-09-17  1:07     ` Zheng, Lv
2013-09-17 17:47     ` Moore, Robert
2013-09-12  8:55 ` [PATCH 08/14] ACPICA: Operation region support: Never free the handler "context" pointer Lv Zheng
2013-09-12  8:55 ` [PATCH 09/14] ACPICA: Debugger: Add new command to display full namespace pathnames Lv Zheng
2013-09-12  8:55 ` [PATCH 10/14] ACPICA: Tables: Cleanup table checksum verification code Lv Zheng
2013-09-12  8:55 ` [PATCH 11/14] ACPICA: Tables: Cleanup RSDP signature codes Lv Zheng
2013-09-17  0:51   ` Len Brown
2013-09-17  1:11     ` Zheng, Lv
2013-09-12  8:55 ` [PATCH 12/14] ACPICA: Cleanup exception codes Lv Zheng
2013-09-12  8:55 ` [PATCH 13/14] ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument Lv Zheng
2013-09-12  8:55 ` [PATCH 14/14] ACPICA: Update version to 20130823 Lv Zheng
2013-09-17  0:54 ` [PATCH 00/14] ACPICA 20130823 Release Len Brown
2013-09-23  1:50 ` [PATCH v2 " Lv Zheng
2013-09-23  1:51   ` [PATCH v2 01/14] ACPICA: Improve error message for "too many parent prefixes" condition Lv Zheng
2013-09-23  1:51   ` [PATCH v2 02/14] ACPICA: acpi_read: On error, do not modify the return value target location Lv Zheng
2013-09-23  1:51   ` [PATCH v2 03/14] ACPICA: Debug output: small formatting update, no functional change Lv Zheng
2013-09-23  1:51   ` [PATCH v2 04/14] ACPICA: Linux-specific header: enable "aarch64" 64-bit build Lv Zheng
2013-09-23  1:51   ` [PATCH v2 05/14] ACPICA: Debugger: Prevent possible command line buffer overflow, kernel behavior is not affected Lv Zheng
2013-09-23  1:51   ` [PATCH v2 06/14] ACPICA: Validate start object for acpi_walk_namespace Lv Zheng
2013-09-23  1:52   ` [PATCH v2 07/14] ACPICA: Add support for host-installed SCI handlers Lv Zheng
2013-09-23  1:52   ` [PATCH v2 08/14] ACPICA: Operation region support: Never free the handler "context" pointer Lv Zheng
2013-09-23  1:52   ` [PATCH v2 09/14] ACPICA: Debugger: Add new command to display full namespace pathnames Lv Zheng
2013-09-23  1:52   ` [PATCH v2 10/14] ACPICA: Tables: Cleanup table checksum verification code Lv Zheng
2013-09-23  1:52   ` [PATCH v2 11/14] ACPICA: Tables: Cleanup RSDP signature codes Lv Zheng
2013-09-23  1:52   ` [PATCH v2 12/14] ACPICA: Cleanup exception codes Lv Zheng
2013-09-23  1:52   ` [PATCH v2 13/14] ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument Lv Zheng
2013-09-23  1:52   ` [PATCH v2 14/14] ACPICA: Update version to 20130823 Lv Zheng
2013-09-23 20:21   ` [PATCH v2 00/14] ACPICA 20130823 Release Brown, Len
2013-09-25 16:00   ` Rafael J. Wysocki
2013-09-27  7:44     ` Zheng, Lv

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.