Linux-ACPI Archive on lore.kernel.org
 help / color / Atom feed
* [Patch] ACPICA: Increase AE_OWNER_ID_LIMIT to 2047
@ 2019-05-30 17:45 Hedi Berriche
  2019-05-30 21:43 ` Schmauss, Erik
  0 siblings, 1 reply; 2+ messages in thread
From: Hedi Berriche @ 2019-05-30 17:45 UTC (permalink / raw)
  To: linux-acpi, linux-kernel
  Cc: Hedi Berriche, Russ Anderson, Mike Travis, Frank Ramsay,
	Robert Moore, Erik Schmauss, Rafael J . Wysocki

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 ffff9e2fffd8e280), AE_OWNER_ID_LIMIT (20170303/psparse-543)
ACPI Error: Method parse/execution failed [\_SB.NVDR.N031.CR05] (Node ffff9547ffd91bb8), AE_OWNER_ID_LIMIT (20170303/psparse-543)
ACPI Error: Method parse/execution failed [\_SB.NVDR.N031.CRLD] (Node ffff8e99ffd92550), AE_OWNER_ID_LIMIT (20170303/psparse-543)
ACPI Error: Method parse/execution failed [\_SB.NVDR.N031._DSM] (Node ffffadc5ffd90e88), 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 <hedi.berriche@hpe.com>
Cc: Russ Anderson <rja@hpe.com>
Cc: Mike Travis <mike.travis@hpe.com>
Cc: Frank Ramsay <frank.ramsay@hpe.com>
Cc: Robert Moore <robert.moore@intel.com>
Cc: Erik Schmauss <erik.schmauss@intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 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


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

* RE: [Patch] ACPICA: Increase AE_OWNER_ID_LIMIT to 2047
  2019-05-30 17:45 [Patch] ACPICA: Increase AE_OWNER_ID_LIMIT to 2047 Hedi Berriche
@ 2019-05-30 21:43 ` Schmauss, Erik
  0 siblings, 0 replies; 2+ messages in thread
From: Schmauss, Erik @ 2019-05-30 21:43 UTC (permalink / raw)
  To: Hedi Berriche, linux-acpi, linux-kernel
  Cc: Russ Anderson, Mike Travis, Frank Ramsay, Moore, Robert, Wysocki,
	Rafael J



> -----Original Message-----
> From: Hedi Berriche [mailto:hedi.berriche@hpe.com]
> Sent: Thursday, May 30, 2019 10:45 AM
> To: linux-acpi@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: Hedi Berriche <hedi.berriche@hpe.com>; Russ Anderson
> <rja@hpe.com>; Mike Travis <mike.travis@hpe.com>; Frank Ramsay
> <frank.ramsay@hpe.com>; Moore, Robert <robert.moore@intel.com>;
> Schmauss, Erik <erik.schmauss@intel.com>; Wysocki, Rafael J
> <rafael.j.wysocki@intel.com>
> 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 ffff9e2fffd8e280), AE_OWNER_ID_LIMIT
> (20170303/psparse-543) ACPI Error: Method parse/execution failed
> [\_SB.NVDR.N031.CR05] (Node ffff9547ffd91bb8), AE_OWNER_ID_LIMIT
> (20170303/psparse-543) ACPI Error: Method parse/execution failed
> [\_SB.NVDR.N031.CRLD] (Node ffff8e99ffd92550), AE_OWNER_ID_LIMIT
> (20170303/psparse-543) ACPI Error: Method parse/execution failed
> [\_SB.NVDR.N031._DSM] (Node ffffadc5ffd90e88), 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 <hedi.berriche@hpe.com>
> Cc: Russ Anderson <rja@hpe.com>
> Cc: Mike Travis <mike.travis@hpe.com>
> Cc: Frank Ramsay <frank.ramsay@hpe.com>
> Cc: Robert Moore <robert.moore@intel.com>
> Cc: Erik Schmauss <erik.schmauss@intel.com>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  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

Why 0x7ff?
Why not just go to 0xFFFF?

Thanks,
Erik
> 
>  #define ACPI_INTEGER_BIT_SIZE           64
>  #define ACPI_MAX_DECIMAL_DIGITS         20	/* 2^64 =
> 18,446,744,073,709,551,616 */
> --
> 2.20.1


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-30 17:45 [Patch] ACPICA: Increase AE_OWNER_ID_LIMIT to 2047 Hedi Berriche
2019-05-30 21:43 ` Schmauss, Erik

Linux-ACPI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-acpi/0 linux-acpi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-acpi linux-acpi/ https://lore.kernel.org/linux-acpi \
		linux-acpi@vger.kernel.org linux-acpi@archiver.kernel.org
	public-inbox-index linux-acpi


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-acpi


AGPL code for this site: git clone https://public-inbox.org/ public-inbox