All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/15] ACPICA: 20160212 Release
@ 2016-02-19  6:15 ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:15 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi

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

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

The divergences checking result:
Before applying (20160108 Release):
  506 lines
After applying (20160212 Release):
  506 lines

Bob Moore (8):
  ACPICA: Remove incorrect "static" from a global structure
  ACPICA: iASL: Fix some typos with the name strtoul64
  ACPICA: iASL: Update to use internal acpi_ut_strtoul64 function
  ACPICA: Remove unnecessary arguments to ACPI_INFO
  ACPICA: ACPI 6.1: Add full support for this version of ACPI spec
  ACPICA: Revert "Parser: Fix for SuperName method invocation"
  ACPICA: Utilities: Update trace mechinism for acquire_object
  ACPICA: Update version to 20160212

Colin Ian King (1):
  ACPICA: debugger: dbconvert: free pld_info on error return path

David E. Box (1):
  ACPICA: ACPI 6.0/iASL: Add support for the External AML opcode

Lv Zheng (4):
  ACPICA: Tables: make default region accessible during the table load
  ACPICA: ACPICA: Tune _REG evaluations order in the initialization
    steps
  ACPICA: Namespace: Ensure \_SB._INI executed before any _REG
  ACPICA: Namespace: Rename acpi_gbl_reg_methods_enabled to
    acpi_gbl_namespace_initialized

waddlesplash (1):
  ACPICA: aclocal: Put parens around some definitions.

 drivers/acpi/acpica/acglobal.h  |    2 +-
 drivers/acpi/acpica/aclocal.h   |    6 +-
 drivers/acpi/acpica/acnamesp.h  |    2 +-
 drivers/acpi/acpica/acpredef.h  |   11 +-
 drivers/acpi/acpica/dbcmds.c    |    2 +-
 drivers/acpi/acpica/dbconvert.c |    5 +-
 drivers/acpi/acpica/dsmethod.c  |    3 +-
 drivers/acpi/acpica/dsobject.c  |    3 +-
 drivers/acpi/acpica/evgpeblk.c  |    3 +-
 drivers/acpi/acpica/evgpeinit.c |    2 +-
 drivers/acpi/acpica/evregion.c  |    2 +-
 drivers/acpi/acpica/exconfig.c  |    4 +-
 drivers/acpi/acpica/exoparg3.c  |    4 +-
 drivers/acpi/acpica/nseval.c    |    3 +-
 drivers/acpi/acpica/nsinit.c    |  135 ++++++++++++---------
 drivers/acpi/acpica/psargs.c    |    9 +-
 drivers/acpi/acpica/tbinstal.c  |    5 +-
 drivers/acpi/acpica/tbprint.c   |    7 +-
 drivers/acpi/acpica/tbutils.c   |    4 +-
 drivers/acpi/acpica/tbxfload.c  |   28 ++++-
 drivers/acpi/acpica/utcache.c   |    2 +-
 drivers/acpi/acpica/utdecode.c  |   30 ++---
 drivers/acpi/acpica/utnonansi.c |  246 ++++++++++++++++++++++++++++++++-------
 drivers/acpi/acpica/uttrack.c   |    2 +-
 drivers/acpi/acpica/utxferror.c |    3 +-
 drivers/acpi/acpica/utxfinit.c  |   42 +++----
 include/acpi/acoutput.h         |    2 +-
 include/acpi/acpixf.h           |    8 +-
 include/acpi/actbl.h            |    2 +-
 include/acpi/actbl1.h           |   29 ++++-
 include/acpi/actypes.h          |    3 +-
 31 files changed, 418 insertions(+), 191 deletions(-)

-- 
1.7.10


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

* [PATCH 00/15] ACPICA: 20160212 Release
@ 2016-02-19  6:15 ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:15 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi

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

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

The divergences checking result:
Before applying (20160108 Release):
  506 lines
After applying (20160212 Release):
  506 lines

Bob Moore (8):
  ACPICA: Remove incorrect "static" from a global structure
  ACPICA: iASL: Fix some typos with the name strtoul64
  ACPICA: iASL: Update to use internal acpi_ut_strtoul64 function
  ACPICA: Remove unnecessary arguments to ACPI_INFO
  ACPICA: ACPI 6.1: Add full support for this version of ACPI spec
  ACPICA: Revert "Parser: Fix for SuperName method invocation"
  ACPICA: Utilities: Update trace mechinism for acquire_object
  ACPICA: Update version to 20160212

Colin Ian King (1):
  ACPICA: debugger: dbconvert: free pld_info on error return path

David E. Box (1):
  ACPICA: ACPI 6.0/iASL: Add support for the External AML opcode

Lv Zheng (4):
  ACPICA: Tables: make default region accessible during the table load
  ACPICA: ACPICA: Tune _REG evaluations order in the initialization
    steps
  ACPICA: Namespace: Ensure \_SB._INI executed before any _REG
  ACPICA: Namespace: Rename acpi_gbl_reg_methods_enabled to
    acpi_gbl_namespace_initialized

waddlesplash (1):
  ACPICA: aclocal: Put parens around some definitions.

 drivers/acpi/acpica/acglobal.h  |    2 +-
 drivers/acpi/acpica/aclocal.h   |    6 +-
 drivers/acpi/acpica/acnamesp.h  |    2 +-
 drivers/acpi/acpica/acpredef.h  |   11 +-
 drivers/acpi/acpica/dbcmds.c    |    2 +-
 drivers/acpi/acpica/dbconvert.c |    5 +-
 drivers/acpi/acpica/dsmethod.c  |    3 +-
 drivers/acpi/acpica/dsobject.c  |    3 +-
 drivers/acpi/acpica/evgpeblk.c  |    3 +-
 drivers/acpi/acpica/evgpeinit.c |    2 +-
 drivers/acpi/acpica/evregion.c  |    2 +-
 drivers/acpi/acpica/exconfig.c  |    4 +-
 drivers/acpi/acpica/exoparg3.c  |    4 +-
 drivers/acpi/acpica/nseval.c    |    3 +-
 drivers/acpi/acpica/nsinit.c    |  135 ++++++++++++---------
 drivers/acpi/acpica/psargs.c    |    9 +-
 drivers/acpi/acpica/tbinstal.c  |    5 +-
 drivers/acpi/acpica/tbprint.c   |    7 +-
 drivers/acpi/acpica/tbutils.c   |    4 +-
 drivers/acpi/acpica/tbxfload.c  |   28 ++++-
 drivers/acpi/acpica/utcache.c   |    2 +-
 drivers/acpi/acpica/utdecode.c  |   30 ++---
 drivers/acpi/acpica/utnonansi.c |  246 ++++++++++++++++++++++++++++++++-------
 drivers/acpi/acpica/uttrack.c   |    2 +-
 drivers/acpi/acpica/utxferror.c |    3 +-
 drivers/acpi/acpica/utxfinit.c  |   42 +++----
 include/acpi/acoutput.h         |    2 +-
 include/acpi/acpixf.h           |    8 +-
 include/acpi/actbl.h            |    2 +-
 include/acpi/actbl1.h           |   29 ++++-
 include/acpi/actypes.h          |    3 +-
 31 files changed, 418 insertions(+), 191 deletions(-)

-- 
1.7.10

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

* [PATCH 01/15] ACPICA: aclocal: Put parens around some definitions.
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:16   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, waddlesplash, Bob Moore

From: waddlesplash <waddlesplash@gmail.com>

ACPICA commit 7100a109f7d6523330d29f4d088cf1ffb756025f

Looking at where these are used, this shouldn't result in any behavioral changes, but it's best practices to have them.

Link: https://github.com/acpica/acpica/commit/7100a109
Signed-off-by: waddlesplash <waddlesplash@gmail.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/aclocal.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index e4977fa..9562a10 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -85,7 +85,7 @@ union acpi_parse_object;
 #define ACPI_MTX_MEMORY                 5	/* Debug memory tracking lists */
 
 #define ACPI_MAX_MUTEX                  5
-#define ACPI_NUM_MUTEX                  ACPI_MAX_MUTEX+1
+#define ACPI_NUM_MUTEX                  (ACPI_MAX_MUTEX+1)
 
 /* Lock structure for reader/writer interfaces */
 
