Skip to contentSkip to conversation

ACPI/PRM: Deal with table not present or no module found

PATCH Applied Aubrey Li 3 participants 3 messages Aug 6, 2021 – Aug 8, 2021 ACPI

lore
Share & tools
lore

Aubrey Li

author
#0 lore raw

PATCH 1/1 ACPI/PRM: Deal with table not present or no module found

On the system PRMT table is not present, dmesg output:

	$ dmesg | grep PRM
	[    1.532237] ACPI: PRMT not present
	[    1.532237] PRM: found 4294967277 modules

The result of acpi_table_parse_entries need to be checked and return immediately if PRMT table is not present or no PRM module found.

---
 drivers/acpi/prmt.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/acpi/prmt.c +6 -0
index 31cf9ae..1f6007a 100644
@@ -292,6 +292,12 @@ void __init init_prmt(void)
 	int mc = acpi_table_parse_entries(ACPI_SIG_PRMT, sizeof(struct acpi_table_prmt) +
 					  sizeof (struct acpi_table_prmt_header),
 					  0, acpi_parse_prmt, 0);
+	/*
+	 * Return immediately if PRMT table is not present or no PRM module found.
+	 */
+	if (mc <= 0)
+		return;
+
 	pr_info("PRM: found %u modules\n", mc);
 
 	status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT,
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 23 lines · Aubrey Li

On the system PRMT table is not present, dmesg output:

        $ dmesg | grep PRM
        [    1.532237] ACPI: PRMT not present
        [    1.532237] PRM: found 4294967277 modules

The result of acpi_table_parse_entries need to be checked and return immediately if PRMT table is not present or no PRM module found.

---
 drivers/acpi/prmt.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/acpi/prmt.c +0 -0
index 31cf9ae..1f6007a 100644
@@ -292,6 +292,12 @@ void __init init_prmt(void)
        int mc = acpi_table_parse_entries(ACPI_SIG_PRMT, sizeof(struct acpi_table_prmt) +
                                          sizeof (struct acpi_table_prmt_header),
                                          0, acpi_parse_prmt, 0);

drivers/acpi/prmt.c void __init init_prmt(void)

Quoted 10 lines
drivers/acpi/prmt.c +6 -1
+       /*
+        * Return immediately if PRMT table is not present or no PRM module found.
+        */
+       if (mc <= 0)
+               return;
+
        pr_info("PRM: found %u modules\n", mc);
 
        status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT,
--

Applied as 5.14-rc material, thanks!

However, since I'm on vacation next week, it will get into linux-next after -rc6.

#2 lore raw
Quoted 32 lines · Rafael J. Wysocki
Quoted 31 lines · Aubrey Li

On the system PRMT table is not present, dmesg output:

        $ dmesg | grep PRM
        [    1.532237] ACPI: PRMT not present
        [    1.532237] PRM: found 4294967277 modules

The result of acpi_table_parse_entries need to be checked and return immediately if PRMT table is not present or no PRM module found.

---
 drivers/acpi/prmt.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/acpi/prmt.c +6 -0
index 31cf9ae..1f6007a 100644
@@ -292,6 +292,12 @@ void __init init_prmt(void)
        int mc = acpi_table_parse_entries(ACPI_SIG_PRMT, sizeof(struct acpi_table_prmt) +
                                          sizeof (struct acpi_table_prmt_header),
                                          0, acpi_parse_prmt, 0);
+       /*
+        * Return immediately if PRMT table is not present or no PRM module found.
+        */
+       if (mc <= 0)
+               return;
+
        pr_info("PRM: found %u modules\n", mc);
 
Quoted 8 lines

drivers/acpi/prmt.c void __init init_prmt(void)

Quoted 2 lines
drivers/acpi/prmt.c +0 -1
        status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT,
--

Applied as 5.14-rc material, thanks!

However, since I'm on vacation next week, it will get into linux-next after -rc6.

Thanks Rafael!