RE: [Patch] ACPICA: Increase AE_OWNER_ID_LIMIT to 2047

2019-05-30 Thread Schmauss, Erik



> -Original Message-
> From: Hedi Berriche [mailto:hedi.berri...@hpe.com]
> Sent: Thursday, May 30, 2019 10:45 AM
> To: linux-a...@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: Hedi Berriche ; Russ Anderson
> ; Mike Travis ; Frank Ramsay
> ; Moore, Robert ;
> Schmauss, Erik ; Wysocki, Rafael J
> 
> Subject: [Patch] ACPICA: Increase AE_OWNER_ID_LIMIT to 2047
> 
> 32 sockets systems with 192 NVDIMMs run into the ACPI_OWNER_ID_MAX
> limit which is currently set to 255, and nfit kernel module initialisation 
> fails
> with the following representative error messages:
> 
> ACPI Error: Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT
> (20170303/utownerid-149 ACPI Error: Method parse/execution failed
> [\_SB.NVDR.N031.PCDR] (Node 9e2fffd8e280), AE_OWNER_ID_LIMIT
> (20170303/psparse-543) ACPI Error: Method parse/execution failed
> [\_SB.NVDR.N031.CR05] (Node 9547ffd91bb8), AE_OWNER_ID_LIMIT
> (20170303/psparse-543) ACPI Error: Method parse/execution failed
> [\_SB.NVDR.N031.CRLD] (Node 8e99ffd92550), AE_OWNER_ID_LIMIT
> (20170303/psparse-543) ACPI Error: Method parse/execution failed
> [\_SB.NVDR.N031._DSM] (Node adc5ffd90e88), AE_OWNER_ID_LIMIT
> (20170303/psparse-543)
> ACPI: \_SB_.NVDR.N031: failed to evaluate _DSM (0x1b)
> 
Hi,

> Further debugging shows that, on such a system, we end up using 1020
> owner IDs, hence I'm suggesting that we bump ACPI_OWNER_ID_MAX up to
> 2047.

Owner ID's increment for each ACPI table and for each control method invocation 
(and decreases after the method exits).
How are you using 1020 owner ID's? 

How many nested control methods does \_SB_.NVDR.N031._DSM invoke?
How many SSDT's does this machine have?

More comments below.

> 
> Signed-off-by: Hedi Berriche 
> Cc: Russ Anderson 
> Cc: Mike Travis 
> Cc: Frank Ramsay 
> Cc: Robert Moore 
> Cc: Erik Schmauss 
> Cc: Rafael J. Wysocki 
> ---
>  drivers/acpi/acpica/utownerid.c | 6 +++---
>  include/acpi/acconfig.h | 4 ++--
>  include/acpi/actypes.h  | 4 ++--
>  3 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/acpi/acpica/utownerid.c
> b/drivers/acpi/acpica/utownerid.c index 5eb8b76ce9d8..c015a2c147d9
> 100644
> --- a/drivers/acpi/acpica/utownerid.c
> +++ b/drivers/acpi/acpica/utownerid.c
> @@ -88,7 +88,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id
> *owner_id)
>   /*
>* Construct encoded ID from the index and
> bit position
>*
> -  * Note: Last [j].k (bit 255) is never used and
> is marked
> +  * Note: Last [j].k (bit 2047) is never used and
> is marked
>* permanently allocated (prevents +1
> overflow)
>*/
>   *owner_id =
> @@ -116,7 +116,7 @@ acpi_status
> acpi_ut_allocate_owner_id(acpi_owner_id *owner_id)
>*/
>   status = AE_OWNER_ID_LIMIT;
>   ACPI_ERROR((AE_INFO,
> - "Could not allocate new OwnerId (255 max),
> AE_OWNER_ID_LIMIT"));
> + "Could not allocate new OwnerId (2047 max),
> AE_OWNER_ID_LIMIT"));
> 
>  exit:
>   (void)acpi_ut_release_mutex(ACPI_MTX_CACHES);
> @@ -133,7 +133,7 @@ acpi_status
> acpi_ut_allocate_owner_id(acpi_owner_id *owner_id)
>   *  control method or unloading a table. Either way, we would
>   *  ignore any error anyway.
>   *
> - * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 255
> + * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 -
> + 2047
>   *
> 
> **
> /
> 
> diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index
> 16a83959e616..536fe9a81cb7 100644
> --- a/include/acpi/acconfig.h
> +++ b/include/acpi/acconfig.h
> @@ -95,9 +95,9 @@
> 
>  #define ACPI_DEFAULT_PAGE_SIZE  4096 /* Must be power of 2 */
> 
> -/* owner_id tracking. 8 entries allows for 255 owner_ids */
> +/* owner_id tracking. 64 entries allow for 2047 owner_ids */
> 
> -#define ACPI_NUM_OWNERID_MASKS  8
> +#define ACPI_NUM_OWNERID_MASKS  64
> 
>  /* Size of the root table array is increased by this increment */
> 
> diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index
> ad6892a24015..f32a4d49ea13 100644
> --- a/include/acpi/actypes.h
> +++ b/include/acpi/actypes.h
> @@ -442,8 +442,8 @@ typedef void *acpi_handle;/* Actually a ptr to a
> NS Node */
> 
>  /* Owner IDs are used to track

[Patch] ACPICA: Increase AE_OWNER_ID_LIMIT to 2047

2019-05-30 Thread Hedi Berriche
32 sockets systems with 192 NVDIMMs run into the ACPI_OWNER_ID_MAX limit
which is currently set to 255, and nfit kernel module initialisation fails
with the following representative error messages:

ACPI Error: Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT 
(20170303/utownerid-149
ACPI Error: Method parse/execution failed [\_SB.NVDR.N031.PCDR] (Node 
9e2fffd8e280), AE_OWNER_ID_LIMIT (20170303/psparse-543)
ACPI Error: Method parse/execution failed [\_SB.NVDR.N031.CR05] (Node 
9547ffd91bb8), AE_OWNER_ID_LIMIT (20170303/psparse-543)
ACPI Error: Method parse/execution failed [\_SB.NVDR.N031.CRLD] (Node 
8e99ffd92550), AE_OWNER_ID_LIMIT (20170303/psparse-543)
ACPI Error: Method parse/execution failed [\_SB.NVDR.N031._DSM] (Node 
adc5ffd90e88), AE_OWNER_ID_LIMIT (20170303/psparse-543)
ACPI: \_SB_.NVDR.N031: failed to evaluate _DSM (0x1b)

Further debugging shows that, on such a system, we end up using 1020 owner IDs,
hence I'm suggesting that we bump ACPI_OWNER_ID_MAX up to 2047.

Signed-off-by: Hedi Berriche 
Cc: Russ Anderson 
Cc: Mike Travis 
Cc: Frank Ramsay 
Cc: Robert Moore 
Cc: Erik Schmauss 
Cc: Rafael J. Wysocki 
---
 drivers/acpi/acpica/utownerid.c | 6 +++---
 include/acpi/acconfig.h | 4 ++--
 include/acpi/actypes.h  | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/acpica/utownerid.c b/drivers/acpi/acpica/utownerid.c
index 5eb8b76ce9d8..c015a2c147d9 100644
--- a/drivers/acpi/acpica/utownerid.c
+++ b/drivers/acpi/acpica/utownerid.c
@@ -88,7 +88,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id *owner_id)
/*
 * Construct encoded ID from the index and bit 
position
 *
-* Note: Last [j].k (bit 255) is never used and 
is marked
+* Note: Last [j].k (bit 2047) is never used 
and is marked
 * permanently allocated (prevents +1 overflow)
 */
*owner_id =
@@ -116,7 +116,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id 
*owner_id)
 */
status = AE_OWNER_ID_LIMIT;
ACPI_ERROR((AE_INFO,
-   "Could not allocate new OwnerId (255 max), 
AE_OWNER_ID_LIMIT"));
+   "Could not allocate new OwnerId (2047 max), 
AE_OWNER_ID_LIMIT"));
 
 exit:
(void)acpi_ut_release_mutex(ACPI_MTX_CACHES);
@@ -133,7 +133,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id 
*owner_id)
  *  control method or unloading a table. Either way, we would
  *  ignore any error anyway.
  *
- * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 255
+ * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 2047
  *
  
**/
 
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 16a83959e616..536fe9a81cb7 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -95,9 +95,9 @@
 
 #define ACPI_DEFAULT_PAGE_SIZE  4096   /* Must be power of 2 */
 
-/* owner_id tracking. 8 entries allows for 255 owner_ids */
+/* owner_id tracking. 64 entries allow for 2047 owner_ids */
 
-#define ACPI_NUM_OWNERID_MASKS  8
+#define ACPI_NUM_OWNERID_MASKS  64
 
 /* Size of the root table array is increased by this increment */
 
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index ad6892a24015..f32a4d49ea13 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -442,8 +442,8 @@ typedef void *acpi_handle;  /* Actually a ptr to a NS Node 
*/
 
 /* Owner IDs are used to track namespace nodes for selective deletion */
 
-typedef u8 acpi_owner_id;
-#define ACPI_OWNER_ID_MAX   0xFF
+typedef u16 acpi_owner_id;
+#define ACPI_OWNER_ID_MAX   0x7FF
 
 #define ACPI_INTEGER_BIT_SIZE   64
 #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 
18,446,744,073,709,551,616 */
-- 
2.20.1