@@ -103,11 +103,11 @@ struct acpi_rw_lock {
 #define ACPI_LOCK_HARDWARE              1
 
 #define ACPI_MAX_LOCK                   1
-#define ACPI_NUM_LOCK                   ACPI_MAX_LOCK+1
+#define ACPI_NUM_LOCK                   (ACPI_MAX_LOCK+1)
 
 /* This Thread ID means that the mutex is not in use (unlocked) */
 
-#define ACPI_MUTEX_NOT_ACQUIRED         (acpi_thread_id) 0
+#define ACPI_MUTEX_NOT_ACQUIRED         ((acpi_thread_id) 0)
 
 /* This Thread ID means an invalid thread ID */
 
-- 
1.7.10

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

* [PATCH 01/15] ACPICA: aclocal: Put parens around some definitions.
@ 2016-02-19  6:16   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, waddlesplash, Bob Moore

From: waddlesplash <waddlesplash@gmail.com>

ACPICA commit 7100a109f7d6523330d29f4d088cf1ffb756025f

Looking at where these are used, this shouldn't result in any behavioral changes, but it's best practices to have them.

Link: https://github.com/acpica/acpica/commit/7100a109
Signed-off-by: waddlesplash <waddlesplash@gmail.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/aclocal.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index e4977fa..9562a10 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -85,7 +85,7 @@ union acpi_parse_object;
 #define ACPI_MTX_MEMORY                 5	/* Debug memory tracking lists */
 
 #define ACPI_MAX_MUTEX                  5
-#define ACPI_NUM_MUTEX                  ACPI_MAX_MUTEX+1
+#define ACPI_NUM_MUTEX                  (ACPI_MAX_MUTEX+1)
 
 /* Lock structure for reader/writer interfaces */
 
@@ -103,11 +103,11 @@ struct acpi_rw_lock {
 #define ACPI_LOCK_HARDWARE              1
 
 #define ACPI_MAX_LOCK                   1
-#define ACPI_NUM_LOCK                   ACPI_MAX_LOCK+1
+#define ACPI_NUM_LOCK                   (ACPI_MAX_LOCK+1)
 
 /* This Thread ID means that the mutex is not in use (unlocked) */
 
-#define ACPI_MUTEX_NOT_ACQUIRED         (acpi_thread_id) 0
+#define ACPI_MUTEX_NOT_ACQUIRED         ((acpi_thread_id) 0)
 
 /* This Thread ID means an invalid thread ID */
 
-- 
1.7.10

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

* [PATCH 02/15] ACPICA: Remove incorrect "static" from a global structure
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:16   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit 7a9956a2afd3863fa7d9fe4a64a957389d09f3c2

Reported by Colin Ian King. ACPICA BZ 1239.

Link: https://github.com/acpica/acpica/commit/7a9956a2
Link: https://bugs.acpica.org/show_bug.cgi?id=1239
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/acpredef.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index 52f6bee..5faeab4 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -1125,7 +1125,7 @@ const union acpi_predefined_info acpi_gbl_resource_names[] = {
 	PACKAGE_INFO(0, 0, 0, 0, 0, 0)	/* Table terminator */
 };
 
-static const union acpi_predefined_info acpi_gbl_scope_names[] = {
+const union acpi_predefined_info acpi_gbl_scope_names[] = {
 	{{"_GPE", 0, 0}},
 	{{"_PR_", 0, 0}},
 	{{"_SB_", 0, 0}},
-- 
1.7.10

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

* [PATCH 02/15] ACPICA: Remove incorrect "static" from a global structure
@ 2016-02-19  6:16   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit 7a9956a2afd3863fa7d9fe4a64a957389d09f3c2

Reported by Colin Ian King. ACPICA BZ 1239.

Link: https://github.com/acpica/acpica/commit/7a9956a2
Link: https://bugs.acpica.org/show_bug.cgi?id=1239
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/acpredef.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index 52f6bee..5faeab4 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -1125,7 +1125,7 @@ const union acpi_predefined_info acpi_gbl_resource_names[] = {
 	PACKAGE_INFO(0, 0, 0, 0, 0, 0)	/* Table terminator */
 };
 
-static const union acpi_predefined_info acpi_gbl_scope_names[] = {
+const union acpi_predefined_info acpi_gbl_scope_names[] = {
 	{{"_GPE", 0, 0}},
 	{{"_PR_", 0, 0}},
 	{{"_SB_", 0, 0}},
-- 
1.7.10

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

* [PATCH 03/15] ACPICA: iASL: Fix some typos with the name strtoul64
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:16   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit e9622aa824e00997dc92e8638733b7553a4dba26

Was defined as stroul64 in some places.

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

diff --git a/drivers/acpi/acpica/utnonansi.c b/drivers/acpi/acpica/utnonansi.c
index c427a5c..d1f4a47 100644
--- a/drivers/acpi/acpica/utnonansi.c
+++ b/drivers/acpi/acpica/utnonansi.c
@@ -171,7 +171,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer)
 	u8 sign_of0x = 0;
 	u8 term = 0;
 
-	ACPI_FUNCTION_TRACE_STR(ut_stroul64, string);
+	ACPI_FUNCTION_TRACE_STR(ut_strtoul64, string);
 
 	switch (base) {
 	case ACPI_ANY_BASE:
-- 
1.7.10

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

* [PATCH 03/15] ACPICA: iASL: Fix some typos with the name strtoul64
@ 2016-02-19  6:16   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit e9622aa824e00997dc92e8638733b7553a4dba26

Was defined as stroul64 in some places.

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

diff --git a/drivers/acpi/acpica/utnonansi.c b/drivers/acpi/acpica/utnonansi.c
index c427a5c..d1f4a47 100644
--- a/drivers/acpi/acpica/utnonansi.c
+++ b/drivers/acpi/acpica/utnonansi.c
@@ -171,7 +171,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer)
 	u8 sign_of0x = 0;
 	u8 term = 0;
 
-	ACPI_FUNCTION_TRACE_STR(ut_stroul64, string);
+	ACPI_FUNCTION_TRACE_STR(ut_strtoul64, string);
 
 	switch (base) {
 	case ACPI_ANY_BASE:
-- 
1.7.10

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

* [PATCH 04/15] ACPICA: iASL: Update to use internal acpi_ut_strtoul64 function
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:16   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit e959584d23b520c53700e90282312d17b9603ed5

Was using a local Strtoul64, update to use the common acpi_ut_strtoul64
and remove the local Strtoul64.

Link: https://github.com/acpica/acpica/commit/e959584d
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/utnonansi.c |  244 +++++++++++++++++++++++++++++++++------
 1 file changed, 206 insertions(+), 38 deletions(-)

diff --git a/drivers/acpi/acpica/utnonansi.c b/drivers/acpi/acpica/utnonansi.c
index d1f4a47..d5c3adf 100644
--- a/drivers/acpi/acpica/utnonansi.c
+++ b/drivers/acpi/acpica/utnonansi.c
@@ -140,6 +140,67 @@ int acpi_ut_stricmp(char *string1, char *string2)
 	return (c1 - c2);
 }
 
+#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ut_safe_strcpy, acpi_ut_safe_strcat, acpi_ut_safe_strncat
+ *
+ * PARAMETERS:  Adds a "DestSize" parameter to each of the standard string
+ *              functions. This is the size of the Destination buffer.
+ *
+ * RETURN:      TRUE if the operation would overflow the destination buffer.
+ *
+ * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that
+ *              the result of the operation will not overflow the output string
+ *              buffer.
+ *
+ * NOTE:        These functions are typically only helpful for processing
+ *              user input and command lines. For most ACPICA code, the
+ *              required buffer length is precisely calculated before buffer
+ *              allocation, so the use of these functions is unnecessary.
+ *
+ ******************************************************************************/
+
+u8 acpi_ut_safe_strcpy(char *dest, acpi_size dest_size, char *source)
+{
+
+	if (strlen(source) >= dest_size) {
+		return (TRUE);
+	}
+
+	strcpy(dest, source);
+	return (FALSE);
+}
+
+u8 acpi_ut_safe_strcat(char *dest, acpi_size dest_size, char *source)
+{
+
+	if ((strlen(dest) + strlen(source)) >= dest_size) {
+		return (TRUE);
+	}
+
+	strcat(dest, source);
+	return (FALSE);
+}
+
+u8
+acpi_ut_safe_strncat(char *dest,
+		     acpi_size dest_size,
+		     char *source, acpi_size max_transfer_length)
+{
+	acpi_size actual_transfer_length;
+
+	actual_transfer_length = ACPI_MIN(max_transfer_length, strlen(source));
+
+	if ((strlen(dest) + actual_transfer_length) >= dest_size) {
+		return (TRUE);
+	}
+
+	strncat(dest, source, max_transfer_length);
+	return (FALSE);
+}
+#endif
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_strtoul64
@@ -155,7 +216,15 @@ int acpi_ut_stricmp(char *string1, char *string2)
  *              32-bit or 64-bit conversion, depending on the current mode
  *              of the interpreter.
  *
- * NOTE:        Does not support Octal strings, not needed.
+ * NOTES:       acpi_gbl_integer_byte_width should be set to the proper width.
+ *              For the core ACPICA code, this width depends on the DSDT
+ *              version. For iASL, the default byte width is always 8.
+ *
+ *              Does not support Octal strings, not needed at this time.
+ *
+ *              There is an earlier version of the function after this one,
+ *              below. It is slightly different than this one, and the two
+ *              may eventually may need to be merged. (01/2016).
  *
  ******************************************************************************/
 
@@ -318,63 +387,162 @@ error_exit:
 	}
 }
 
-#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
+#ifdef _OBSOLETE_FUNCTIONS
+/* TBD: use version in ACPICA main code base? */
+/* DONE: 01/2016 */
+
 /*******************************************************************************
  *
- * FUNCTION:    acpi_ut_safe_strcpy, acpi_ut_safe_strcat, acpi_ut_safe_strncat
+ * FUNCTION:    strtoul64
  *
- * PARAMETERS:  Adds a "DestSize" parameter to each of the standard string
- *              functions. This is the size of the Destination buffer.
+ * PARAMETERS:  string              - Null terminated string
+ *              terminater          - Where a pointer to the terminating byte
+ *                                    is returned
+ *              base                - Radix of the string
  *
- * RETURN:      TRUE if the operation would overflow the destination buffer.
+ * RETURN:      Converted value
  *
- * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that
- *              the result of the operation will not overflow the output string
- *              buffer.
- *
- * NOTE:        These functions are typically only helpful for processing
- *              user input and command lines. For most ACPICA code, the
- *              required buffer length is precisely calculated before buffer
- *              allocation, so the use of these functions is unnecessary.
+ * DESCRIPTION: Convert a string into an unsigned value.
  *
  ******************************************************************************/
 
-u8 acpi_ut_safe_strcpy(char *dest, acpi_size dest_size, char *source)
+acpi_status strtoul64(char *string, u32 base, u64 *ret_integer)
 {
+	u32 index;
+	u32 sign;
+	u64 return_value = 0;
+	acpi_status status = AE_OK;
 
-	if (strlen(source) >= dest_size) {
-		return (TRUE);
+	*ret_integer = 0;
+
+	switch (base) {
+	case 0:
+	case 8:
+	case 10:
+	case 16:
+
+		break;
+
+	default:
+		/*
+		 * The specified Base parameter is not in the domain of
+		 * this function:
+		 */
+		return (AE_BAD_PARAMETER);
 	}
 
-	strcpy(dest, source);
-	return (FALSE);
-}
+	/* Skip over any white space in the buffer: */
 
-u8 acpi_ut_safe_strcat(char *dest, acpi_size dest_size, char *source)
-{
+	while (isspace((int)*string) || *string == '\t') {
+		++string;
+	}
 
-	if ((strlen(dest) + strlen(source)) >= dest_size) {
-		return (TRUE);
+	/*
+	 * The buffer may contain an optional plus or minus sign.
+	 * If it does, then skip over it but remember what is was:
+	 */
+	if (*string == '-') {
+		sign = ACPI_SIGN_NEGATIVE;
+		++string;
+	} else if (*string == '+') {
+		++string;
+		sign = ACPI_SIGN_POSITIVE;
+	} else {
+		sign = ACPI_SIGN_POSITIVE;
 	}
 
-	strcat(dest, source);
-	return (FALSE);
-}
+	/*
+	 * If the input parameter Base is zero, then we need to
+	 * determine if it is octal, decimal, or hexadecimal:
+	 */
+	if (base == 0) {
+		if (*string == '0') {
+			if (tolower((int)*(++string)) == 'x') {
+				base = 16;
+				++string;
+			} else {
+				base = 8;
+			}
+		} else {
+			base = 10;
+		}
+	}
 
-u8
-acpi_ut_safe_strncat(char *dest,
-		     acpi_size dest_size,
-		     char *source, acpi_size max_transfer_length)
-{
-	acpi_size actual_transfer_length;
+	/*
+	 * For octal and hexadecimal bases, skip over the leading
+	 * 0 or 0x, if they are present.
+	 */
+	if (base == 8 && *string == '0') {
+		string++;
+	}
 
-	actual_transfer_length = ACPI_MIN(max_transfer_length, strlen(source));
+	if (base == 16 && *string == '0' && tolower((int)*(++string)) == 'x') {
+		string++;
+	}
 
-	if ((strlen(dest) + actual_transfer_length) >= dest_size) {
-		return (TRUE);
+	/* Main loop: convert the string to an unsigned long */
+
+	while (*string) {
+		if (isdigit((int)*string)) {
+			index = ((u8)*string) - '0';
+		} else {
+			index = (u8)toupper((int)*string);
+			if (isupper((int)index)) {
+				index = index - 'A' + 10;
+			} else {
+				goto error_exit;
+			}
+		}
+
+		if (index >= base) {
+			goto error_exit;
+		}
+
+		/* Check to see if value is out of range: */
+
+		if (return_value > ((ACPI_UINT64_MAX - (u64)index) / (u64)base)) {
+			goto error_exit;
+		} else {
+			return_value *= base;
+			return_value += index;
+		}
+
+		++string;
 	}
 
-	strncat(dest, source, max_transfer_length);
-	return (FALSE);
+	/* If a minus sign was present, then "the conversion is negated": */
+
+	if (sign == ACPI_SIGN_NEGATIVE) {
+		return_value = (ACPI_UINT32_MAX - return_value) + 1;
+	}
+
+	*ret_integer = return_value;
+	return (status);
+
+error_exit:
+	switch (base) {
+	case 8:
+
+		status = AE_BAD_OCTAL_CONSTANT;
+		break;
+
+	case 10:
+
+		status = AE_BAD_DECIMAL_CONSTANT;
+		break;
+
+	case 16:
+
+		status = AE_BAD_HEX_CONSTANT;
+		break;
+
+	default:
+
+		/* Base validated above */
+
+		break;
+	}
+
+	return (status);
 }
 #endif
-- 
1.7.10

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

* [PATCH 04/15] ACPICA: iASL: Update to use internal acpi_ut_strtoul64 function
@ 2016-02-19  6:16   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit e959584d23b520c53700e90282312d17b9603ed5

Was using a local Strtoul64, update to use the common acpi_ut_strtoul64
and remove the local Strtoul64.

Link: https://github.com/acpica/acpica/commit/e959584d
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/utnonansi.c |  244 +++++++++++++++++++++++++++++++++------
 1 file changed, 206 insertions(+), 38 deletions(-)

diff --git a/drivers/acpi/acpica/utnonansi.c b/drivers/acpi/acpica/utnonansi.c
index d1f4a47..d5c3adf 100644
--- a/drivers/acpi/acpica/utnonansi.c
+++ b/drivers/acpi/acpica/utnonansi.c
@@ -140,6 +140,67 @@ int acpi_ut_stricmp(char *string1, char *string2)
 	return (c1 - c2);
 }
 
+#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ut_safe_strcpy, acpi_ut_safe_strcat, acpi_ut_safe_strncat
+ *
+ * PARAMETERS:  Adds a "DestSize" parameter to each of the standard string
+ *              functions. This is the size of the Destination buffer.
+ *
+ * RETURN:      TRUE if the operation would overflow the destination buffer.
+ *
+ * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that
+ *              the result of the operation will not overflow the output string
+ *              buffer.
+ *
+ * NOTE:        These functions are typically only helpful for processing
+ *              user input and command lines. For most ACPICA code, the
+ *              required buffer length is precisely calculated before buffer
+ *              allocation, so the use of these functions is unnecessary.
+ *
+ ******************************************************************************/
+
+u8 acpi_ut_safe_strcpy(char *dest, acpi_size dest_size, char *source)
+{
+
+	if (strlen(source) >= dest_size) {
+		return (TRUE);
+	}
+
+	strcpy(dest, source);
+	return (FALSE);
+}
+
+u8 acpi_ut_safe_strcat(char *dest, acpi_size dest_size, char *source)
+{
+
+	if ((strlen(dest) + strlen(source)) >= dest_size) {
+		return (TRUE);
+	}
+
+	strcat(dest, source);
+	return (FALSE);
+}
+
+u8
+acpi_ut_safe_strncat(char *dest,
+		     acpi_size dest_size,
+		     char *source, acpi_size max_transfer_length)
+{
+	acpi_size actual_transfer_length;
+
+	actual_transfer_length = ACPI_MIN(max_transfer_length, strlen(source));
+
+	if ((strlen(dest) + actual_transfer_length) >= dest_size) {
+		return (TRUE);
+	}
+
+	strncat(dest, source, max_transfer_length);
+	return (FALSE);
+}
+#endif
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_strtoul64
@@ -155,7 +216,15 @@ int acpi_ut_stricmp(char *string1, char *string2)
  *              32-bit or 64-bit conversion, depending on the current mode
  *              of the interpreter.
  *
- * NOTE:        Does not support Octal strings, not needed.
+ * NOTES:       acpi_gbl_integer_byte_width should be set to the proper width.
+ *              For the core ACPICA code, this width depends on the DSDT
+ *              version. For iASL, the default byte width is always 8.
+ *
+ *              Does not support Octal strings, not needed at this time.
+ *
+ *              There is an earlier version of the function after this one,
+ *              below. It is slightly different than this one, and the two
+ *              may eventually may need to be merged. (01/2016).
  *
  ******************************************************************************/
 
@@ -318,63 +387,162 @@ error_exit:
 	}
 }
 
-#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
+#ifdef _OBSOLETE_FUNCTIONS
+/* TBD: use version in ACPICA main code base? */
+/* DONE: 01/2016 */
+
 /*******************************************************************************
  *
- * FUNCTION:    acpi_ut_safe_strcpy, acpi_ut_safe_strcat, acpi_ut_safe_strncat
+ * FUNCTION:    strtoul64
  *
- * PARAMETERS:  Adds a "DestSize" parameter to each of the standard string
- *              functions. This is the size of the Destination buffer.
+ * PARAMETERS:  string              - Null terminated string
+ *              terminater          - Where a pointer to the terminating byte
+ *                                    is returned
+ *              base                - Radix of the string
  *
- * RETURN:      TRUE if the operation would overflow the destination buffer.
+ * RETURN:      Converted value
  *
- * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that
- *              the result of the operation will not overflow the output string
- *              buffer.
- *
- * NOTE:        These functions are typically only helpful for processing
- *              user input and command lines. For most ACPICA code, the
- *              required buffer length is precisely calculated before buffer
- *              allocation, so the use of these functions is unnecessary.
+ * DESCRIPTION: Convert a string into an unsigned value.
  *
  ******************************************************************************/
 
-u8 acpi_ut_safe_strcpy(char *dest, acpi_size dest_size, char *source)
+acpi_status strtoul64(char *string, u32 base, u64 *ret_integer)
 {
+	u32 index;
+	u32 sign;
+	u64 return_value = 0;
+	acpi_status status = AE_OK;
 
-	if (strlen(source) >= dest_size) {
-		return (TRUE);
+	*ret_integer = 0;
+
+	switch (base) {
+	case 0:
+	case 8:
+	case 10:
+	case 16:
+
+		break;
+
+	default:
+		/*
+		 * The specified Base parameter is not in the domain of
+		 * this function:
+		 */
+		return (AE_BAD_PARAMETER);
 	}
 
-	strcpy(dest, source);
-	return (FALSE);
-}
+	/* Skip over any white space in the buffer: */
 
-u8 acpi_ut_safe_strcat(char *dest, acpi_size dest_size, char *source)
-{
+	while (isspace((int)*string) || *string == '\t') {
+		++string;
+	}
 
-	if ((strlen(dest) + strlen(source)) >= dest_size) {
-		return (TRUE);
+	/*
+	 * The buffer may contain an optional plus or minus sign.
+	 * If it does, then skip over it but remember what is was:
+	 */
+	if (*string == '-') {
+		sign = ACPI_SIGN_NEGATIVE;
+		++string;
+	} else if (*string == '+') {
+		++string;
+		sign = ACPI_SIGN_POSITIVE;
+	} else {
+		sign = ACPI_SIGN_POSITIVE;
 	}
 
-	strcat(dest, source);
-	return (FALSE);
-}
+	/*
+	 * If the input parameter Base is zero, then we need to
+	 * determine if it is octal, decimal, or hexadecimal:
+	 */
+	if (base == 0) {
+		if (*string == '0') {
+			if (tolower((int)*(++string)) == 'x') {
+				base = 16;
+				++string;
+			} else {
+				base = 8;
+			}
+		} else {
+			base = 10;
+		}
+	}
 
-u8
-acpi_ut_safe_strncat(char *dest,
-		     acpi_size dest_size,
-		     char *source, acpi_size max_transfer_length)
-{
-	acpi_size actual_transfer_length;
+	/*
+	 * For octal and hexadecimal bases, skip over the leading
+	 * 0 or 0x, if they are present.
+	 */
+	if (base == 8 && *string == '0') {
+		string++;
+	}
 
-	actual_transfer_length = ACPI_MIN(max_transfer_length, strlen(source));
+	if (base == 16 && *string == '0' && tolower((int)*(++string)) == 'x') {
+		string++;
+	}
 
-	if ((strlen(dest) + actual_transfer_length) >= dest_size) {
-		return (TRUE);
+	/* Main loop: convert the string to an unsigned long */
+
+	while (*string) {
+		if (isdigit((int)*string)) {
+			index = ((u8)*string) - '0';
+		} else {
+			index = (u8)toupper((int)*string);
+			if (isupper((int)index)) {
+				index = index - 'A' + 10;
+			} else {
+				goto error_exit;
+			}
+		}
+
+		if (index >= base) {
+			goto error_exit;
+		}
+
+		/* Check to see if value is out of range: */
+
+		if (return_value > ((ACPI_UINT64_MAX - (u64)index) / (u64)base)) {
+			goto error_exit;
+		} else {
+			return_value *= base;
+			return_value += index;
+		}
+
+		++string;
 	}
 
-	strncat(dest, source, max_transfer_length);
-	return (FALSE);
+	/* If a minus sign was present, then "the conversion is negated": */
+
+	if (sign == ACPI_SIGN_NEGATIVE) {
+		return_value = (ACPI_UINT32_MAX - return_value) + 1;
+	}
+
+	*ret_integer = return_value;
+	return (status);
+
+error_exit:
+	switch (base) {
+	case 8:
+
+		status = AE_BAD_OCTAL_CONSTANT;
+		break;
+
+	case 10:
+
+		status = AE_BAD_DECIMAL_CONSTANT;
+		break;
+
+	case 16:
+
+		status = AE_BAD_HEX_CONSTANT;
+		break;
+
+	default:
+
+		/* Base validated above */
+
+		break;
+	}
+
+	return (status);
 }
 #endif
-- 
1.7.10

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

* [PATCH 05/15] ACPICA: debugger: dbconvert: free pld_info on error return path
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:16   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Colin Ian King, Bob Moore

From: Colin Ian King <colin.king@canonical.com>

ACPICA commit 23e644670539e23818fa81e2af5e89ad6657e75c

A failed allocation of new_buffer causes a leak of pld_info
because the error return path fails to free pld_info. Ensure
it is freed on the error exit path.

Link: https://github.com/acpica/acpica/commit/23e64467
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/dbconvert.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/dbconvert.c b/drivers/acpi/acpica/dbconvert.c
index 9fee88f..68f4e0f4 100644
--- a/drivers/acpi/acpica/dbconvert.c
+++ b/drivers/acpi/acpica/dbconvert.c
@@ -408,7 +408,7 @@ void acpi_db_dump_pld_buffer(union acpi_object *obj_desc)
 
 	new_buffer = acpi_db_encode_pld_buffer(pld_info);
 	if (!new_buffer) {
-		return;
+		goto exit;
 	}
 
 	/* The two bit-packed buffers should match */
@@ -479,6 +479,7 @@ void acpi_db_dump_pld_buffer(union acpi_object *obj_desc)
 			       pld_info->horizontal_offset);
 	}
 
-	ACPI_FREE(pld_info);
 	ACPI_FREE(new_buffer);
+exit:
+	ACPI_FREE(pld_info);
 }
-- 
1.7.10

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

* [PATCH 05/15] ACPICA: debugger: dbconvert: free pld_info on error return path
@ 2016-02-19  6:16   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Colin Ian King, Bob Moore

From: Colin Ian King <colin.king@canonical.com>

ACPICA commit 23e644670539e23818fa81e2af5e89ad6657e75c

A failed allocation of new_buffer causes a leak of pld_info
because the error return path fails to free pld_info. Ensure
it is freed on the error exit path.

Link: https://github.com/acpica/acpica/commit/23e64467
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/dbconvert.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/dbconvert.c b/drivers/acpi/acpica/dbconvert.c
index 9fee88f..68f4e0f4 100644
--- a/drivers/acpi/acpica/dbconvert.c
+++ b/drivers/acpi/acpica/dbconvert.c
@@ -408,7 +408,7 @@ void acpi_db_dump_pld_buffer(union acpi_object *obj_desc)
 
 	new_buffer = acpi_db_encode_pld_buffer(pld_info);
 	if (!new_buffer) {
-		return;
+		goto exit;
 	}
 
 	/* The two bit-packed buffers should match */
@@ -479,6 +479,7 @@ void acpi_db_dump_pld_buffer(union acpi_object *obj_desc)
 			       pld_info->horizontal_offset);
 	}
 
-	ACPI_FREE(pld_info);
 	ACPI_FREE(new_buffer);
+exit:
+	ACPI_FREE(pld_info);
 }
-- 
1.7.10

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

* [PATCH 06/15] ACPICA: Remove unnecessary arguments to ACPI_INFO
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:16   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit 181f56605a771e0b91e24b0648d2565ca70bea20

This is used as a purely infomation message, without module name
and line number information. Therefore, these arguments are
not needed and they are unnecessary overhead.
Arguments are removed.
ACPICA BZ 872.

Link: https://github.com/acpica/acpica/commit/181f5660
Link: https://bugs.acpica.org/show_bug.cgi?id=872
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/dbcmds.c    |    2 +-
 drivers/acpi/acpica/dsmethod.c  |    3 +--
 drivers/acpi/acpica/dsobject.c  |    3 +--
 drivers/acpi/acpica/evgpeblk.c  |    3 +--
 drivers/acpi/acpica/evgpeinit.c |    2 +-
 drivers/acpi/acpica/exconfig.c  |    4 ++--
 drivers/acpi/acpica/nseval.c    |    3 +--
 drivers/acpi/acpica/tbinstal.c  |    5 ++---
 drivers/acpi/acpica/tbprint.c   |    7 +++----
 drivers/acpi/acpica/tbutils.c   |    4 +---
 drivers/acpi/acpica/tbxfload.c  |    6 ++----
 drivers/acpi/acpica/uttrack.c   |    2 +-
 drivers/acpi/acpica/utxferror.c |    3 +--
 include/acpi/acpixf.h           |    6 ++----
 14 files changed, 20 insertions(+), 33 deletions(-)

diff --git a/drivers/acpi/acpica/dbcmds.c b/drivers/acpi/acpica/dbcmds.c
index 7ec62c4..772178c 100644
--- a/drivers/acpi/acpica/dbcmds.c
+++ b/drivers/acpi/acpica/dbcmds.c
@@ -348,7 +348,7 @@ void acpi_db_display_table_info(char *table_arg)
 		} else {
 			/* If the pointer is null, the table has been unloaded */
 
-			ACPI_INFO((AE_INFO, "%4.4s - Table has been unloaded",
+			ACPI_INFO(("%4.4s - Table has been unloaded",
 				   table_desc->signature.ascii));
 		}
 	}
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 6a72047..1982310 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -809,8 +809,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 		if (method_desc->method.
 		    info_flags & ACPI_METHOD_SERIALIZED_PENDING) {
 			if (walk_state) {
-				ACPI_INFO((AE_INFO,
-					   "Marking method %4.4s as Serialized "
+				ACPI_INFO(("Marking method %4.4s as Serialized "
 					   "because of AE_ALREADY_EXISTS error",
 					   walk_state->method_node->name.
 					   ascii));
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c
index c303e9d..a91de2b 100644
--- a/drivers/acpi/acpica/dsobject.c
+++ b/drivers/acpi/acpica/dsobject.c
@@ -524,8 +524,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 			arg = arg->common.next;
 		}
 
-		ACPI_INFO((AE_INFO,
-			   "Actual Package length (%u) is larger than "
+		ACPI_INFO(("Actual Package length (%u) is larger than "
 			   "NumElements field (%u), truncated",
 			   i, element_count));
 	} else if (i < element_count) {
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index 9275e62..447fa1c 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -499,8 +499,7 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
 	}
 
 	if (gpe_enabled_count) {
-		ACPI_INFO((AE_INFO,
-			   "Enabled %u GPEs in block %02X to %02X",
+		ACPI_INFO(("Enabled %u GPEs in block %02X to %02X",
 			   gpe_enabled_count, (u32)gpe_block->block_base_number,
 			   (u32)(gpe_block->block_base_number +
 				 (gpe_block->gpe_count - 1))));
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index 9fdd8d0..7dc7547 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -281,7 +281,7 @@ void acpi_ev_update_gpes(acpi_owner_id table_owner_id)
 	}
 
 	if (walk_info.count) {
-		ACPI_INFO((AE_INFO, "Enabled %u new GPEs", walk_info.count));
+		ACPI_INFO(("Enabled %u new GPEs", walk_info.count));
 	}
 
 	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 011df21..f741613 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -252,7 +252,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
 
 	status = acpi_get_table_by_index(table_index, &table);
 	if (ACPI_SUCCESS(status)) {
-		ACPI_INFO((AE_INFO, "Dynamic OEM Table Load:"));
+		ACPI_INFO(("Dynamic OEM Table Load:"));
 		acpi_tb_print_table_header(0, table);
 	}
 
@@ -472,7 +472,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 
 	/* Install the new table into the local data structures */
 
-	ACPI_INFO((AE_INFO, "Dynamic OEM Table Load:"));
+	ACPI_INFO(("Dynamic OEM Table Load:"));
 	(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
 
 	status = acpi_tb_install_standard_table(ACPI_PTR_TO_PHYSADDR(table),
diff --git a/drivers/acpi/acpica/nseval.c b/drivers/acpi/acpica/nseval.c
index 65d58be..5d59cfc 100644
--- a/drivers/acpi/acpica/nseval.c
+++ b/drivers/acpi/acpica/nseval.c
@@ -378,8 +378,7 @@ void acpi_ns_exec_module_code_list(void)
 		acpi_ut_remove_reference(prev);
 	}
 
-	ACPI_INFO((AE_INFO,
-		   "Executed %u blocks of module-level executable AML code",
+	ACPI_INFO(("Executed %u blocks of module-level executable AML code",
 		   method_count));
 
 	ACPI_FREE(info);
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index b661a1e..4dc6108 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -267,8 +267,7 @@ acpi_tb_install_standard_table(acpi_physical_address address,
 	if (!reload &&
 	    acpi_gbl_disable_ssdt_table_install &&
 	    ACPI_COMPARE_NAME(&new_table_desc.signature, ACPI_SIG_SSDT)) {
-		ACPI_INFO((AE_INFO,
-			   "Ignoring installation of %4.4s at %8.8X%8.8X",
+		ACPI_INFO(("Ignoring installation of %4.4s at %8.8X%8.8X",
 			   new_table_desc.signature.ascii,
 			   ACPI_FORMAT_UINT64(address)));
 		goto release_and_exit;
@@ -432,7 +431,7 @@ finish_override:
 		return;
 	}
 
-	ACPI_INFO((AE_INFO, "%4.4s 0x%8.8X%8.8X"
+	ACPI_INFO(("%4.4s 0x%8.8X%8.8X"
 		   " %s table override, new table: 0x%8.8X%8.8X",
 		   old_table_desc->signature.ascii,
 		   ACPI_FORMAT_UINT64(old_table_desc->address),
diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
index fd4146d..26d61db 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -132,7 +132,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
 
 		/* FACS only has signature and length fields */
 
-		ACPI_INFO((AE_INFO, "%-4.4s 0x%8.8X%8.8X %06X",
+		ACPI_INFO(("%-4.4s 0x%8.8X%8.8X %06X",
 			   header->signature, ACPI_FORMAT_UINT64(address),
 			   header->length));
 	} else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) {
@@ -144,7 +144,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
 		       ACPI_OEM_ID_SIZE);
 		acpi_tb_fix_string(local_header.oem_id, ACPI_OEM_ID_SIZE);
 
-		ACPI_INFO((AE_INFO, "RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
+		ACPI_INFO(("RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
 			   ACPI_FORMAT_UINT64(address),
 			   (ACPI_CAST_PTR(struct acpi_table_rsdp, header)->
 			    revision >
@@ -158,8 +158,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
 
 		acpi_tb_cleanup_table_header(&local_header, header);
 
-		ACPI_INFO((AE_INFO,
-			   "%-4.4s 0x%8.8X%8.8X"
+		ACPI_INFO(("%-4.4s 0x%8.8X%8.8X"
 			   " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
 			   local_header.signature, ACPI_FORMAT_UINT64(address),
 			   local_header.length, local_header.revision,
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 3269bef..9240c76 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -174,9 +174,7 @@ struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index)
 				      ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
 				      new_table);
 
-	ACPI_INFO((AE_INFO,
-		   "Forced DSDT copy: length 0x%05X copied locally, original unmapped",
-		   new_table->length));
+	ACPI_INFO(("Forced DSDT copy: length 0x%05X copied locally, original unmapped", new_table->length));
 
 	return (new_table);
 }
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index 278666e..c89943b 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -206,9 +206,7 @@ acpi_status acpi_tb_load_namespace(void)
 	}
 
 	if (!tables_failed) {
-		ACPI_INFO((AE_INFO,
-			   "%u ACPI AML tables successfully acquired and loaded\n",
-			   tables_loaded));
+		ACPI_INFO(("%u ACPI AML tables successfully acquired and loaded\n", tables_loaded));
 	} else {
 		ACPI_ERROR((AE_INFO,
 			    "%u table load failures, %u successful",
@@ -301,7 +299,7 @@ acpi_status acpi_load_table(struct acpi_table_header *table)
 
 	/* Install the table and load it into the namespace */
 
-	ACPI_INFO((AE_INFO, "Host-directed Dynamic ACPI Table Load:"));
+	ACPI_INFO(("Host-directed Dynamic ACPI Table Load:"));
 	(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
 
 	status = acpi_tb_install_standard_table(ACPI_PTR_TO_PHYSADDR(table),
diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c
index c7c2bb8..60c406a 100644
--- a/drivers/acpi/acpica/uttrack.c
+++ b/drivers/acpi/acpica/uttrack.c
@@ -712,7 +712,7 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
 	/* Print summary */
 
 	if (!num_outstanding) {
-		ACPI_INFO((AE_INFO, "No outstanding allocations"));
+		ACPI_INFO(("No outstanding allocations"));
 	} else {
 		ACPI_ERROR((AE_INFO, "%u(0x%X) Outstanding allocations",
 			    num_outstanding, num_outstanding));
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c
index 6fe5959..d9f15cb 100644
--- a/drivers/acpi/acpica/utxferror.c
+++ b/drivers/acpi/acpica/utxferror.c
@@ -175,8 +175,7 @@ ACPI_EXPORT_SYMBOL(acpi_warning)
  * TBD: module_name and line_number args are not needed, should be removed.
  *
  ******************************************************************************/
-void ACPI_INTERNAL_VAR_XFACE
-acpi_info(const char *module_name, u32 line_number, const char *format, ...)
+void ACPI_INTERNAL_VAR_XFACE acpi_info(const char *format, ...)
 {
 	va_list arg_list;
 
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index c96621e..1755697 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -897,11 +897,9 @@ ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
 				acpi_warning(const char *module_name,
 					     u32 line_number,
 					     const char *format, ...))
-ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
+ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
 				void ACPI_INTERNAL_VAR_XFACE
-				acpi_info(const char *module_name,
-					  u32 line_number,
-					  const char *format, ...))
+				acpi_info(const char *format, ...))
 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
 				void ACPI_INTERNAL_VAR_XFACE
 				acpi_bios_error(const char *module_name,
-- 
1.7.10

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

* [PATCH 06/15] ACPICA: Remove unnecessary arguments to ACPI_INFO
@ 2016-02-19  6:16   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit 181f56605a771e0b91e24b0648d2565ca70bea20

This is used as a purely infomation message, without module name
and line number information. Therefore, these arguments are
not needed and they are unnecessary overhead.
Arguments are removed.
ACPICA BZ 872.

Link: https://github.com/acpica/acpica/commit/181f5660
Link: https://bugs.acpica.org/show_bug.cgi?id=872
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/dbcmds.c    |    2 +-
 drivers/acpi/acpica/dsmethod.c  |    3 +--
 drivers/acpi/acpica/dsobject.c  |    3 +--
 drivers/acpi/acpica/evgpeblk.c  |    3 +--
 drivers/acpi/acpica/evgpeinit.c |    2 +-
 drivers/acpi/acpica/exconfig.c  |    4 ++--
 drivers/acpi/acpica/nseval.c    |    3 +--
 drivers/acpi/acpica/tbinstal.c  |    5 ++---
 drivers/acpi/acpica/tbprint.c   |    7 +++----
 drivers/acpi/acpica/tbutils.c   |    4 +---
 drivers/acpi/acpica/tbxfload.c  |    6 ++----
 drivers/acpi/acpica/uttrack.c   |    2 +-
 drivers/acpi/acpica/utxferror.c |    3 +--
 include/acpi/acpixf.h           |    6 ++----
 14 files changed, 20 insertions(+), 33 deletions(-)

diff --git a/drivers/acpi/acpica/dbcmds.c b/drivers/acpi/acpica/dbcmds.c
index 7ec62c4..772178c 100644
--- a/drivers/acpi/acpica/dbcmds.c
+++ b/drivers/acpi/acpica/dbcmds.c
@@ -348,7 +348,7 @@ void acpi_db_display_table_info(char *table_arg)
 		} else {
 			/* If the pointer is null, the table has been unloaded */
 
-			ACPI_INFO((AE_INFO, "%4.4s - Table has been unloaded",
+			ACPI_INFO(("%4.4s - Table has been unloaded",
 				   table_desc->signature.ascii));
 		}
 	}
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 6a72047..1982310 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -809,8 +809,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 		if (method_desc->method.
 		    info_flags & ACPI_METHOD_SERIALIZED_PENDING) {
 			if (walk_state) {
-				ACPI_INFO((AE_INFO,
-					   "Marking method %4.4s as Serialized "
+				ACPI_INFO(("Marking method %4.4s as Serialized "
 					   "because of AE_ALREADY_EXISTS error",
 					   walk_state->method_node->name.
 					   ascii));
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c
index c303e9d..a91de2b 100644
--- a/drivers/acpi/acpica/dsobject.c
+++ b/drivers/acpi/acpica/dsobject.c
@@ -524,8 +524,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 			arg = arg->common.next;
 		}
 
-		ACPI_INFO((AE_INFO,
-			   "Actual Package length (%u) is larger than "
+		ACPI_INFO(("Actual Package length (%u) is larger than "
 			   "NumElements field (%u), truncated",
 			   i, element_count));
 	} else if (i < element_count) {
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index 9275e62..447fa1c 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -499,8 +499,7 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
 	}
 
 	if (gpe_enabled_count) {
-		ACPI_INFO((AE_INFO,
-			   "Enabled %u GPEs in block %02X to %02X",
+		ACPI_INFO(("Enabled %u GPEs in block %02X to %02X",
 			   gpe_enabled_count, (u32)gpe_block->block_base_number,
 			   (u32)(gpe_block->block_base_number +
 				 (gpe_block->gpe_count - 1))));
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index 9fdd8d0..7dc7547 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -281,7 +281,7 @@ void acpi_ev_update_gpes(acpi_owner_id table_owner_id)
 	}
 
 	if (walk_info.count) {
-		ACPI_INFO((AE_INFO, "Enabled %u new GPEs", walk_info.count));
+		ACPI_INFO(("Enabled %u new GPEs", walk_info.count));
 	}
 
 	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 011df21..f741613 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -252,7 +252,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
 
 	status = acpi_get_table_by_index(table_index, &table);
 	if (ACPI_SUCCESS(status)) {
-		ACPI_INFO((AE_INFO, "Dynamic OEM Table Load:"));
+		ACPI_INFO(("Dynamic OEM Table Load:"));
 		acpi_tb_print_table_header(0, table);
 	}
 
@@ -472,7 +472,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 
 	/* Install the new table into the local data structures */
 
-	ACPI_INFO((AE_INFO, "Dynamic OEM Table Load:"));
+	ACPI_INFO(("Dynamic OEM Table Load:"));
 	(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
 
 	status = acpi_tb_install_standard_table(ACPI_PTR_TO_PHYSADDR(table),
diff --git a/drivers/acpi/acpica/nseval.c b/drivers/acpi/acpica/nseval.c
index 65d58be..5d59cfc 100644
--- a/drivers/acpi/acpica/nseval.c
+++ b/drivers/acpi/acpica/nseval.c
@@ -378,8 +378,7 @@ void acpi_ns_exec_module_code_list(void)
 		acpi_ut_remove_reference(prev);
 	}
 
-	ACPI_INFO((AE_INFO,
-		   "Executed %u blocks of module-level executable AML code",
+	ACPI_INFO(("Executed %u blocks of module-level executable AML code",
 		   method_count));
 
 	ACPI_FREE(info);
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index b661a1e..4dc6108 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -267,8 +267,7 @@ acpi_tb_install_standard_table(acpi_physical_address address,
 	if (!reload &&
 	    acpi_gbl_disable_ssdt_table_install &&
 	    ACPI_COMPARE_NAME(&new_table_desc.signature, ACPI_SIG_SSDT)) {
-		ACPI_INFO((AE_INFO,
-			   "Ignoring installation of %4.4s at %8.8X%8.8X",
+		ACPI_INFO(("Ignoring installation of %4.4s at %8.8X%8.8X",
 			   new_table_desc.signature.ascii,
 			   ACPI_FORMAT_UINT64(address)));
 		goto release_and_exit;
@@ -432,7 +431,7 @@ finish_override:
 		return;
 	}
 
-	ACPI_INFO((AE_INFO, "%4.4s 0x%8.8X%8.8X"
+	ACPI_INFO(("%4.4s 0x%8.8X%8.8X"
 		   " %s table override, new table: 0x%8.8X%8.8X",
 		   old_table_desc->signature.ascii,
 		   ACPI_FORMAT_UINT64(old_table_desc->address),
diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
index fd4146d..26d61db 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -132,7 +132,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
 
 		/* FACS only has signature and length fields */
 
-		ACPI_INFO((AE_INFO, "%-4.4s 0x%8.8X%8.8X %06X",
+		ACPI_INFO(("%-4.4s 0x%8.8X%8.8X %06X",
 			   header->signature, ACPI_FORMAT_UINT64(address),
 			   header->length));
 	} else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) {
@@ -144,7 +144,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
 		       ACPI_OEM_ID_SIZE);
 		acpi_tb_fix_string(local_header.oem_id, ACPI_OEM_ID_SIZE);
 
-		ACPI_INFO((AE_INFO, "RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
+		ACPI_INFO(("RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
 			   ACPI_FORMAT_UINT64(address),
 			   (ACPI_CAST_PTR(struct acpi_table_rsdp, header)->
 			    revision >
@@ -158,8 +158,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
 
 		acpi_tb_cleanup_table_header(&local_header, header);
 
-		ACPI_INFO((AE_INFO,
-			   "%-4.4s 0x%8.8X%8.8X"
+		ACPI_INFO(("%-4.4s 0x%8.8X%8.8X"
 			   " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
 			   local_header.signature, ACPI_FORMAT_UINT64(address),
 			   local_header.length, local_header.revision,
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 3269bef..9240c76 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -174,9 +174,7 @@ struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index)
 				      ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
 				      new_table);
 
-	ACPI_INFO((AE_INFO,
-		   "Forced DSDT copy: length 0x%05X copied locally, original unmapped",
-		   new_table->length));
+	ACPI_INFO(("Forced DSDT copy: length 0x%05X copied locally, original unmapped", new_table->length));
 
 	return (new_table);
 }
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index 278666e..c89943b 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -206,9 +206,7 @@ acpi_status acpi_tb_load_namespace(void)
 	}
 
 	if (!tables_failed) {
-		ACPI_INFO((AE_INFO,
-			   "%u ACPI AML tables successfully acquired and loaded\n",
-			   tables_loaded));
+		ACPI_INFO(("%u ACPI AML tables successfully acquired and loaded\n", tables_loaded));
 	} else {
 		ACPI_ERROR((AE_INFO,
 			    "%u table load failures, %u successful",
@@ -301,7 +299,7 @@ acpi_status acpi_load_table(struct acpi_table_header *table)
 
 	/* Install the table and load it into the namespace */
 
-	ACPI_INFO((AE_INFO, "Host-directed Dynamic ACPI Table Load:"));
+	ACPI_INFO(("Host-directed Dynamic ACPI Table Load:"));
 	(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
 
 	status = acpi_tb_install_standard_table(ACPI_PTR_TO_PHYSADDR(table),
diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c
index c7c2bb8..60c406a 100644
--- a/drivers/acpi/acpica/uttrack.c
+++ b/drivers/acpi/acpica/uttrack.c
@@ -712,7 +712,7 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
 	/* Print summary */
 
 	if (!num_outstanding) {
-		ACPI_INFO((AE_INFO, "No outstanding allocations"));
+		ACPI_INFO(("No outstanding allocations"));
 	} else {
 		ACPI_ERROR((AE_INFO, "%u(0x%X) Outstanding allocations",
 			    num_outstanding, num_outstanding));
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c
index 6fe5959..d9f15cb 100644
--- a/drivers/acpi/acpica/utxferror.c
+++ b/drivers/acpi/acpica/utxferror.c
@@ -175,8 +175,7 @@ ACPI_EXPORT_SYMBOL(acpi_warning)
  * TBD: module_name and line_number args are not needed, should be removed.
  *
  ******************************************************************************/
-void ACPI_INTERNAL_VAR_XFACE
-acpi_info(const char *module_name, u32 line_number, const char *format, ...)
+void ACPI_INTERNAL_VAR_XFACE acpi_info(const char *format, ...)
 {
 	va_list arg_list;
 
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index c96621e..1755697 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -897,11 +897,9 @@ ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
 				acpi_warning(const char *module_name,
 					     u32 line_number,
 					     const char *format, ...))
-ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
+ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
 				void ACPI_INTERNAL_VAR_XFACE
-				acpi_info(const char *module_name,
-					  u32 line_number,
-					  const char *format, ...))
+				acpi_info(const char *format, ...))
 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
 				void ACPI_INTERNAL_VAR_XFACE
 				acpi_bios_error(const char *module_name,
-- 
1.7.10

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

* [PATCH 07/15] ACPICA: ACPI 6.0/iASL: Add support for the External AML opcode
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:16   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, David E. Box, Bob Moore

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

ACPICA commit 882892feeafe8b8e5be10463133405cd4f1309d9

Support for both the compiler and disassembler.
Also, the interpreter will ignore this opcode if it
is ever encountered (should not happen).
David Box.

Link: https://github.com/acpica/acpica/commit/882892fe
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/exoparg3.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/exoparg3.c b/drivers/acpi/acpica/exoparg3.c
index 28eb861..5aa21c4 100644
--- a/drivers/acpi/acpica/exoparg3.c
+++ b/drivers/acpi/acpica/exoparg3.c
@@ -123,8 +123,10 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
 		 * op is intended for use by disassemblers in order to properly
 		 * disassemble control method invocations. The opcode or group of
 		 * opcodes should be surrounded by an "if (0)" clause to ensure that
-		 * AML interpreters never see the opcode.
+		 * AML interpreters never see the opcode. Thus, something is
+		 * wrong if an external opcode ever gets here.
 		 */
+		ACPI_ERROR((AE_INFO, "Executed External Op"));
 		status = AE_OK;
 		goto cleanup;
 
-- 
1.7.10

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

* [PATCH 07/15] ACPICA: ACPI 6.0/iASL: Add support for the External AML opcode
@ 2016-02-19  6:16   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, David E. Box, Bob Moore

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

ACPICA commit 882892feeafe8b8e5be10463133405cd4f1309d9

Support for both the compiler and disassembler.
Also, the interpreter will ignore this opcode if it
is ever encountered (should not happen).
David Box.

Link: https://github.com/acpica/acpica/commit/882892fe
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/exoparg3.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/exoparg3.c b/drivers/acpi/acpica/exoparg3.c
index 28eb861..5aa21c4 100644
--- a/drivers/acpi/acpica/exoparg3.c
+++ b/drivers/acpi/acpica/exoparg3.c
@@ -123,8 +123,10 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
 		 * op is intended for use by disassemblers in order to properly
 		 * disassemble control method invocations. The opcode or group of
 		 * opcodes should be surrounded by an "if (0)" clause to ensure that
-		 * AML interpreters never see the opcode.
+		 * AML interpreters never see the opcode. Thus, something is
+		 * wrong if an external opcode ever gets here.
 		 */
+		ACPI_ERROR((AE_INFO, "Executed External Op"));
 		status = AE_OK;
 		goto cleanup;
 
-- 
1.7.10

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

* [PATCH 08/15] ACPICA: Tables: make default region accessible during the table load
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:16   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

ACPICA commit 016b2a0917cca9cf0d40c38a1541017d9cf569dd

It is proven that the default regions should be accessible during the
table loading in order to execute module level AML code.
This patch moves default region handler installation code earlier in
order to make this happen.
Note that by putting the code here, we actually allow OSPMs to override
default region handlers between acpi_initialize_subsystem() and
acpi_load_tables(), without the need to introduce region handler override
mechanism in acpi_install_address_space_handler(). OSPMs are also couraged
to check acpi_install_address_space_handler() return value to determine if
acpi_remove_address_space_handler() should be invoked before installing new
address space handler. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/016b2a09
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/tbxfload.c |   22 ++++++++++++++++++++++
 drivers/acpi/acpica/utxfinit.c |   12 +++++++-----
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index c89943b..9496b84 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -47,6 +47,7 @@
 #include "accommon.h"
 #include "acnamesp.h"
 #include "actables.h"
+#include "acevents.h"
 
 #define _COMPONENT          ACPI_TABLES
 ACPI_MODULE_NAME("tbxfload")
@@ -68,6 +69,27 @@ acpi_status __init acpi_load_tables(void)
 
 	ACPI_FUNCTION_TRACE(acpi_load_tables);
 
+	/*
+	 * Install the default operation region handlers. These are the
+	 * handlers that are defined by the ACPI specification to be
+	 * "always accessible" -- namely, system_memory, system_IO, and
+	 * PCI_Config. This also means that no _REG methods need to be
+	 * run for these address spaces. We need to have these handlers
+	 * installed before any AML code can be executed, especially any
+	 * module-level code (11/2015).
+	 * Note that we allow OSPMs to install their own region handlers
+	 * between acpi_initialize_subsystem() and acpi_load_tables() to use
+	 * their customized default region handlers.
+	 */
+	if (acpi_gbl_group_module_level_code) {
+		status = acpi_ev_install_region_handlers();
+		if (ACPI_FAILURE(status) && status != AE_ALREADY_EXISTS) {
+			ACPI_EXCEPTION((AE_INFO, status,
+					"During Region initialization"));
+			return_ACPI_STATUS(status);
+		}
+	}
+
 	/* Load the namespace from the tables */
 
 	status = acpi_tb_load_namespace();
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index 721b87c..e1ffd7a 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -163,11 +163,13 @@ acpi_status __init acpi_enable_subsystem(u32 flags)
 	 * installed before any AML code can be executed, especially any
 	 * module-level code (11/2015).
 	 */
-	status = acpi_ev_install_region_handlers();
-	if (ACPI_FAILURE(status)) {
-		ACPI_EXCEPTION((AE_INFO, status,
-				"During Region initialization"));
-		return_ACPI_STATUS(status);
+	if (!acpi_gbl_group_module_level_code) {
+		status = acpi_ev_install_region_handlers();
+		if (ACPI_FAILURE(status)) {
+			ACPI_EXCEPTION((AE_INFO, status,
+					"During Region initialization"));
+			return_ACPI_STATUS(status);
+		}
 	}
 #if (!ACPI_REDUCED_HARDWARE)
 
-- 
1.7.10

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

* [PATCH 08/15] ACPICA: Tables: make default region accessible during the table load
@ 2016-02-19  6:16   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:16 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

ACPICA commit 016b2a0917cca9cf0d40c38a1541017d9cf569dd

It is proven that the default regions should be accessible during the
table loading in order to execute module level AML code.
This patch moves default region handler installation code earlier in
order to make this happen.
Note that by putting the code here, we actually allow OSPMs to override
default region handlers between acpi_initialize_subsystem() and
acpi_load_tables(), without the need to introduce region handler override
mechanism in acpi_install_address_space_handler(). OSPMs are also couraged
to check acpi_install_address_space_handler() return value to determine if
acpi_remove_address_space_handler() should be invoked before installing new
address space handler. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/016b2a09
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/tbxfload.c |   22 ++++++++++++++++++++++
 drivers/acpi/acpica/utxfinit.c |   12 +++++++-----
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index c89943b..9496b84 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -47,6 +47,7 @@
 #include "accommon.h"
 #include "acnamesp.h"
 #include "actables.h"
+#include "acevents.h"
 
 #define _COMPONENT          ACPI_TABLES
 ACPI_MODULE_NAME("tbxfload")
@@ -68,6 +69,27 @@ acpi_status __init acpi_load_tables(void)
 
 	ACPI_FUNCTION_TRACE(acpi_load_tables);
 
+	/*
+	 * Install the default operation region handlers. These are the
+	 * handlers that are defined by the ACPI specification to be
+	 * "always accessible" -- namely, system_memory, system_IO, and
+	 * PCI_Config. This also means that no _REG methods need to be
+	 * run for these address spaces. We need to have these handlers
+	 * installed before any AML code can be executed, especially any
+	 * module-level code (11/2015).
+	 * Note that we allow OSPMs to install their own region handlers
+	 * between acpi_initialize_subsystem() and acpi_load_tables() to use
+	 * their customized default region handlers.
+	 */
+	if (acpi_gbl_group_module_level_code) {
+		status = acpi_ev_install_region_handlers();
+		if (ACPI_FAILURE(status) && status != AE_ALREADY_EXISTS) {
+			ACPI_EXCEPTION((AE_INFO, status,
+					"During Region initialization"));
+			return_ACPI_STATUS(status);
+		}
+	}
+
 	/* Load the namespace from the tables */
 
 	status = acpi_tb_load_namespace();
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index 721b87c..e1ffd7a 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -163,11 +163,13 @@ acpi_status __init acpi_enable_subsystem(u32 flags)
 	 * installed before any AML code can be executed, especially any
 	 * module-level code (11/2015).
 	 */
-	status = acpi_ev_install_region_handlers();
-	if (ACPI_FAILURE(status)) {
-		ACPI_EXCEPTION((AE_INFO, status,
-				"During Region initialization"));
-		return_ACPI_STATUS(status);
+	if (!acpi_gbl_group_module_level_code) {
+		status = acpi_ev_install_region_handlers();
+		if (ACPI_FAILURE(status)) {
+			ACPI_EXCEPTION((AE_INFO, status,
+					"During Region initialization"));
+			return_ACPI_STATUS(status);
+		}
 	}
 #if (!ACPI_REDUCED_HARDWARE)
 
-- 
1.7.10

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

* [PATCH 09/15] ACPICA: ACPICA: Tune _REG evaluations order in the initialization steps
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:17   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

ACPICA commit 77e0c7a482ac30ef857cf3c33d075e5fe5b5e449

This patch tunes _REG evaluations to be later than all table loading
facilities:
1. acpi_load_tables(): _REG is currently invoked after this function.
2. acpi_ns_exec_module_code_list(): this executes module level code, the
   execution should be a part of the table loading while we currently
   support this in a deferred way.
3. acpi_ns_initialize_objects(): this parses Region/Field/Buffer/Package where
   pkg_length primitive can be seen in the grammar, the parsing should be a
   part of the table loading while we currently support this in a deferred
   way.
Control method evaluation should happen after loading the tables. So this
patch changes the order of _REG evaluation when
acpi_gbl_group_module_level_code experiment is enabled. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/77e0c7a4
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/utxfinit.c |   35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index e1ffd7a..9415830 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -262,23 +262,6 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 
 	ACPI_FUNCTION_TRACE(acpi_initialize_objects);
 
-	/*
-	 * Run all _REG methods
-	 *
-	 * Note: Any objects accessed by the _REG methods will be automatically
-	 * initialized, even if they contain executable AML (see the call to
-	 * acpi_ns_initialize_objects below).
-	 */
-	acpi_gbl_reg_methods_enabled = TRUE;
-	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "[Init] Executing _REG OpRegion methods\n"));
-
-		status = acpi_ev_initialize_op_regions();
-		if (ACPI_FAILURE(status)) {
-			return_ACPI_STATUS(status);
-		}
-	}
 #ifdef ACPI_EXEC_APP
 	/*
 	 * This call implements the "initialization file" option for acpi_exec.
@@ -319,6 +302,24 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 	}
 
 	/*
+	 * Run all _REG methods
+	 *
+	 * Note: Any objects accessed by the _REG methods will be automatically
+	 * initialized, even if they contain executable AML (see the call to
+	 * acpi_ns_initialize_objects below).
+	 */
+	acpi_gbl_reg_methods_enabled = TRUE;
+	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+				  "[Init] Executing _REG OpRegion methods\n"));
+
+		status = acpi_ev_initialize_op_regions();
+		if (ACPI_FAILURE(status)) {
+			return_ACPI_STATUS(status);
+		}
+	}
+
+	/*
 	 * Initialize all device objects in the namespace. This runs the device
 	 * _STA and _INI methods.
 	 */
-- 
1.7.10

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

* [PATCH 09/15] ACPICA: ACPICA: Tune _REG evaluations order in the initialization steps
@ 2016-02-19  6:17   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

ACPICA commit 77e0c7a482ac30ef857cf3c33d075e5fe5b5e449

This patch tunes _REG evaluations to be later than all table loading
facilities:
1. acpi_load_tables(): _REG is currently invoked after this function.
2. acpi_ns_exec_module_code_list(): this executes module level code, the
   execution should be a part of the table loading while we currently
   support this in a deferred way.
3. acpi_ns_initialize_objects(): this parses Region/Field/Buffer/Package where
   pkg_length primitive can be seen in the grammar, the parsing should be a
   part of the table loading while we currently support this in a deferred
   way.
Control method evaluation should happen after loading the tables. So this
patch changes the order of _REG evaluation when
acpi_gbl_group_module_level_code experiment is enabled. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/77e0c7a4
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/utxfinit.c |   35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index e1ffd7a..9415830 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -262,23 +262,6 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 
 	ACPI_FUNCTION_TRACE(acpi_initialize_objects);
 
-	/*
-	 * Run all _REG methods
-	 *
-	 * Note: Any objects accessed by the _REG methods will be automatically
-	 * initialized, even if they contain executable AML (see the call to
-	 * acpi_ns_initialize_objects below).
-	 */
-	acpi_gbl_reg_methods_enabled = TRUE;
-	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "[Init] Executing _REG OpRegion methods\n"));
-
-		status = acpi_ev_initialize_op_regions();
-		if (ACPI_FAILURE(status)) {
-			return_ACPI_STATUS(status);
-		}
-	}
 #ifdef ACPI_EXEC_APP
 	/*
 	 * This call implements the "initialization file" option for acpi_exec.
@@ -319,6 +302,24 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 	}
 
 	/*
+	 * Run all _REG methods
+	 *
+	 * Note: Any objects accessed by the _REG methods will be automatically
+	 * initialized, even if they contain executable AML (see the call to
+	 * acpi_ns_initialize_objects below).
+	 */
+	acpi_gbl_reg_methods_enabled = TRUE;
+	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+				  "[Init] Executing _REG OpRegion methods\n"));
+
+		status = acpi_ev_initialize_op_regions();
+		if (ACPI_FAILURE(status)) {
+			return_ACPI_STATUS(status);
+		}
+	}
+
+	/*
 	 * Initialize all device objects in the namespace. This runs the device
 	 * _STA and _INI methods.
 	 */
-- 
1.7.10

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

* [PATCH 10/15] ACPICA: Namespace: Ensure \_SB._INI executed before any _REG
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:17   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

ACPICA commit 8ae25b8d128b6b8509010be321ff6bf2760f3807

There is BIOS code relying on the fact that \_SB._INI should get evaluated
before any other control methods. This may implies a gap in ACPICA/Linux
initialization/enumeration process.

Before revealing Windows true behavior by more validations, this patch only
ensures \_SB._INI evaluated before any _REG control methods. This can help
to make progress to other initialization order fixes. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/8ae25b8d
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/acnamesp.h |    2 +-
 drivers/acpi/acpica/nsinit.c   |  133 ++++++++++++++++++++++++----------------
 drivers/acpi/acpica/utxfinit.c |   27 ++------
 3 files changed, 85 insertions(+), 77 deletions(-)

diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h
index 9684ed6..022d69c 100644
--- a/drivers/acpi/acpica/acnamesp.h
+++ b/drivers/acpi/acpica/acnamesp.h
@@ -88,7 +88,7 @@
  */
 acpi_status acpi_ns_initialize_objects(void);
 
-acpi_status acpi_ns_initialize_devices(void);
+acpi_status acpi_ns_initialize_devices(u32 flags);
 
 /*
  * nsload -  Namespace loading
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index bd75d46..3281dd8 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -46,6 +46,7 @@
 #include "acnamesp.h"
 #include "acdispat.h"
 #include "acinterp.h"
+#include "acevents.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsinit")
@@ -133,82 +134,108 @@ acpi_status acpi_ns_initialize_objects(void)
  *
  ******************************************************************************/
 
-acpi_status acpi_ns_initialize_devices(void)
+acpi_status acpi_ns_initialize_devices(u32 flags)
 {
 	acpi_status status;
 	struct acpi_device_walk_info info;
 
 	ACPI_FUNCTION_TRACE(ns_initialize_devices);
 
-	/* Init counters */
+	if (!(flags & ACPI_NO_DEVICE_INIT)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+				  "[Init] Initializing ACPI Devices\n"));
 
-	info.device_count = 0;
-	info.num_STA = 0;
-	info.num_INI = 0;
+		/* Init counters */
 
-	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
-			      "Initializing Device/Processor/Thermal objects "
-			      "and executing _INI/_STA methods:\n"));
+		info.device_count = 0;
+		info.num_STA = 0;
+		info.num_INI = 0;
 
-	/* Tree analysis: find all subtrees that contain _INI methods */
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
+				      "Initializing Device/Processor/Thermal objects "
+				      "and executing _INI/_STA methods:\n"));
 
-	status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
-					ACPI_UINT32_MAX, FALSE,
-					acpi_ns_find_ini_methods, NULL, &info,
-					NULL);
-	if (ACPI_FAILURE(status)) {
-		goto error_exit;
-	}
+		/* Tree analysis: find all subtrees that contain _INI methods */
 
-	/* Allocate the evaluation information block */
+		status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+						ACPI_UINT32_MAX, FALSE,
+						acpi_ns_find_ini_methods, NULL,
+						&info, NULL);
+		if (ACPI_FAILURE(status)) {
+			goto error_exit;
+		}
+
+		/* Allocate the evaluation information block */
 
-	info.evaluate_info =
-	    ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
-	if (!info.evaluate_info) {
-		status = AE_NO_MEMORY;
-		goto error_exit;
+		info.evaluate_info =
+		    ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
+		if (!info.evaluate_info) {
+			status = AE_NO_MEMORY;
+			goto error_exit;
+		}
+
+		/*
+		 * Execute the "global" _INI method that may appear at the root.
+		 * This support is provided for Windows compatibility (Vista+) and
+		 * is not part of the ACPI specification.
+		 */
+		info.evaluate_info->prefix_node = acpi_gbl_root_node;
+		info.evaluate_info->relative_pathname = METHOD_NAME__INI;
+		info.evaluate_info->parameters = NULL;
+		info.evaluate_info->flags = ACPI_IGNORE_RETURN_VALUE;
+
+		status = acpi_ns_evaluate(info.evaluate_info);
+		if (ACPI_SUCCESS(status)) {
+			info.num_INI++;
+		}
 	}
 
 	/*
-	 * Execute the "global" _INI method that may appear at the root. This
-	 * support is provided for Windows compatibility (Vista+) and is not
-	 * part of the ACPI specification.
+	 * Run all _REG methods
+	 *
+	 * Note: Any objects accessed by the _REG methods will be automatically
+	 * initialized, even if they contain executable AML (see the call to
+	 * acpi_ns_initialize_objects below).
 	 */
-	info.evaluate_info->prefix_node = acpi_gbl_root_node;
-	info.evaluate_info->relative_pathname = METHOD_NAME__INI;
-	info.evaluate_info->parameters = NULL;
-	info.evaluate_info->flags = ACPI_IGNORE_RETURN_VALUE;
+	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+				  "[Init] Executing _REG OpRegion methods\n"));
 
-	status = acpi_ns_evaluate(info.evaluate_info);
-	if (ACPI_SUCCESS(status)) {
-		info.num_INI++;
+		status = acpi_ev_initialize_op_regions();
+		if (ACPI_FAILURE(status)) {
+			goto error_exit;
+		}
 	}
 
-	/* Walk namespace to execute all _INIs on present devices */
+	if (!(flags & ACPI_NO_DEVICE_INIT)) {
 
-	status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
-					ACPI_UINT32_MAX, FALSE,
-					acpi_ns_init_one_device, NULL, &info,
-					NULL);
+		/* Walk namespace to execute all _INIs on present devices */
 
-	/*
-	 * Any _OSI requests should be completed by now. If the BIOS has
-	 * requested any Windows OSI strings, we will always truncate
-	 * I/O addresses to 16 bits -- for Windows compatibility.
-	 */
-	if (acpi_gbl_osi_data >= ACPI_OSI_WIN_2000) {
-		acpi_gbl_truncate_io_addresses = TRUE;
-	}
+		status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+						ACPI_UINT32_MAX, FALSE,
+						acpi_ns_init_one_device, NULL,
+						&info, NULL);
 
-	ACPI_FREE(info.evaluate_info);
-	if (ACPI_FAILURE(status)) {
-		goto error_exit;
-	}
+		/*
+		 * Any _OSI requests should be completed by now. If the BIOS has
+		 * requested any Windows OSI strings, we will always truncate
+		 * I/O addresses to 16 bits -- for Windows compatibility.
+		 */
+		if (acpi_gbl_osi_data >= ACPI_OSI_WIN_2000) {
+			acpi_gbl_truncate_io_addresses = TRUE;
+		}
 
-	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
-			      "    Executed %u _INI methods requiring %u _STA executions "
-			      "(examined %u objects)\n",
-			      info.num_INI, info.num_STA, info.device_count));
+		ACPI_FREE(info.evaluate_info);
+		if (ACPI_FAILURE(status)) {
+			goto error_exit;
+		}
+
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
+				      "    Executed %u _INI methods requiring %u _STA executions "
+				      "(examined %u objects)\n",
+				      info.num_INI, info.num_STA,
+				      info.device_count));
+	}
 
 	return_ACPI_STATUS(status);
 
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index 9415830..66d6f19 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -301,33 +301,14 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 		}
 	}
 
-	/*
-	 * Run all _REG methods
-	 *
-	 * Note: Any objects accessed by the _REG methods will be automatically
-	 * initialized, even if they contain executable AML (see the call to
-	 * acpi_ns_initialize_objects below).
-	 */
 	acpi_gbl_reg_methods_enabled = TRUE;
-	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "[Init] Executing _REG OpRegion methods\n"));
-
-		status = acpi_ev_initialize_op_regions();
-		if (ACPI_FAILURE(status)) {
-			return_ACPI_STATUS(status);
-		}
-	}
 
 	/*
-	 * Initialize all device objects in the namespace. This runs the device
-	 * _STA and _INI methods.
+	 * Initialize all device/region objects in the namespace. This runs
+	 * the device _STA and _INI methods and region _REG methods.
 	 */
-	if (!(flags & ACPI_NO_DEVICE_INIT)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "[Init] Initializing ACPI Devices\n"));
-
-		status = acpi_ns_initialize_devices();
+	if (!(flags & (ACPI_NO_DEVICE_INIT | ACPI_NO_ADDRESS_SPACE_INIT))) {
+		status = acpi_ns_initialize_devices(flags);
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
 		}
-- 
1.7.10

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

* [PATCH 10/15] ACPICA: Namespace: Ensure \_SB._INI executed before any _REG
@ 2016-02-19  6:17   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

ACPICA commit 8ae25b8d128b6b8509010be321ff6bf2760f3807

There is BIOS code relying on the fact that \_SB._INI should get evaluated
before any other control methods. This may implies a gap in ACPICA/Linux
initialization/enumeration process.

Before revealing Windows true behavior by more validations, this patch only
ensures \_SB._INI evaluated before any _REG control methods. This can help
to make progress to other initialization order fixes. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/8ae25b8d
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/acnamesp.h |    2 +-
 drivers/acpi/acpica/nsinit.c   |  133 ++++++++++++++++++++++++----------------
 drivers/acpi/acpica/utxfinit.c |   27 ++------
 3 files changed, 85 insertions(+), 77 deletions(-)

diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h
index 9684ed6..022d69c 100644
--- a/drivers/acpi/acpica/acnamesp.h
+++ b/drivers/acpi/acpica/acnamesp.h
@@ -88,7 +88,7 @@
  */
 acpi_status acpi_ns_initialize_objects(void);
 
-acpi_status acpi_ns_initialize_devices(void);
+acpi_status acpi_ns_initialize_devices(u32 flags);
 
 /*
  * nsload -  Namespace loading
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index bd75d46..3281dd8 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -46,6 +46,7 @@
 #include "acnamesp.h"
 #include "acdispat.h"
 #include "acinterp.h"
+#include "acevents.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsinit")
@@ -133,82 +134,108 @@ acpi_status acpi_ns_initialize_objects(void)
  *
  ******************************************************************************/
 
-acpi_status acpi_ns_initialize_devices(void)
+acpi_status acpi_ns_initialize_devices(u32 flags)
 {
 	acpi_status status;
 	struct acpi_device_walk_info info;
 
 	ACPI_FUNCTION_TRACE(ns_initialize_devices);
 
-	/* Init counters */
+	if (!(flags & ACPI_NO_DEVICE_INIT)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+				  "[Init] Initializing ACPI Devices\n"));
 
-	info.device_count = 0;
-	info.num_STA = 0;
-	info.num_INI = 0;
+		/* Init counters */
 
-	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
-			      "Initializing Device/Processor/Thermal objects "
-			      "and executing _INI/_STA methods:\n"));
+		info.device_count = 0;
+		info.num_STA = 0;
+		info.num_INI = 0;
 
-	/* Tree analysis: find all subtrees that contain _INI methods */
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
+				      "Initializing Device/Processor/Thermal objects "
+				      "and executing _INI/_STA methods:\n"));
 
-	status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
-					ACPI_UINT32_MAX, FALSE,
-					acpi_ns_find_ini_methods, NULL, &info,
-					NULL);
-	if (ACPI_FAILURE(status)) {
-		goto error_exit;
-	}
+		/* Tree analysis: find all subtrees that contain _INI methods */
 
-	/* Allocate the evaluation information block */
+		status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+						ACPI_UINT32_MAX, FALSE,
+						acpi_ns_find_ini_methods, NULL,
+						&info, NULL);
+		if (ACPI_FAILURE(status)) {
+			goto error_exit;
+		}
+
+		/* Allocate the evaluation information block */
 
-	info.evaluate_info =
-	    ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
-	if (!info.evaluate_info) {
-		status = AE_NO_MEMORY;
-		goto error_exit;
+		info.evaluate_info =
+		    ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
+		if (!info.evaluate_info) {
+			status = AE_NO_MEMORY;
+			goto error_exit;
+		}
+
+		/*
+		 * Execute the "global" _INI method that may appear at the root.
+		 * This support is provided for Windows compatibility (Vista+) and
+		 * is not part of the ACPI specification.
+		 */
+		info.evaluate_info->prefix_node = acpi_gbl_root_node;
+		info.evaluate_info->relative_pathname = METHOD_NAME__INI;
+		info.evaluate_info->parameters = NULL;
+		info.evaluate_info->flags = ACPI_IGNORE_RETURN_VALUE;
+
+		status = acpi_ns_evaluate(info.evaluate_info);
+		if (ACPI_SUCCESS(status)) {
+			info.num_INI++;
+		}
 	}
 
 	/*
-	 * Execute the "global" _INI method that may appear at the root. This
-	 * support is provided for Windows compatibility (Vista+) and is not
-	 * part of the ACPI specification.
+	 * Run all _REG methods
+	 *
+	 * Note: Any objects accessed by the _REG methods will be automatically
+	 * initialized, even if they contain executable AML (see the call to
+	 * acpi_ns_initialize_objects below).
 	 */
-	info.evaluate_info->prefix_node = acpi_gbl_root_node;
-	info.evaluate_info->relative_pathname = METHOD_NAME__INI;
-	info.evaluate_info->parameters = NULL;
-	info.evaluate_info->flags = ACPI_IGNORE_RETURN_VALUE;
+	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
+		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
+				  "[Init] Executing _REG OpRegion methods\n"));
 
-	status = acpi_ns_evaluate(info.evaluate_info);
-	if (ACPI_SUCCESS(status)) {
-		info.num_INI++;
+		status = acpi_ev_initialize_op_regions();
+		if (ACPI_FAILURE(status)) {
+			goto error_exit;
+		}
 	}
 
-	/* Walk namespace to execute all _INIs on present devices */
+	if (!(flags & ACPI_NO_DEVICE_INIT)) {
 
-	status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
-					ACPI_UINT32_MAX, FALSE,
-					acpi_ns_init_one_device, NULL, &info,
-					NULL);
+		/* Walk namespace to execute all _INIs on present devices */
 
-	/*
-	 * Any _OSI requests should be completed by now. If the BIOS has
-	 * requested any Windows OSI strings, we will always truncate
-	 * I/O addresses to 16 bits -- for Windows compatibility.
-	 */
-	if (acpi_gbl_osi_data >= ACPI_OSI_WIN_2000) {
-		acpi_gbl_truncate_io_addresses = TRUE;
-	}
+		status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+						ACPI_UINT32_MAX, FALSE,
+						acpi_ns_init_one_device, NULL,
+						&info, NULL);
 
-	ACPI_FREE(info.evaluate_info);
-	if (ACPI_FAILURE(status)) {
-		goto error_exit;
-	}
+		/*
+		 * Any _OSI requests should be completed by now. If the BIOS has
+		 * requested any Windows OSI strings, we will always truncate
+		 * I/O addresses to 16 bits -- for Windows compatibility.
+		 */
+		if (acpi_gbl_osi_data >= ACPI_OSI_WIN_2000) {
+			acpi_gbl_truncate_io_addresses = TRUE;
+		}
 
-	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
-			      "    Executed %u _INI methods requiring %u _STA executions "
-			      "(examined %u objects)\n",
-			      info.num_INI, info.num_STA, info.device_count));
+		ACPI_FREE(info.evaluate_info);
+		if (ACPI_FAILURE(status)) {
+			goto error_exit;
+		}
+
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
+				      "    Executed %u _INI methods requiring %u _STA executions "
+				      "(examined %u objects)\n",
+				      info.num_INI, info.num_STA,
+				      info.device_count));
+	}
 
 	return_ACPI_STATUS(status);
 
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index 9415830..66d6f19 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -301,33 +301,14 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 		}
 	}
 
-	/*
-	 * Run all _REG methods
-	 *
-	 * Note: Any objects accessed by the _REG methods will be automatically
-	 * initialized, even if they contain executable AML (see the call to
-	 * acpi_ns_initialize_objects below).
-	 */
 	acpi_gbl_reg_methods_enabled = TRUE;
-	if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "[Init] Executing _REG OpRegion methods\n"));
-
-		status = acpi_ev_initialize_op_regions();
-		if (ACPI_FAILURE(status)) {
-			return_ACPI_STATUS(status);
-		}
-	}
 
 	/*
-	 * Initialize all device objects in the namespace. This runs the device
-	 * _STA and _INI methods.
+	 * Initialize all device/region objects in the namespace. This runs
+	 * the device _STA and _INI methods and region _REG methods.
 	 */
-	if (!(flags & ACPI_NO_DEVICE_INIT)) {
-		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "[Init] Initializing ACPI Devices\n"));
-
-		status = acpi_ns_initialize_devices();
+	if (!(flags & (ACPI_NO_DEVICE_INIT | ACPI_NO_ADDRESS_SPACE_INIT))) {
+		status = acpi_ns_initialize_devices(flags);
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
 		}
-- 
1.7.10

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

* [PATCH 11/15] ACPICA: Namespace: Rename acpi_gbl_reg_methods_enabled to acpi_gbl_namespace_initialized
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:17   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

ACPICA commit 4be3b82cf45d324366ea8567102d5108c5ef47cb
ACPICA commit 19f84c249267fab0bfb138bd14d12510fb4faf24

The global variable actually means the availability of the namespace, and
control methods evaluations should happen after namespace readiness. Thus
this patch renames the global variable to reflect this logic. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/4be3b82c
Link: https://github.com/acpica/acpica/commit/19f84c24
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/acglobal.h |    2 +-
 drivers/acpi/acpica/evregion.c |    2 +-
 drivers/acpi/acpica/nsinit.c   |    2 +-
 drivers/acpi/acpica/utxfinit.c |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 55c8197..51b073b 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -165,7 +165,7 @@ ACPI_GLOBAL(u8, acpi_gbl_next_owner_id_offset);
 
 /* Initialization sequencing */
 
-ACPI_INIT_GLOBAL(u8, acpi_gbl_reg_methods_enabled, FALSE);
+ACPI_INIT_GLOBAL(u8, acpi_gbl_namespace_initialized, FALSE);
 
 /* Misc */
 
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index 47092b4..63924d1 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -600,7 +600,7 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
 
 	if (region_obj2->extra.method_REG == NULL ||
 	    region_obj->region.handler == NULL ||
-	    !acpi_gbl_reg_methods_enabled) {
+	    !acpi_gbl_namespace_initialized) {
 		return_ACPI_STATUS(AE_OK);
 	}
 
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index 3281dd8..f029a3d 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -136,7 +136,7 @@ acpi_status acpi_ns_initialize_objects(void)
 
 acpi_status acpi_ns_initialize_devices(u32 flags)
 {
-	acpi_status status;
+	acpi_status status = AE_OK;
 	struct acpi_device_walk_info info;
 
 	ACPI_FUNCTION_TRACE(ns_initialize_devices);
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index 66d6f19..d70649d 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -301,7 +301,7 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 		}
 	}
 
-	acpi_gbl_reg_methods_enabled = TRUE;
+	acpi_gbl_namespace_initialized = TRUE;
 
 	/*
 	 * Initialize all device/region objects in the namespace. This runs
-- 
1.7.10

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

* [PATCH 11/15] ACPICA: Namespace: Rename acpi_gbl_reg_methods_enabled to acpi_gbl_namespace_initialized
@ 2016-02-19  6:17   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

ACPICA commit 4be3b82cf45d324366ea8567102d5108c5ef47cb
ACPICA commit 19f84c249267fab0bfb138bd14d12510fb4faf24

The global variable actually means the availability of the namespace, and
control methods evaluations should happen after namespace readiness. Thus
this patch renames the global variable to reflect this logic. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/4be3b82c
Link: https://github.com/acpica/acpica/commit/19f84c24
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
---
 drivers/acpi/acpica/acglobal.h |    2 +-
 drivers/acpi/acpica/evregion.c |    2 +-
 drivers/acpi/acpica/nsinit.c   |    2 +-
 drivers/acpi/acpica/utxfinit.c |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 55c8197..51b073b 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -165,7 +165,7 @@ ACPI_GLOBAL(u8, acpi_gbl_next_owner_id_offset);
 
 /* Initialization sequencing */
 
-ACPI_INIT_GLOBAL(u8, acpi_gbl_reg_methods_enabled, FALSE);
+ACPI_INIT_GLOBAL(u8, acpi_gbl_namespace_initialized, FALSE);
 
 /* Misc */
 
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index 47092b4..63924d1 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -600,7 +600,7 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
 
 	if (region_obj2->extra.method_REG == NULL ||
 	    region_obj->region.handler == NULL ||
-	    !acpi_gbl_reg_methods_enabled) {
+	    !acpi_gbl_namespace_initialized) {
 		return_ACPI_STATUS(AE_OK);
 	}
 
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index 3281dd8..f029a3d 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -136,7 +136,7 @@ acpi_status acpi_ns_initialize_objects(void)
 
 acpi_status acpi_ns_initialize_devices(u32 flags)
 {
-	acpi_status status;
+	acpi_status status = AE_OK;
 	struct acpi_device_walk_info info;
 
 	ACPI_FUNCTION_TRACE(ns_initialize_devices);
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index 66d6f19..d70649d 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -301,7 +301,7 @@ acpi_status __init acpi_initialize_objects(u32 flags)
 		}
 	}
 
-	acpi_gbl_reg_methods_enabled = TRUE;
+	acpi_gbl_namespace_initialized = TRUE;
 
 	/*
 	 * Initialize all device/region objects in the namespace. This runs
-- 
1.7.10

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

* [PATCH 12/15] ACPICA: ACPI 6.1: Add full support for this version of ACPI spec
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:17   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit 5f21bddaa2cec035ca80608803ce2f0858d4f387

Small changes:
1) A couple new predefined names
2) New _HID values
3) New subtable for HEST

Link: https://github.com/acpica/acpica/commit/5f21bdda
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/acpredef.h |    9 +++++++++
 drivers/acpi/acpica/utdecode.c |   30 +++++++++++++++++-------------
 include/acpi/actbl.h           |    2 +-
 include/acpi/actbl1.h          |   29 ++++++++++++++++++++++++++---
 include/acpi/actypes.h         |    3 ++-
 5 files changed, 55 insertions(+), 18 deletions(-)

diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index 5faeab4..4ca426b 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -523,6 +523,9 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
 	  METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},	/* Fixed-length (4 Int) */
 	PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0),
 
+	{{"_FIT", METHOD_0ARGS,
+	  METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},	/* ACPI 6.0 */
+
 	{{"_FIX", METHOD_0ARGS,
 	  METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},	/* Variable-length (Ints) */
 	PACKAGE_INFO(ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0, 0, 0, 0),
@@ -1053,6 +1056,12 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
 	  METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING |
 			 ACPI_RTYPE_BUFFER)}},
 
+	{{"_WPC", METHOD_0ARGS,
+	  METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},	/* ACPI 6.1 */
+
+	{{"_WPP", METHOD_0ARGS,
+	  METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},	/* ACPI 6.1 */
+
 	PACKAGE_INFO(0, 0, 0, 0, 0, 0)	/* Table terminator */
 };
 #else
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
index 6ba65b0..efd7988 100644
--- a/drivers/acpi/acpica/utdecode.c
+++ b/drivers/acpi/acpica/utdecode.c
@@ -446,7 +446,7 @@ const char *acpi_ut_get_mutex_name(u32 mutex_id)
 
 /* Names for Notify() values, used for debug output */
 
-static const char *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = {
+static const char *acpi_gbl_generic_notify[ACPI_GENERIC_NOTIFY_MAX + 1] = {
 	/* 00 */ "Bus Check",
 	/* 01 */ "Device Check",
 	/* 02 */ "Device Wake",
@@ -459,49 +459,53 @@ static const char *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = {
 	/* 09 */ "Device PLD Check",
 	/* 0A */ "Reserved",
 	/* 0B */ "System Locality Update",
-	/* 0C */ "Shutdown Request",
+					/* 0C */ "Shutdown Request",
+					/* Reserved in ACPI 6.0 */
 	/* 0D */ "System Resource Affinity Update"
 };
 
-static const char *acpi_gbl_device_notify[4] = {
+static const char *acpi_gbl_device_notify[5] = {
 	/* 80 */ "Status Change",
 	/* 81 */ "Information Change",
 	/* 82 */ "Device-Specific Change",
-	/* 83 */ "Device-Specific Change"
+	/* 83 */ "Device-Specific Change",
+	/* 84 */ "Reserved"
 };
 
-static const char *acpi_gbl_processor_notify[4] = {
+static const char *acpi_gbl_processor_notify[5] = {
 	/* 80 */ "Performance Capability Change",
 	/* 81 */ "C-State Change",
 	/* 82 */ "Throttling Capability Change",
-	/* 83 */ "Device-Specific Change"
+	/* 83 */ "Guaranteed Change",
+	/* 84 */ "Minimum Excursion"
 };
 
-static const char *acpi_gbl_thermal_notify[4] = {
+static const char *acpi_gbl_thermal_notify[5] = {
 	/* 80 */ "Thermal Status Change",
 	/* 81 */ "Thermal Trip Point Change",
 	/* 82 */ "Thermal Device List Change",
-	/* 83 */ "Thermal Relationship Change"
+	/* 83 */ "Thermal Relationship Change",
+	/* 84 */ "Reserved"
 };
 
 const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type)
 {
 
-	/* 00 - 0D are common to all object types */
+	/* 00 - 0D are "common to all object types" (from ACPI Spec) */
 
-	if (notify_value <= ACPI_NOTIFY_MAX) {
+	if (notify_value <= ACPI_GENERIC_NOTIFY_MAX) {
 		return (acpi_gbl_generic_notify[notify_value]);
 	}
 
-	/* 0D - 7F are reserved */
+	/* 0E - 7F are reserved */
 
 	if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
 		return ("Reserved");
 	}
 
-	/* 80 - 83 are per-object-type */
+	/* 80 - 84 are per-object-type */
 
-	if (notify_value <= 0x83) {
+	if (notify_value <= ACPI_SPECIFIC_NOTIFY_MAX) {
 		switch (type) {
 		case ACPI_TYPE_ANY:
 		case ACPI_TYPE_DEVICE:
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 0cb1a00..6a4e521 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -223,7 +223,7 @@ struct acpi_table_facs {
 /*******************************************************************************
  *
  * FADT - Fixed ACPI Description Table (Signature "FACP")
- *        Version 4
+ *        Version 6
  *
  ******************************************************************************/
 
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 16e0136..26494dd 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -236,7 +236,8 @@ enum acpi_einj_actions {
 	ACPI_EINJ_CHECK_BUSY_STATUS = 6,
 	ACPI_EINJ_GET_COMMAND_STATUS = 7,
 	ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
-	ACPI_EINJ_ACTION_RESERVED = 9,	/* 9 and greater are reserved */
+	ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
+	ACPI_EINJ_ACTION_RESERVED = 10,	/* 10 and greater are reserved */
 	ACPI_EINJ_TRIGGER_ERROR = 0xFF	/* Except for this value */
 };
 
@@ -348,7 +349,8 @@ enum acpi_erst_actions {
 	ACPI_ERST_GET_ERROR_RANGE = 13,
 	ACPI_ERST_GET_ERROR_LENGTH = 14,
 	ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
-	ACPI_ERST_ACTION_RESERVED = 16	/* 16 and greater are reserved */
+	ACPI_ERST_EXECUTE_TIMINGS = 16,
+	ACPI_ERST_ACTION_RESERVED = 17	/* 17 and greater are reserved */
 };
 
 /* Values for Instruction field above */
@@ -427,7 +429,8 @@ enum acpi_hest_types {
 	ACPI_HEST_TYPE_AER_ENDPOINT = 7,
 	ACPI_HEST_TYPE_AER_BRIDGE = 8,
 	ACPI_HEST_TYPE_GENERIC_ERROR = 9,
-	ACPI_HEST_TYPE_RESERVED = 10	/* 10 and greater are reserved */
+	ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
+	ACPI_HEST_TYPE_RESERVED = 11	/* 11 and greater are reserved */
 };
 
 /*
@@ -603,6 +606,24 @@ struct acpi_hest_generic {
 	u32 error_block_length;
 };
 
+/* 10: Generic Hardware Error Source, version 2 */
+
+struct acpi_hest_generic_v2 {
+	struct acpi_hest_header header;
+	u16 related_source_id;
+	u8 reserved;
+	u8 enabled;
+	u32 records_to_preallocate;
+	u32 max_sections_per_record;
+	u32 max_raw_data_length;
+	struct acpi_generic_address error_status_address;
+	struct acpi_hest_notify notify;
+	u32 error_block_length;
+	struct acpi_generic_address read_ack_register;
+	u64 read_ack_preserve;
+	u64 read_ack_write;
+};
+
 /* Generic Error Status block */
 
 struct acpi_hest_generic_status {
@@ -632,6 +653,7 @@ struct acpi_hest_generic_data {
 	u32 error_data_length;
 	u8 fru_id[16];
 	u8 fru_text[20];
+	u64 time_stamp;
 };
 
 /*******************************************************************************
@@ -1015,6 +1037,7 @@ struct acpi_nfit_memory_map {
 #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)	/* 03: Memory Device is not armed */
 #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)	/* 04: Memory Device observed SMART/health events */
 #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)	/* 05: SMART/health events enabled */
+#define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)	/* 06: Mapping to SPA failed */
 
 /* 2: Interleave Structure */
 
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index db46546..140886e 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -630,7 +630,8 @@ typedef u64 acpi_integer;
 #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (u8) 0x0C
 #define ACPI_NOTIFY_AFFINITY_UPDATE     (u8) 0x0D
 
-#define ACPI_NOTIFY_MAX                 0x0D
+#define ACPI_GENERIC_NOTIFY_MAX         0x0D
+#define ACPI_SPECIFIC_NOTIFY_MAX        0x84
 
 /*
  * Types associated with ACPI names and objects. The first group of
-- 
1.7.10

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

* [PATCH 12/15] ACPICA: ACPI 6.1: Add full support for this version of ACPI spec
@ 2016-02-19  6:17   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit 5f21bddaa2cec035ca80608803ce2f0858d4f387

Small changes:
1) A couple new predefined names
2) New _HID values
3) New subtable for HEST

Link: https://github.com/acpica/acpica/commit/5f21bdda
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/acpredef.h |    9 +++++++++
 drivers/acpi/acpica/utdecode.c |   30 +++++++++++++++++-------------
 include/acpi/actbl.h           |    2 +-
 include/acpi/actbl1.h          |   29 ++++++++++++++++++++++++++---
 include/acpi/actypes.h         |    3 ++-
 5 files changed, 55 insertions(+), 18 deletions(-)

diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index 5faeab4..4ca426b 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -523,6 +523,9 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
 	  METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},	/* Fixed-length (4 Int) */
 	PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0),
 
+	{{"_FIT", METHOD_0ARGS,
+	  METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},	/* ACPI 6.0 */
+
 	{{"_FIX", METHOD_0ARGS,
 	  METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},	/* Variable-length (Ints) */
 	PACKAGE_INFO(ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0, 0, 0, 0),
@@ -1053,6 +1056,12 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
 	  METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING |
 			 ACPI_RTYPE_BUFFER)}},
 
+	{{"_WPC", METHOD_0ARGS,
+	  METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},	/* ACPI 6.1 */
+
+	{{"_WPP", METHOD_0ARGS,
+	  METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},	/* ACPI 6.1 */
+
 	PACKAGE_INFO(0, 0, 0, 0, 0, 0)	/* Table terminator */
 };
 #else
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
index 6ba65b0..efd7988 100644
--- a/drivers/acpi/acpica/utdecode.c
+++ b/drivers/acpi/acpica/utdecode.c
@@ -446,7 +446,7 @@ const char *acpi_ut_get_mutex_name(u32 mutex_id)
 
 /* Names for Notify() values, used for debug output */
 
-static const char *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = {
+static const char *acpi_gbl_generic_notify[ACPI_GENERIC_NOTIFY_MAX + 1] = {
 	/* 00 */ "Bus Check",
 	/* 01 */ "Device Check",
 	/* 02 */ "Device Wake",
@@ -459,49 +459,53 @@ static const char *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = {
 	/* 09 */ "Device PLD Check",
 	/* 0A */ "Reserved",
 	/* 0B */ "System Locality Update",
-	/* 0C */ "Shutdown Request",
+					/* 0C */ "Shutdown Request",
+					/* Reserved in ACPI 6.0 */
 	/* 0D */ "System Resource Affinity Update"
 };
 
-static const char *acpi_gbl_device_notify[4] = {
+static const char *acpi_gbl_device_notify[5] = {
 	/* 80 */ "Status Change",
 	/* 81 */ "Information Change",
 	/* 82 */ "Device-Specific Change",
-	/* 83 */ "Device-Specific Change"
+	/* 83 */ "Device-Specific Change",
+	/* 84 */ "Reserved"
 };
 
-static const char *acpi_gbl_processor_notify[4] = {
+static const char *acpi_gbl_processor_notify[5] = {
 	/* 80 */ "Performance Capability Change",
 	/* 81 */ "C-State Change",
 	/* 82 */ "Throttling Capability Change",
-	/* 83 */ "Device-Specific Change"
+	/* 83 */ "Guaranteed Change",
+	/* 84 */ "Minimum Excursion"
 };
 
-static const char *acpi_gbl_thermal_notify[4] = {
+static const char *acpi_gbl_thermal_notify[5] = {
 	/* 80 */ "Thermal Status Change",
 	/* 81 */ "Thermal Trip Point Change",
 	/* 82 */ "Thermal Device List Change",
-	/* 83 */ "Thermal Relationship Change"
+	/* 83 */ "Thermal Relationship Change",
+	/* 84 */ "Reserved"
 };
 
 const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type)
 {
 
-	/* 00 - 0D are common to all object types */
+	/* 00 - 0D are "common to all object types" (from ACPI Spec) */
 
-	if (notify_value <= ACPI_NOTIFY_MAX) {
+	if (notify_value <= ACPI_GENERIC_NOTIFY_MAX) {
 		return (acpi_gbl_generic_notify[notify_value]);
 	}
 
-	/* 0D - 7F are reserved */
+	/* 0E - 7F are reserved */
 
 	if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
 		return ("Reserved");
 	}
 
-	/* 80 - 83 are per-object-type */
+	/* 80 - 84 are per-object-type */
 
-	if (notify_value <= 0x83) {
+	if (notify_value <= ACPI_SPECIFIC_NOTIFY_MAX) {
 		switch (type) {
 		case ACPI_TYPE_ANY:
 		case ACPI_TYPE_DEVICE:
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 0cb1a00..6a4e521 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -223,7 +223,7 @@ struct acpi_table_facs {
 /*******************************************************************************
  *
  * FADT - Fixed ACPI Description Table (Signature "FACP")
- *        Version 4
+ *        Version 6
  *
  ******************************************************************************/
 
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 16e0136..26494dd 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -236,7 +236,8 @@ enum acpi_einj_actions {
 	ACPI_EINJ_CHECK_BUSY_STATUS = 6,
 	ACPI_EINJ_GET_COMMAND_STATUS = 7,
 	ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
-	ACPI_EINJ_ACTION_RESERVED = 9,	/* 9 and greater are reserved */
+	ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
+	ACPI_EINJ_ACTION_RESERVED = 10,	/* 10 and greater are reserved */
 	ACPI_EINJ_TRIGGER_ERROR = 0xFF	/* Except for this value */
 };
 
@@ -348,7 +349,8 @@ enum acpi_erst_actions {
 	ACPI_ERST_GET_ERROR_RANGE = 13,
 	ACPI_ERST_GET_ERROR_LENGTH = 14,
 	ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
-	ACPI_ERST_ACTION_RESERVED = 16	/* 16 and greater are reserved */
+	ACPI_ERST_EXECUTE_TIMINGS = 16,
+	ACPI_ERST_ACTION_RESERVED = 17	/* 17 and greater are reserved */
 };
 
 /* Values for Instruction field above */
@@ -427,7 +429,8 @@ enum acpi_hest_types {
 	ACPI_HEST_TYPE_AER_ENDPOINT = 7,
 	ACPI_HEST_TYPE_AER_BRIDGE = 8,
 	ACPI_HEST_TYPE_GENERIC_ERROR = 9,
-	ACPI_HEST_TYPE_RESERVED = 10	/* 10 and greater are reserved */
+	ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
+	ACPI_HEST_TYPE_RESERVED = 11	/* 11 and greater are reserved */
 };
 
 /*
@@ -603,6 +606,24 @@ struct acpi_hest_generic {
 	u32 error_block_length;
 };
 
+/* 10: Generic Hardware Error Source, version 2 */
+
+struct acpi_hest_generic_v2 {
+	struct acpi_hest_header header;
+	u16 related_source_id;
+	u8 reserved;
+	u8 enabled;
+	u32 records_to_preallocate;
+	u32 max_sections_per_record;
+	u32 max_raw_data_length;
+	struct acpi_generic_address error_status_address;
+	struct acpi_hest_notify notify;
+	u32 error_block_length;
+	struct acpi_generic_address read_ack_register;
+	u64 read_ack_preserve;
+	u64 read_ack_write;
+};
+
 /* Generic Error Status block */
 
 struct acpi_hest_generic_status {
@@ -632,6 +653,7 @@ struct acpi_hest_generic_data {
 	u32 error_data_length;
 	u8 fru_id[16];
 	u8 fru_text[20];
+	u64 time_stamp;
 };
 
 /*******************************************************************************
@@ -1015,6 +1037,7 @@ struct acpi_nfit_memory_map {
 #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)	/* 03: Memory Device is not armed */
 #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)	/* 04: Memory Device observed SMART/health events */
 #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)	/* 05: SMART/health events enabled */
+#define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)	/* 06: Mapping to SPA failed */
 
 /* 2: Interleave Structure */
 
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index db46546..140886e 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -630,7 +630,8 @@ typedef u64 acpi_integer;
 #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (u8) 0x0C
 #define ACPI_NOTIFY_AFFINITY_UPDATE     (u8) 0x0D
 
-#define ACPI_NOTIFY_MAX                 0x0D
+#define ACPI_GENERIC_NOTIFY_MAX         0x0D
+#define ACPI_SPECIFIC_NOTIFY_MAX        0x84
 
 /*
  * Types associated with ACPI names and objects. The first group of
-- 
1.7.10

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

* [PATCH 13/15] ACPICA: Revert "Parser: Fix for SuperName method invocation"
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:17   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit eade8f78f2aa21e8eabc3380a5728db47273bcf1

This reverts commit 4b86d1046d06e462dae83ebcd5a66cc132a08f8f.

Support for method invocations as part of super_name will be
removed from the ACPI specification, since no AML interpreter
supports it.

Link: https://github.com/acpica/acpica/commit/eade8f78
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/psargs.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index 3052185..d48cbed 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -269,8 +269,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
 	 */
 	if (ACPI_SUCCESS(status) &&
 	    possible_method_call && (node->type == ACPI_TYPE_METHOD)) {
-		if (GET_CURRENT_ARG_TYPE(walk_state->arg_types) ==
-		    ARGP_SUPERNAME) {
+		if (walk_state->opcode == AML_UNLOAD_OP) {
 			/*
 			 * acpi_ps_get_next_namestring has increased the AML pointer,
 			 * so we need to restore the saved AML pointer for method call.
@@ -697,7 +696,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
  *
  * PARAMETERS:  walk_state          - Current state
  *              parser_state        - Current parser state object
- *              arg_type            - The parser argument type (ARGP_*)
+ *              arg_type            - The argument type (AML_*_ARG)
  *              return_arg          - Where the next arg is returned
  *
  * RETURN:      Status, and an op object containing the next argument.
@@ -817,9 +816,9 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 				return_ACPI_STATUS(AE_NO_MEMORY);
 			}
 
-			/* super_name allows argument to be a method call */
+			/* To support super_name arg of Unload */
 
-			if (arg_type == ARGP_SUPERNAME) {
+			if (walk_state->opcode == AML_UNLOAD_OP) {
 				status =
 				    acpi_ps_get_next_namepath(walk_state,
 							      parser_state, arg,
-- 
1.7.10

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

* [PATCH 13/15] ACPICA: Revert "Parser: Fix for SuperName method invocation"
@ 2016-02-19  6:17   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit eade8f78f2aa21e8eabc3380a5728db47273bcf1

This reverts commit 4b86d1046d06e462dae83ebcd5a66cc132a08f8f.

Support for method invocations as part of super_name will be
removed from the ACPI specification, since no AML interpreter
supports it.

Link: https://github.com/acpica/acpica/commit/eade8f78
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/psargs.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index 3052185..d48cbed 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -269,8 +269,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
 	 */
 	if (ACPI_SUCCESS(status) &&
 	    possible_method_call && (node->type == ACPI_TYPE_METHOD)) {
-		if (GET_CURRENT_ARG_TYPE(walk_state->arg_types) ==
-		    ARGP_SUPERNAME) {
+		if (walk_state->opcode == AML_UNLOAD_OP) {
 			/*
 			 * acpi_ps_get_next_namestring has increased the AML pointer,
 			 * so we need to restore the saved AML pointer for method call.
@@ -697,7 +696,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
  *
  * PARAMETERS:  walk_state          - Current state
  *              parser_state        - Current parser state object
- *              arg_type            - The parser argument type (ARGP_*)
+ *              arg_type            - The argument type (AML_*_ARG)
  *              return_arg          - Where the next arg is returned
  *
  * RETURN:      Status, and an op object containing the next argument.
@@ -817,9 +816,9 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
 				return_ACPI_STATUS(AE_NO_MEMORY);
 			}
 
-			/* super_name allows argument to be a method call */
+			/* To support super_name arg of Unload */
 
-			if (arg_type == ARGP_SUPERNAME) {
+			if (walk_state->opcode == AML_UNLOAD_OP) {
 				status =
 				    acpi_ps_get_next_namepath(walk_state,
 							      parser_state, arg,
-- 
1.7.10

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

* [PATCH 14/15] ACPICA: Utilities: Update trace mechinism for acquire_object
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:17   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit 0824ab90e03c2e4239e890615f447e7962b1daa2

Was not using the correct macro. Updated a comment in
acoutput.h

Link: https://github.com/acpica/acpica/commit/0824ab90
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/utcache.c |    2 +-
 include/acpi/acoutput.h       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/utcache.c b/drivers/acpi/acpica/utcache.c
index c9a720f..f8e9978 100644
--- a/drivers/acpi/acpica/utcache.c
+++ b/drivers/acpi/acpica/utcache.c
@@ -245,7 +245,7 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
 	acpi_status status;
 	void *object;
 
-	ACPI_FUNCTION_NAME(os_acquire_object);
+	ACPI_FUNCTION_TRACE(os_acquire_object);
 
 	if (!cache) {
 		return_PTR(NULL);
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 5bfc619..34f601e 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -262,7 +262,7 @@
 #define ACPI_GET_FUNCTION_NAME          _acpi_function_name
 
 /*
- * The Name parameter should be the procedure name as a quoted string.
+ * The Name parameter should be the procedure name as a non-quoted string.
  * The function name is also used by the function exit macros below.
  * Note: (const char) is used to be compatible with the debug interfaces
  * and macros such as __func__.
-- 
1.7.10

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

* [PATCH 14/15] ACPICA: Utilities: Update trace mechinism for acquire_object
@ 2016-02-19  6:17   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit 0824ab90e03c2e4239e890615f447e7962b1daa2

Was not using the correct macro. Updated a comment in
acoutput.h

Link: https://github.com/acpica/acpica/commit/0824ab90
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
 drivers/acpi/acpica/utcache.c |    2 +-
 include/acpi/acoutput.h       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/utcache.c b/drivers/acpi/acpica/utcache.c
index c9a720f..f8e9978 100644
--- a/drivers/acpi/acpica/utcache.c
+++ b/drivers/acpi/acpica/utcache.c
@@ -245,7 +245,7 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
 	acpi_status status;
 	void *object;
 
-	ACPI_FUNCTION_NAME(os_acquire_object);
+	ACPI_FUNCTION_TRACE(os_acquire_object);
 
 	if (!cache) {
 		return_PTR(NULL);
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 5bfc619..34f601e 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -262,7 +262,7 @@
 #define ACPI_GET_FUNCTION_NAME          _acpi_function_name
 
 /*
- * The Name parameter should be the procedure name as a quoted string.
+ * The Name parameter should be the procedure name as a non-quoted string.
  * The function name is also used by the function exit macros below.
  * Note: (const char) is used to be compatible with the debug interfaces
  * and macros such as __func__.
-- 
1.7.10

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

* [PATCH 15/15] ACPICA: Update version to 20160212
  2016-02-19  6:15 ` Lv Zheng
@ 2016-02-19  6:17   ` Lv Zheng
  -1 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit 6b06645ea778cc054f48b03dd1842260a1606532

Version 20160212

Link: https://github.com/acpica/acpica/commit/6b06645e
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 1755697..c5078aa 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                 0x20160108
+#define ACPI_CA_VERSION                 0x20160212
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
-- 
1.7.10

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

* [PATCH 15/15] ACPICA: Update version to 20160212
@ 2016-02-19  6:17   ` Lv Zheng
  0 siblings, 0 replies; 37+ messages in thread
From: Lv Zheng @ 2016-02-19  6:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, Lv Zheng, linux-kernel, linux-acpi, Bob Moore

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

ACPICA commit 6b06645ea778cc054f48b03dd1842260a1606532

Version 20160212

Link: https://github.com/acpica/acpica/commit/6b06645e
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 1755697..c5078aa 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                 0x20160108
+#define ACPI_CA_VERSION                 0x20160212
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
-- 
1.7.10

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

* Re: [PATCH 12/15] ACPICA: ACPI 6.1: Add full support for this version of ACPI spec
  2016-02-19  6:17   ` Lv Zheng
  (?)
@ 2016-02-20 21:41   ` Abdulhamid, Harb
  2016-02-24 16:22     ` Moore, Robert
                       ` (2 more replies)
  -1 siblings, 3 replies; 37+ messages in thread
From: Abdulhamid, Harb @ 2016-02-20 21:41 UTC (permalink / raw)
  To: Lv Zheng, Rafael J. Wysocki, Rafael J. Wysocki, Len Brown
  Cc: Lv Zheng, linux-kernel, linux-acpi, Bob Moore, Al Stone, fu.wei,
	tbaicar, rruigrok

On 2/19/2016 1:17 AM, Lv Zheng wrote:
> From: Bob Moore <robert.moore@intel.com>
> 
> ACPICA commit 5f21bddaa2cec035ca80608803ce2f0858d4f387
> 
> Small changes:
> 1) A couple new predefined names
> 2) New _HID values
I don't see where you are adding new _HID values in this patch.

> 3) New subtable for HEST
> 
> Link: https://github.com/acpica/acpica/commit/5f21bdda
> Signed-off-by: Bob Moore <robert.moore@intel.com>
> Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> ---
>  drivers/acpi/acpica/acpredef.h |    9 +++++++++
>  drivers/acpi/acpica/utdecode.c |   30 +++++++++++++++++-------------
>  include/acpi/actbl.h           |    2 +-
>  include/acpi/actbl1.h          |   29 ++++++++++++++++++++++++++---
>  include/acpi/actypes.h         |    3 ++-
>  5 files changed, 55 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
> index 5faeab4..4ca426b 100644
> --- a/drivers/acpi/acpica/acpredef.h
> +++ b/drivers/acpi/acpica/acpredef.h
> @@ -523,6 +523,9 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
>  	  METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},	/* Fixed-length (4 Int) */
>  	PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0),
>  
> +	{{"_FIT", METHOD_0ARGS,
> +	  METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},	/* ACPI 6.0 */
> +
>  	{{"_FIX", METHOD_0ARGS,
>  	  METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},	/* Variable-length (Ints) */
>  	PACKAGE_INFO(ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0, 0, 0, 0),
> @@ -1053,6 +1056,12 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
>  	  METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING |
>  			 ACPI_RTYPE_BUFFER)}},
>  
> +	{{"_WPC", METHOD_0ARGS,
> +	  METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},	/* ACPI 6.1 */
> +
> +	{{"_WPP", METHOD_0ARGS,
> +	  METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},	/* ACPI 6.1 */
> +
>  	PACKAGE_INFO(0, 0, 0, 0, 0, 0)	/* Table terminator */
>  };
>  #else
> diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
> index 6ba65b0..efd7988 100644
> --- a/drivers/acpi/acpica/utdecode.c
> +++ b/drivers/acpi/acpica/utdecode.c
> @@ -446,7 +446,7 @@ const char *acpi_ut_get_mutex_name(u32 mutex_id)
>  
>  /* Names for Notify() values, used for debug output */
>  
> -static const char *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = {
> +static const char *acpi_gbl_generic_notify[ACPI_GENERIC_NOTIFY_MAX + 1] = {
>  	/* 00 */ "Bus Check",
>  	/* 01 */ "Device Check",
>  	/* 02 */ "Device Wake",
> @@ -459,49 +459,53 @@ static const char *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = {
>  	/* 09 */ "Device PLD Check",
>  	/* 0A */ "Reserved",
>  	/* 0B */ "System Locality Update",
> -	/* 0C */ "Shutdown Request",
> +					/* 0C */ "Shutdown Request",
> +					/* Reserved in ACPI 6.0 */
>  	/* 0D */ "System Resource Affinity Update"
>  };
>  
> -static const char *acpi_gbl_device_notify[4] = {
> +static const char *acpi_gbl_device_notify[5] = {
>  	/* 80 */ "Status Change",
>  	/* 81 */ "Information Change",
>  	/* 82 */ "Device-Specific Change",
> -	/* 83 */ "Device-Specific Change"
> +	/* 83 */ "Device-Specific Change",
> +	/* 84 */ "Reserved"
>  };
>  
> -static const char *acpi_gbl_processor_notify[4] = {
> +static const char *acpi_gbl_processor_notify[5] = {
>  	/* 80 */ "Performance Capability Change",
>  	/* 81 */ "C-State Change",
>  	/* 82 */ "Throttling Capability Change",
> -	/* 83 */ "Device-Specific Change"
> +	/* 83 */ "Guaranteed Change",
> +	/* 84 */ "Minimum Excursion"
>  };
>  
> -static const char *acpi_gbl_thermal_notify[4] = {
> +static const char *acpi_gbl_thermal_notify[5] = {
>  	/* 80 */ "Thermal Status Change",
>  	/* 81 */ "Thermal Trip Point Change",
>  	/* 82 */ "Thermal Device List Change",
> -	/* 83 */ "Thermal Relationship Change"
> +	/* 83 */ "Thermal Relationship Change",
> +	/* 84 */ "Reserved"
>  };
>  
>  const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type)
>  {
>  
> -	/* 00 - 0D are common to all object types */
> +	/* 00 - 0D are "common to all object types" (from ACPI Spec) */
>  
> -	if (notify_value <= ACPI_NOTIFY_MAX) {
> +	if (notify_value <= ACPI_GENERIC_NOTIFY_MAX) {
>  		return (acpi_gbl_generic_notify[notify_value]);
>  	}
>  
> -	/* 0D - 7F are reserved */
> +	/* 0E - 7F are reserved */
>  
>  	if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
>  		return ("Reserved");
>  	}
>  
> -	/* 80 - 83 are per-object-type */
> +	/* 80 - 84 are per-object-type */
>  
> -	if (notify_value <= 0x83) {
> +	if (notify_value <= ACPI_SPECIFIC_NOTIFY_MAX) {
>  		switch (type) {
>  		case ACPI_TYPE_ANY:
>  		case ACPI_TYPE_DEVICE:
> diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
> index 0cb1a00..6a4e521 100644
> --- a/include/acpi/actbl.h
> +++ b/include/acpi/actbl.h
> @@ -223,7 +223,7 @@ struct acpi_table_facs {
>  /*******************************************************************************
>   *
>   * FADT - Fixed ACPI Description Table (Signature "FACP")
> - *        Version 4
> + *        Version 6
>   *
>   ******************************************************************************/
>  
> diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
> index 16e0136..26494dd 100644
> --- a/include/acpi/actbl1.h
> +++ b/include/acpi/actbl1.h
> @@ -236,7 +236,8 @@ enum acpi_einj_actions {
>  	ACPI_EINJ_CHECK_BUSY_STATUS = 6,
>  	ACPI_EINJ_GET_COMMAND_STATUS = 7,
>  	ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
> -	ACPI_EINJ_ACTION_RESERVED = 9,	/* 9 and greater are reserved */
> +	ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
> +	ACPI_EINJ_ACTION_RESERVED = 10,	/* 10 and greater are reserved */
>  	ACPI_EINJ_TRIGGER_ERROR = 0xFF	/* Except for this value */
>  };
>  
> @@ -348,7 +349,8 @@ enum acpi_erst_actions {
>  	ACPI_ERST_GET_ERROR_RANGE = 13,
>  	ACPI_ERST_GET_ERROR_LENGTH = 14,
>  	ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
> -	ACPI_ERST_ACTION_RESERVED = 16	/* 16 and greater are reserved */
> +	ACPI_ERST_EXECUTE_TIMINGS = 16,
> +	ACPI_ERST_ACTION_RESERVED = 17	/* 17 and greater are reserved */
>  };
>  
>  /* Values for Instruction field above */
> @@ -427,7 +429,8 @@ enum acpi_hest_types {
>  	ACPI_HEST_TYPE_AER_ENDPOINT = 7,
>  	ACPI_HEST_TYPE_AER_BRIDGE = 8,
>  	ACPI_HEST_TYPE_GENERIC_ERROR = 9,
> -	ACPI_HEST_TYPE_RESERVED = 10	/* 10 and greater are reserved */
> +	ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
> +	ACPI_HEST_TYPE_RESERVED = 11	/* 11 and greater are reserved */
>  };
>  
>  /*
> @@ -603,6 +606,24 @@ struct acpi_hest_generic {
>  	u32 error_block_length;
>  };
>  
> +/* 10: Generic Hardware Error Source, version 2 */
> +
> +struct acpi_hest_generic_v2 {
> +	struct acpi_hest_header header;
> +	u16 related_source_id;
> +	u8 reserved;
> +	u8 enabled;
> +	u32 records_to_preallocate;
> +	u32 max_sections_per_record;
> +	u32 max_raw_data_length;
> +	struct acpi_generic_address error_status_address;
> +	struct acpi_hest_notify notify;
> +	u32 error_block_length;
> +	struct acpi_generic_address read_ack_register;
> +	u64 read_ack_preserve;
> +	u64 read_ack_write;
> +};
> +
>  /* Generic Error Status block */
>  
>  struct acpi_hest_generic_status {
> @@ -632,6 +653,7 @@ struct acpi_hest_generic_data {
>  	u32 error_data_length;
>  	u8 fru_id[16];
>  	u8 fru_text[20];
> +	u64 time_stamp;
>  };
There is quite a bit of overlap between this patch and our patch series
(https://lkml.org/lkml/2016/2/5/544)

There are few things I see missing in this patch in your updates made to
actbl1.h, I list them below:

1) Adding time stamp as you did breaks backwards compatibility
(something we discovered during our testing).  We tried to remedy this
by adding a new version of the acpi_hest_generic_data structure.  Note
that we named it v3 to reflect this was the updated version number in
ACPI 6.1. (see https://lkml.org/lkml/2016/2/5/549)

2) Missing definition of generic error data validation bits, needed to
determine whether or not field being read are valid or not (see
https://lkml.org/lkml/2016/2/5/549)

3) Need to extend acpi_hest_notify_types to add GPIO, SEA, SEI, and GSIV
(see https://lkml.org/lkml/2016/2/5/545)

4) Also for the purpose of backwards compatibility, we needed to add
both acpi_hest_generic and acpi_hest_generic_v2 to the structure "ghes",
referencing the v2 pointer when needed. (https://lkml.org/lkml/2016/2/5/550)

Can you please review the above patch series patches for comparison, and
if in agreement, can you please update this patch to better align with
the changes we need?  We can rework our patch series to depend on your
patch series (i.e. leaving actbl1.h untouched on our side).

>  
>  /*******************************************************************************
> @@ -1015,6 +1037,7 @@ struct acpi_nfit_memory_map {
>  #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)	/* 03: Memory Device is not armed */
>  #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)	/* 04: Memory Device observed SMART/health events */
>  #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)	/* 05: SMART/health events enabled */
> +#define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)	/* 06: Mapping to SPA failed */
>  
>  /* 2: Interleave Structure */
>  
> diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
> index db46546..140886e 100644
> --- a/include/acpi/actypes.h
> +++ b/include/acpi/actypes.h
> @@ -630,7 +630,8 @@ typedef u64 acpi_integer;
>  #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (u8) 0x0C
>  #define ACPI_NOTIFY_AFFINITY_UPDATE     (u8) 0x0D
>  
> -#define ACPI_NOTIFY_MAX                 0x0D
> +#define ACPI_GENERIC_NOTIFY_MAX         0x0D
> +#define ACPI_SPECIFIC_NOTIFY_MAX        0x84
>  
>  /*
>   * Types associated with ACPI names and objects. The first group of
> 

Harb
-- 
Qualcomm Technologies, Inc.
on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* RE: [PATCH 12/15] ACPICA: ACPI 6.1: Add full support for this version of ACPI spec
  2016-02-20 21:41   ` Abdulhamid, Harb
@ 2016-02-24 16:22     ` Moore, Robert
  2016-02-24 17:02     ` Moore, Robert
  2016-02-24 17:39     ` Moore, Robert
  2 siblings, 0 replies; 37+ messages in thread
From: Moore, Robert @ 2016-02-24 16:22 UTC (permalink / raw)
  To: Abdulhamid, Harb, Zheng, Lv, Wysocki, Rafael J,
	Rafael J. Wysocki, Brown, Len
  Cc: Lv Zheng, linux-kernel, linux-acpi, Al Stone, fu.wei, tbaicar, rruigrok

> -----Original Message-----
> From: Abdulhamid, Harb [mailto:harba@codeaurora.org]
> Sent: Saturday, February 20, 2016 1:41 PM
> To: Zheng, Lv; Wysocki, Rafael J; Rafael J. Wysocki; Brown, Len
> Cc: Lv Zheng; linux-kernel@vger.kernel.org; linux-acpi@vger.kernel.org;
> Moore, Robert; Al Stone; fu.wei@linaro.org; tbaicar@codeaurora.org;
> rruigrok@codeaurora.org
> Subject: Re: [PATCH 12/15] ACPICA: ACPI 6.1: Add full support for this
> version of ACPI spec
> 
> On 2/19/2016 1:17 AM, Lv Zheng wrote:
> > From: Bob Moore <robert.moore@intel.com>
> >
> > ACPICA commit 5f21bddaa2cec035ca80608803ce2f0858d4f387
> >
> > Small changes:
> > 1) A couple new predefined names
> > 2) New _HID values
> I don't see where you are adding new _HID values in this patch.
> 

Not everything in the patch actually makes it into the Linux kernel. The new _HID values are for the AcpiHelp tables, which in turn are also used by the disassembler.







> > 3) New subtable for HEST
> >
> > Link: https://github.com/acpica/acpica/commit/5f21bdda
> > Signed-off-by: Bob Moore <robert.moore@intel.com>
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > ---
> >  drivers/acpi/acpica/acpredef.h |    9 +++++++++
> >  drivers/acpi/acpica/utdecode.c |   30 +++++++++++++++++-------------
> >  include/acpi/actbl.h           |    2 +-
> >  include/acpi/actbl1.h          |   29 ++++++++++++++++++++++++++---
> >  include/acpi/actypes.h         |    3 ++-
> >  5 files changed, 55 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/acpi/acpica/acpredef.h
> > b/drivers/acpi/acpica/acpredef.h index 5faeab4..4ca426b 100644
> > --- a/drivers/acpi/acpica/acpredef.h
> > +++ b/drivers/acpi/acpica/acpredef.h
> > @@ -523,6 +523,9 @@ const union acpi_predefined_info
> acpi_gbl_predefined_methods[] = {
> >  	  METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},	/* Fixed-length (4 Int) */
> >  	PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0),
> >
> > +	{{"_FIT", METHOD_0ARGS,
> > +	  METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},	/* ACPI 6.0 */
> > +
> >  	{{"_FIX", METHOD_0ARGS,
> >  	  METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},	/* Variable-length (Ints)
> */
> >  	PACKAGE_INFO(ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0, 0, 0, 0), @@
> > -1053,6 +1056,12 @@ const union acpi_predefined_info
> acpi_gbl_predefined_methods[] = {
> >  	  METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING |
> >  			 ACPI_RTYPE_BUFFER)}},
> >
> > +	{{"_WPC", METHOD_0ARGS,
> > +	  METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},	/* ACPI 6.1 */
> > +
> > +	{{"_WPP", METHOD_0ARGS,
> > +	  METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},	/* ACPI 6.1 */
> > +
> >  	PACKAGE_INFO(0, 0, 0, 0, 0, 0)	/* Table terminator */
> >  };
> >  #else
> > diff --git a/drivers/acpi/acpica/utdecode.c
> > b/drivers/acpi/acpica/utdecode.c index 6ba65b0..efd7988 100644
> > --- a/drivers/acpi/acpica/utdecode.c
> > +++ b/drivers/acpi/acpica/utdecode.c
> > @@ -446,7 +446,7 @@ const char *acpi_ut_get_mutex_name(u32 mutex_id)
> >
> >  /* Names for Notify() values, used for debug output */
> >
> > -static const char *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = {
> > +static const char *acpi_gbl_generic_notify[ACPI_GENERIC_NOTIFY_MAX +
> > +1] = {
> >  	/* 00 */ "Bus Check",
> >  	/* 01 */ "Device Check",
> >  	/* 02 */ "Device Wake",
> > @@ -459,49 +459,53 @@ static const char
> *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = {
> >  	/* 09 */ "Device PLD Check",
> >  	/* 0A */ "Reserved",
> >  	/* 0B */ "System Locality Update",
> > -	/* 0C */ "Shutdown Request",
> > +					/* 0C */ "Shutdown Request",
> > +					/* Reserved in ACPI 6.0 */
> >  	/* 0D */ "System Resource Affinity Update"
> >  };
> >
> > -static const char *acpi_gbl_device_notify[4] = {
> > +static const char *acpi_gbl_device_notify[5] = {
> >  	/* 80 */ "Status Change",
> >  	/* 81 */ "Information Change",
> >  	/* 82 */ "Device-Specific Change",
> > -	/* 83 */ "Device-Specific Change"
> > +	/* 83 */ "Device-Specific Change",
> > +	/* 84 */ "Reserved"
> >  };
> >
> > -static const char *acpi_gbl_processor_notify[4] = {
> > +static const char *acpi_gbl_processor_notify[5] = {
> >  	/* 80 */ "Performance Capability Change",
> >  	/* 81 */ "C-State Change",
> >  	/* 82 */ "Throttling Capability Change",
> > -	/* 83 */ "Device-Specific Change"
> > +	/* 83 */ "Guaranteed Change",
> > +	/* 84 */ "Minimum Excursion"
> >  };
> >
> > -static const char *acpi_gbl_thermal_notify[4] = {
> > +static const char *acpi_gbl_thermal_notify[5] = {
> >  	/* 80 */ "Thermal Status Change",
> >  	/* 81 */ "Thermal Trip Point Change",
> >  	/* 82 */ "Thermal Device List Change",
> > -	/* 83 */ "Thermal Relationship Change"
> > +	/* 83 */ "Thermal Relationship Change",
> > +	/* 84 */ "Reserved"
> >  };
> >
> >  const char *acpi_ut_get_notify_name(u32 notify_value,
> > acpi_object_type type)  {
> >
> > -	/* 00 - 0D are common to all object types */
> > +	/* 00 - 0D are "common to all object types" (from ACPI Spec) */
> >
> > -	if (notify_value <= ACPI_NOTIFY_MAX) {
> > +	if (notify_value <= ACPI_GENERIC_NOTIFY_MAX) {
> >  		return (acpi_gbl_generic_notify[notify_value]);
> >  	}
> >
> > -	/* 0D - 7F are reserved */
> > +	/* 0E - 7F are reserved */
> >
> >  	if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
> >  		return ("Reserved");
> >  	}
> >
> > -	/* 80 - 83 are per-object-type */
> > +	/* 80 - 84 are per-object-type */
> >
> > -	if (notify_value <= 0x83) {
> > +	if (notify_value <= ACPI_SPECIFIC_NOTIFY_MAX) {
> >  		switch (type) {
> >  		case ACPI_TYPE_ANY:
> >  		case ACPI_TYPE_DEVICE:
> > diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index
> > 0cb1a00..6a4e521 100644
> > --- a/include/acpi/actbl.h
> > +++ b/include/acpi/actbl.h
> > @@ -223,7 +223,7 @@ struct acpi_table_facs {
> >
> /*************************************************************************
> ******
> >   *
> >   * FADT - Fixed ACPI Description Table (Signature "FACP")
> > - *        Version 4
> > + *        Version 6
> >   *
> >
> > **********************************************************************
> > ********/
> >
> > diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index
> > 16e0136..26494dd 100644
> > --- a/include/acpi/actbl1.h
> > +++ b/include/acpi/actbl1.h
> > @@ -236,7 +236,8 @@ enum acpi_einj_actions {
> >  	ACPI_EINJ_CHECK_BUSY_STATUS = 6,
> >  	ACPI_EINJ_GET_COMMAND_STATUS = 7,
> >  	ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
> > -	ACPI_EINJ_ACTION_RESERVED = 9,	/* 9 and greater are reserved */
> > +	ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
> > +	ACPI_EINJ_ACTION_RESERVED = 10,	/* 10 and greater are reserved
> */
> >  	ACPI_EINJ_TRIGGER_ERROR = 0xFF	/* Except for this value */
> >  };
> >
> > @@ -348,7 +349,8 @@ enum acpi_erst_actions {
> >  	ACPI_ERST_GET_ERROR_RANGE = 13,
> >  	ACPI_ERST_GET_ERROR_LENGTH = 14,
> >  	ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
> > -	ACPI_ERST_ACTION_RESERVED = 16	/* 16 and greater are reserved
> */
> > +	ACPI_ERST_EXECUTE_TIMINGS = 16,
> > +	ACPI_ERST_ACTION_RESERVED = 17	/* 17 and greater are reserved
> */
> >  };
> >
> >  /* Values for Instruction field above */ @@ -427,7 +429,8 @@ enum
> > acpi_hest_types {
> >  	ACPI_HEST_TYPE_AER_ENDPOINT = 7,
> >  	ACPI_HEST_TYPE_AER_BRIDGE = 8,
> >  	ACPI_HEST_TYPE_GENERIC_ERROR = 9,
> > -	ACPI_HEST_TYPE_RESERVED = 10	/* 10 and greater are reserved */
> > +	ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
> > +	ACPI_HEST_TYPE_RESERVED = 11	/* 11 and greater are reserved */
> >  };
> >
> >  /*
> > @@ -603,6 +606,24 @@ struct acpi_hest_generic {
> >  	u32 error_block_length;
> >  };
> >
> > +/* 10: Generic Hardware Error Source, version 2 */
> > +
> > +struct acpi_hest_generic_v2 {
> > +	struct acpi_hest_header header;
> > +	u16 related_source_id;
> > +	u8 reserved;
> > +	u8 enabled;
> > +	u32 records_to_preallocate;
> > +	u32 max_sections_per_record;
> > +	u32 max_raw_data_length;
> > +	struct acpi_generic_address error_status_address;
> > +	struct acpi_hest_notify notify;
> > +	u32 error_block_length;
> > +	struct acpi_generic_address read_ack_register;
> > +	u64 read_ack_preserve;
> > +	u64 read_ack_write;
> > +};
> > +
> >  /* Generic Error Status block */
> >
> >  struct acpi_hest_generic_status {
> > @@ -632,6 +653,7 @@ struct acpi_hest_generic_data {
> >  	u32 error_data_length;
> >  	u8 fru_id[16];
> >  	u8 fru_text[20];
> > +	u64 time_stamp;
> >  };
> There is quite a bit of overlap between this patch and our patch series
> (https://lkml.org/lkml/2016/2/5/544)
> 
> There are few things I see missing in this patch in your updates made to
> actbl1.h, I list them below:
> 
> 1) Adding time stamp as you did breaks backwards compatibility (something
> we discovered during our testing).  We tried to remedy this by adding a
> new version of the acpi_hest_generic_data structure.  Note that we named
> it v3 to reflect this was the updated version number in ACPI 6.1. (see
> https://lkml.org/lkml/2016/2/5/549)
> 
> 2) Missing definition of generic error data validation bits, needed to
> determine whether or not field being read are valid or not (see
> https://lkml.org/lkml/2016/2/5/549)
> 
> 3) Need to extend acpi_hest_notify_types to add GPIO, SEA, SEI, and GSIV
> (see https://lkml.org/lkml/2016/2/5/545)
> 
> 4) Also for the purpose of backwards compatibility, we needed to add both
> acpi_hest_generic and acpi_hest_generic_v2 to the structure "ghes",
> referencing the v2 pointer when needed.
> (https://lkml.org/lkml/2016/2/5/550)
> 
> Can you please review the above patch series patches for comparison, and
> if in agreement, can you please update this patch to better align with the
> changes we need?  We can rework our patch series to depend on your patch
> series (i.e. leaving actbl1.h untouched on our side).
> 
> >
> >
> > /*********************************************************************
> > ********** @@ -1015,6 +1037,7 @@ struct acpi_nfit_memory_map {
> >  #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)	/* 03: Memory Device
> is not armed */
> >  #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)	/* 04: Memory Device
> observed SMART/health events */
> >  #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)	/* 05: SMART/health
> events enabled */
> > +#define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)	/* 06: Mapping to
> SPA failed */
> >
> >  /* 2: Interleave Structure */
> >
> > diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index
> > db46546..140886e 100644
> > --- a/include/acpi/actypes.h
> > +++ b/include/acpi/actypes.h
> > @@ -630,7 +630,8 @@ typedef u64 acpi_integer;
> >  #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (u8) 0x0C
> >  #define ACPI_NOTIFY_AFFINITY_UPDATE     (u8) 0x0D
> >
> > -#define ACPI_NOTIFY_MAX                 0x0D
> > +#define ACPI_GENERIC_NOTIFY_MAX         0x0D
> > +#define ACPI_SPECIFIC_NOTIFY_MAX        0x84
> >
> >  /*
> >   * Types associated with ACPI names and objects. The first group of
> >
> 
> Harb
> --
> Qualcomm Technologies, Inc.
> on behalf of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project

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

* RE: [PATCH 12/15] ACPICA: ACPI 6.1: Add full support for this version of ACPI spec
  2016-02-20 21:41   ` Abdulhamid, Harb
  2016-02-24 16:22     ` Moore, Robert
@ 2016-02-24 17:02     ` Moore, Robert
  2016-02-24 17:39     ` Moore, Robert
  2 siblings, 0 replies; 37+ messages in thread
From: Moore, Robert @ 2016-02-24 17:02 UTC (permalink / raw)
  To: Abdulhamid, Harb, Zheng, Lv, Wysocki, Rafael J,
	Rafael J. Wysocki, Brown, Len
  Cc: Lv Zheng, linux-kernel, linux-acpi, Al Stone, fu.wei, tbaicar, rruigrok

Yes, looks like we missed the revision update for the generic update.

We will update the actbl1.h file

Thanks,
Bob


> -----Original Message-----
> From: Abdulhamid, Harb [mailto:harba@codeaurora.org]
> Sent: Saturday, February 20, 2016 1:41 PM
> To: Zheng, Lv; Wysocki, Rafael J; Rafael J. Wysocki; Brown, Len
> Cc: Lv Zheng; linux-kernel@vger.kernel.org; linux-acpi@vger.kernel.org;
> Moore, Robert; Al Stone; fu.wei@linaro.org; tbaicar@codeaurora.org;
> rruigrok@codeaurora.org
> Subject: Re: [PATCH 12/15] ACPICA: ACPI 6.1: Add full support for this
> version of ACPI spec
> 
> On 2/19/2016 1:17 AM, Lv Zheng wrote:
> > From: Bob Moore <robert.moore@intel.com>
> >
> > ACPICA commit 5f21bddaa2cec035ca80608803ce2f0858d4f387
> >
> > Small changes:
> > 1) A couple new predefined names
> > 2) New _HID values
> I don't see where you are adding new _HID values in this patch.
> 
> > 3) New subtable for HEST
> >
> > Link: https://github.com/acpica/acpica/commit/5f21bdda
> > Signed-off-by: Bob Moore <robert.moore@intel.com>
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > ---
> >  drivers/acpi/acpica/acpredef.h |    9 +++++++++
> >  drivers/acpi/acpica/utdecode.c |   30 +++++++++++++++++-------------
> >  include/acpi/actbl.h           |    2 +-
> >  include/acpi/actbl1.h          |   29 ++++++++++++++++++++++++++---
> >  include/acpi/actypes.h         |    3 ++-
> >  5 files changed, 55 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/acpi/acpica/acpredef.h
> > b/drivers/acpi/acpica/acpredef.h index 5faeab4..4ca426b 100644
> > --- a/drivers/acpi/acpica/acpredef.h
> > +++ b/drivers/acpi/acpica/acpredef.h
> > @@ -523,6 +523,9 @@ const union acpi_predefined_info
> acpi_gbl_predefined_methods[] = {
> >  	  METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},	/* Fixed-length (4 Int) */
> >  	PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0),
> >
> > +	{{"_FIT", METHOD_0ARGS,
> > +	  METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},	/* ACPI 6.0 */
> > +
> >  	{{"_FIX", METHOD_0ARGS,
> >  	  METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}},	/* Variable-length (Ints)
> */
> >  	PACKAGE_INFO(ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0, 0, 0, 0), @@
> > -1053,6 +1056,12 @@ const union acpi_predefined_info
> acpi_gbl_predefined_methods[] = {
> >  	  METHOD_RETURNS(ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING |
> >  			 ACPI_RTYPE_BUFFER)}},
> >
> > +	{{"_WPC", METHOD_0ARGS,
> > +	  METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},	/* ACPI 6.1 */
> > +
> > +	{{"_WPP", METHOD_0ARGS,
> > +	  METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},	/* ACPI 6.1 */
> > +
> >  	PACKAGE_INFO(0, 0, 0, 0, 0, 0)	/* Table terminator */
> >  };
> >  #else
> > diff --git a/drivers/acpi/acpica/utdecode.c
> > b/drivers/acpi/acpica/utdecode.c index 6ba65b0..efd7988 100644
> > --- a/drivers/acpi/acpica/utdecode.c
> > +++ b/drivers/acpi/acpica/utdecode.c
> > @@ -446,7 +446,7 @@ const char *acpi_ut_get_mutex_name(u32 mutex_id)
> >
> >  /* Names for Notify() values, used for debug output */
> >
> > -static const char *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = {
> > +static const char *acpi_gbl_generic_notify[ACPI_GENERIC_NOTIFY_MAX +
> > +1] = {
> >  	/* 00 */ "Bus Check",
> >  	/* 01 */ "Device Check",
> >  	/* 02 */ "Device Wake",
> > @@ -459,49 +459,53 @@ static const char
> *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = {
> >  	/* 09 */ "Device PLD Check",
> >  	/* 0A */ "Reserved",
> >  	/* 0B */ "System Locality Update",
> > -	/* 0C */ "Shutdown Request",
> > +					/* 0C */ "Shutdown Request",
> > +					/* Reserved in ACPI 6.0 */
> >  	/* 0D */ "System Resource Affinity Update"
> >  };
> >
> > -static const char *acpi_gbl_device_notify[4] = {
> > +static const char *acpi_gbl_device_notify[5] = {
> >  	/* 80 */ "Status Change",
> >  	/* 81 */ "Information Change",
> >  	/* 82 */ "Device-Specific Change",
> > -	/* 83 */ "Device-Specific Change"
> > +	/* 83 */ "Device-Specific Change",
> > +	/* 84 */ "Reserved"
> >  };
> >
> > -static const char *acpi_gbl_processor_notify[4] = {
> > +static const char *acpi_gbl_processor_notify[5] = {
> >  	/* 80 */ "Performance Capability Change",
> >  	/* 81 */ "C-State Change",
> >  	/* 82 */ "Throttling Capability Change",
> > -	/* 83 */ "Device-Specific Change"
> > +	/* 83 */ "Guaranteed Change",
> > +	/* 84 */ "Minimum Excursion"
> >  };
> >
> > -static const char *acpi_gbl_thermal_notify[4] = {
> > +static const char *acpi_gbl_thermal_notify[5] = {
> >  	/* 80 */ "Thermal Status Change",
> >  	/* 81 */ "Thermal Trip Point Change",
> >  	/* 82 */ "Thermal Device List Change",
> > -	/* 83 */ "Thermal Relationship Change"
> > +	/* 83 */ "Thermal Relationship Change",
> > +	/* 84 */ "Reserved"
> >  };
> >
> >  const char *acpi_ut_get_notify_name(u32 notify_value,
> > acpi_object_type type)  {
> >
> > -	/* 00 - 0D are common to all object types */
> > +	/* 00 - 0D are "common to all object types" (from ACPI Spec) */
> >
> > -	if (notify_value <= ACPI_NOTIFY_MAX) {
> > +	if (notify_value <= ACPI_GENERIC_NOTIFY_MAX) {
> >  		return (acpi_gbl_generic_notify[notify_value]);
> >  	}
> >
> > -	/* 0D - 7F are reserved */
> > +	/* 0E - 7F are reserved */
> >
> >  	if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
> >  		return ("Reserved");
> >  	}
> >
> > -	/* 80 - 83 are per-object-type */
> > +	/* 80 - 84 are per-object-type */
> >
> > -	if (notify_value <= 0x83) {
> > +	if (notify_value <= ACPI_SPECIFIC_NOTIFY_MAX) {
> >  		switch (type) {
> >  		case ACPI_TYPE_ANY:
> >  		case ACPI_TYPE_DEVICE:
> > diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index
> > 0cb1a00..6a4e521 100644
> > --- a/include/acpi/actbl.h
> > +++ b/include/acpi/actbl.h
> > @@ -223,7 +223,7 @@ struct acpi_table_facs {
> >
> /*************************************************************************
> ******
> >   *
> >   * FADT - Fixed ACPI Description Table (Signature "FACP")
> > - *        Version 4
> > + *        Version 6
> >   *
> >
> > **********************************************************************
> > ********/
> >
> > diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index
> > 16e0136..26494dd 100644
> > --- a/include/acpi/actbl1.h
> > +++ b/include/acpi/actbl1.h
> > @@ -236,7 +236,8 @@ enum acpi_einj_actions {
> >  	ACPI_EINJ_CHECK_BUSY_STATUS = 6,
> >  	ACPI_EINJ_GET_COMMAND_STATUS = 7,
> >  	ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
> > -	ACPI_EINJ_ACTION_RESERVED = 9,	/* 9 and greater are reserved */
> > +	ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
> > +	ACPI_EINJ_ACTION_RESERVED = 10,	/* 10 and greater are reserved
> */
> >  	ACPI_EINJ_TRIGGER_ERROR = 0xFF	/* Except for this value */
> >  };
> >
> > @@ -348,7 +349,8 @@ enum acpi_erst_actions {
> >  	ACPI_ERST_GET_ERROR_RANGE = 13,
> >  	ACPI_ERST_GET_ERROR_LENGTH = 14,
> >  	ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
> > -	ACPI_ERST_ACTION_RESERVED = 16	/* 16 and greater are reserved
> */
> > +	ACPI_ERST_EXECUTE_TIMINGS = 16,
> > +	ACPI_ERST_ACTION_RESERVED = 17	/* 17 and greater are reserved
> */
> >  };
> >
> >  /* Values for Instruction field above */ @@ -427,7 +429,8 @@ enum
> > acpi_hest_types {
> >  	ACPI_HEST_TYPE_AER_ENDPOINT = 7,
> >  	ACPI_HEST_TYPE_AER_BRIDGE = 8,
> >  	ACPI_HEST_TYPE_GENERIC_ERROR = 9,
> > -	ACPI_HEST_TYPE_RESERVED = 10	/* 10 and greater are reserved */
> > +	ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
> > +	ACPI_HEST_TYPE_RESERVED = 11	/* 11 and greater are reserved */
> >  };
> >
> >  /*
> > @@ -603,6 +606,24 @@ struct acpi_hest_generic {
> >  	u32 error_block_length;
> >  };
> >
> > +/* 10: Generic Hardware Error Source, version 2 */
> > +
> > +struct acpi_hest_generic_v2 {
> > +	struct acpi_hest_header header;
> > +	u16 related_source_id;
> > +	u8 reserved;
> > +	u8 enabled;
> > +	u32 records_to_preallocate;
> > +	u32 max_sections_per_record;
> > +	u32 max_raw_data_length;
> > +	struct acpi_generic_address error_status_address;
> > +	struct acpi_hest_notify notify;
> > +	u32 error_block_length;
> > +	struct acpi_generic_address read_ack_register;
> > +	u64 read_ack_preserve;
> > +	u64 read_ack_write;
> > +};
> > +
> >  /* Generic Error Status block */
> >
> >  struct acpi_hest_generic_status {
> > @@ -632,6 +653,7 @@ struct acpi_hest_generic_data {
> >  	u32 error_data_length;
> >  	u8 fru_id[16];
> >  	u8 fru_text[20];
> > +	u64 time_stamp;
> >  };
> There is quite a bit of overlap between this patch and our patch series
> (https://lkml.org/lkml/2016/2/5/544)
> 
> There are few things I see missing in this patch in your updates made to
> actbl1.h, I list them below:
> 
> 1) Adding time stamp as you did breaks backwards compatibility (something
> we discovered during our testing).  We tried to remedy this by adding a
> new version of the acpi_hest_generic_data structure.  Note that we named
> it v3 to reflect this was the updated version number in ACPI 6.1. (see
> https://lkml.org/lkml/2016/2/5/549)
> 
> 2) Missing definition of generic error data validation bits, needed to
> determine whether or not field being read are valid or not (see
> https://lkml.org/lkml/2016/2/5/549)
> 
> 3) Need to extend acpi_hest_notify_types to add GPIO, SEA, SEI, and GSIV
> (see https://lkml.org/lkml/2016/2/5/545)
> 
> 4) Also for the purpose of backwards compatibility, we needed to add both
> acpi_hest_generic and acpi_hest_generic_v2 to the structure "ghes",
> referencing the v2 pointer when needed.
> (https://lkml.org/lkml/2016/2/5/550)
> 
> Can you please review the above patch series patches for comparison, and
> if in agreement, can you please update this patch to better align with the
> changes we need?  We can rework our patch series to depend on your patch
> series (i.e. leaving actbl1.h untouched on our side).
> 
> >
> >
> > /*********************************************************************
> > ********** @@ -1015,6 +1037,7 @@ struct acpi_nfit_memory_map {
> >  #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)	/* 03: Memory Device
> is not armed */
> >  #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)	/* 04: Memory Device
> observed SMART/health events */
> >  #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)	/* 05: SMART/health
> events enabled */
> > +#define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)	/* 06: Mapping to
> SPA failed */
> >
> >  /* 2: Interleave Structure */
> >
> > diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index
> > db46546..140886e 100644
> > --- a/include/acpi/actypes.h
> > +++ b/include/acpi/actypes.h
> > @@ -630,7 +630,8 @@ typedef u64 acpi_integer;
> >  #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (u8) 0x0C
> >  #define ACPI_NOTIFY_AFFINITY_UPDATE     (u8) 0x0D
> >
> > -#define ACPI_NOTIFY_MAX                 0x0D
> > +#define ACPI_GENERIC_NOTIFY_MAX         0x0D
> > +#define ACPI_SPECIFIC_NOTIFY_MAX        0x84
> >
> >  /*
> >   * Types associated with ACPI names and objects. The first group of
> >
> 
> Harb
> --
> Qualcomm Technologies, Inc.
> on behalf of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project

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

* RE: [PATCH 12/15] ACPICA: ACPI 6.1: Add full support for this version of ACPI spec
  2016-02-20 21:41   ` Abdulhamid, Harb
  2016-02-24 16:22     ` Moore, Robert
  2016-02-24 17:02     ` Moore, Robert
@ 2016-02-24 17:39     ` Moore, Robert
  2016-02-24 23:18       ` Rafael J. Wysocki
  2 siblings, 1 reply; 37+ messages in thread
From: Moore, Robert @ 2016-02-24 17:39 UTC (permalink / raw)
  To: Abdulhamid, Harb, Zheng, Lv, Wysocki, Rafael J,
	Rafael J. Wysocki, Brown, Len
  Cc: Lv Zheng, linux-kernel, linux-acpi, Al Stone, fu.wei, tbaicar, rruigrok


 
> There are few things I see missing in this patch in your updates made to
> actbl1.h, I list them below:
> 
> 1) Adding time stamp as you did breaks backwards compatibility (something
> we discovered during our testing).  We tried to remedy this by adding a
> new version of the acpi_hest_generic_data structure.  Note that we named
> it v3 to reflect this was the updated version number in ACPI 6.1. (see
> https://lkml.org/lkml/2016/2/5/549)

I used V300 in case there is ever some other 3xx version.

Plus, I made a full struct for the V300 case.

> 
> 2) Missing definition of generic error data validation bits, needed to
> determine whether or not field being read are valid or not (see
> https://lkml.org/lkml/2016/2/5/549)

Done.

> 
> 3) Need to extend acpi_hest_notify_types to add GPIO, SEA, SEI, and GSIV
> (see https://lkml.org/lkml/2016/2/5/545)

Done.

> 
> 4) Also for the purpose of backwards compatibility, we needed to add both
> acpi_hest_generic and acpi_hest_generic_v2 to the structure "ghes",
> referencing the v2 pointer when needed.
> (https://lkml.org/lkml/2016/2/5/550)

This doesn't affect the ACPICA code (actbl1.h), I don't think.

> 
> Can you please review the above patch series patches for comparison, and
> if in agreement, can you please update this patch to better align with the
> changes we need?  We can rework our patch series to depend on your patch
> series (i.e. leaving actbl1.h untouched on our side).
> 
> >
> >
> > /*********************************************************************
> > ********** @@ -1015,6 +1037,7 @@ struct acpi_nfit_memory_map {
> >  #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)	/* 03: Memory Device
> is not armed */
> >  #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)	/* 04: Memory Device
> observed SMART/health events */
> >  #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)	/* 05: SMART/health
> events enabled */
> > +#define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)	/* 06: Mapping to
> SPA failed */
> >
> >  /* 2: Interleave Structure */
> >
> > diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index
> > db46546..140886e 100644
> > --- a/include/acpi/actypes.h
> > +++ b/include/acpi/actypes.h
> > @@ -630,7 +630,8 @@ typedef u64 acpi_integer;
> >  #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (u8) 0x0C
> >  #define ACPI_NOTIFY_AFFINITY_UPDATE     (u8) 0x0D
> >
> > -#define ACPI_NOTIFY_MAX                 0x0D
> > +#define ACPI_GENERIC_NOTIFY_MAX         0x0D
> > +#define ACPI_SPECIFIC_NOTIFY_MAX        0x84
> >
> >  /*
> >   * Types associated with ACPI names and objects. The first group of
> >
> 
> Harb
> --
> Qualcomm Technologies, Inc.
> on behalf of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project

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

* Re: [PATCH 12/15] ACPICA: ACPI 6.1: Add full support for this version of ACPI spec
  2016-02-24 17:39     ` Moore, Robert
@ 2016-02-24 23:18       ` Rafael J. Wysocki
  0 siblings, 0 replies; 37+ messages in thread
From: Rafael J. Wysocki @ 2016-02-24 23:18 UTC (permalink / raw)
  To: Moore, Robert
  Cc: Abdulhamid, Harb, Zheng, Lv, Wysocki, Rafael J, Brown, Len,
	Lv Zheng, linux-kernel, linux-acpi, Al Stone, fu.wei, tbaicar,
	rruigrok

Hi Bob,

On Wednesday, February 24, 2016 05:39:14 PM Moore, Robert wrote:
> 
> > There are few things I see missing in this patch in your updates made to
> > actbl1.h, I list them below:
> > 
> > 1) Adding time stamp as you did breaks backwards compatibility (something
> > we discovered during our testing).  We tried to remedy this by adding a
> > new version of the acpi_hest_generic_data structure.  Note that we named
> > it v3 to reflect this was the updated version number in ACPI 6.1. (see
> > https://lkml.org/lkml/2016/2/5/549)
> 
> I used V300 in case there is ever some other 3xx version.
> 
> Plus, I made a full struct for the V300 case.
> 
> > 
> > 2) Missing definition of generic error data validation bits, needed to
> > determine whether or not field being read are valid or not (see
> > https://lkml.org/lkml/2016/2/5/549)
> 
> Done.
> 
> > 
> > 3) Need to extend acpi_hest_notify_types to add GPIO, SEA, SEI, and GSIV
> > (see https://lkml.org/lkml/2016/2/5/545)
> 
> Done.

OK

Should I expect an update of the $subject patch, then, or will there be a new
patch on top of it?

Thanks,
Rafael


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

end of thread, other threads:[~2016-02-24 23:17 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-19  6:15 [PATCH 00/15] ACPICA: 20160212 Release Lv Zheng
2016-02-19  6:15 ` Lv Zheng
2016-02-19  6:16 ` [PATCH 01/15] ACPICA: aclocal: Put parens around some definitions Lv Zheng
2016-02-19  6:16   ` Lv Zheng
2016-02-19  6:16 ` [PATCH 02/15] ACPICA: Remove incorrect "static" from a global structure Lv Zheng
2016-02-19  6:16   ` Lv Zheng
2016-02-19  6:16 ` [PATCH 03/15] ACPICA: iASL: Fix some typos with the name strtoul64 Lv Zheng
2016-02-19  6:16   ` Lv Zheng
2016-02-19  6:16 ` [PATCH 04/15] ACPICA: iASL: Update to use internal acpi_ut_strtoul64 function Lv Zheng
2016-02-19  6:16   ` Lv Zheng
2016-02-19  6:16 ` [PATCH 05/15] ACPICA: debugger: dbconvert: free pld_info on error return path Lv Zheng
2016-02-19  6:16   ` Lv Zheng
2016-02-19  6:16 ` [PATCH 06/15] ACPICA: Remove unnecessary arguments to ACPI_INFO Lv Zheng
2016-02-19  6:16   ` Lv Zheng
2016-02-19  6:16 ` [PATCH 07/15] ACPICA: ACPI 6.0/iASL: Add support for the External AML opcode Lv Zheng
2016-02-19  6:16   ` Lv Zheng
2016-02-19  6:16 ` [PATCH 08/15] ACPICA: Tables: make default region accessible during the table load Lv Zheng
2016-02-19  6:16   ` Lv Zheng
2016-02-19  6:17 ` [PATCH 09/15] ACPICA: ACPICA: Tune _REG evaluations order in the initialization steps Lv Zheng
2016-02-19  6:17   ` Lv Zheng
2016-02-19  6:17 ` [PATCH 10/15] ACPICA: Namespace: Ensure \_SB._INI executed before any _REG Lv Zheng
2016-02-19  6:17   ` Lv Zheng
2016-02-19  6:17 ` [PATCH 11/15] ACPICA: Namespace: Rename acpi_gbl_reg_methods_enabled to acpi_gbl_namespace_initialized Lv Zheng
2016-02-19  6:17   ` Lv Zheng
2016-02-19  6:17 ` [PATCH 12/15] ACPICA: ACPI 6.1: Add full support for this version of ACPI spec Lv Zheng
2016-02-19  6:17   ` Lv Zheng
2016-02-20 21:41   ` Abdulhamid, Harb
2016-02-24 16:22     ` Moore, Robert
2016-02-24 17:02     ` Moore, Robert
2016-02-24 17:39     ` Moore, Robert
2016-02-24 23:18       ` Rafael J. Wysocki
2016-02-19  6:17 ` [PATCH 13/15] ACPICA: Revert "Parser: Fix for SuperName method invocation" Lv Zheng
2016-02-19  6:17   ` Lv Zheng
2016-02-19  6:17 ` [PATCH 14/15] ACPICA: Utilities: Update trace mechinism for acquire_object Lv Zheng
2016-02-19  6:17   ` Lv Zheng
2016-02-19  6:17 ` [PATCH 15/15] ACPICA: Update version to 20160212 Lv Zheng
2016-02-19  6:17   ` Lv Zheng

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.