* [PATCH] ACPI/PRM: Deal with table not present or no module found
@ 2021-08-06 0:46 Aubrey Li
2021-08-06 13:23 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Aubrey Li @ 2021-08-06 0:46 UTC (permalink / raw)
To: rjw, lenb; +Cc: linux-acpi, linux-kernel, Aubrey Li, 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.
Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
---
drivers/acpi/prmt.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c
index 31cf9ae..1f6007a 100644
--- a/drivers/acpi/prmt.c
+++ b/drivers/acpi/prmt.c
@@ -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,
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI/PRM: Deal with table not present or no module found
2021-08-06 0:46 [PATCH] ACPI/PRM: Deal with table not present or no module found Aubrey Li
@ 2021-08-06 13:23 ` Rafael J. Wysocki
2021-08-08 23:53 ` Aubrey Li
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2021-08-06 13:23 UTC (permalink / raw)
To: Aubrey Li
Cc: Rafael J. Wysocki, Len Brown, ACPI Devel Maling List,
Linux Kernel Mailing List, Aubrey Li
On Fri, Aug 6, 2021 at 2:48 AM Aubrey Li <aubrey.li@intel.com> wrote:
>
> 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.
>
> Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
> ---
> drivers/acpi/prmt.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c
> index 31cf9ae..1f6007a 100644
> --- a/drivers/acpi/prmt.c
> +++ b/drivers/acpi/prmt.c
> @@ -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,
> --
Applied as 5.14-rc material, thanks!
However, since I'm on vacation next week, it will get into linux-next
after -rc6.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI/PRM: Deal with table not present or no module found
2021-08-06 13:23 ` Rafael J. Wysocki
@ 2021-08-08 23:53 ` Aubrey Li
0 siblings, 0 replies; 3+ messages in thread
From: Aubrey Li @ 2021-08-08 23:53 UTC (permalink / raw)
To: Rafael J. Wysocki, Aubrey Li
Cc: Rafael J. Wysocki, Len Brown, ACPI Devel Maling List,
Linux Kernel Mailing List
On 8/6/21 9:23 PM, Rafael J. Wysocki wrote:
> On Fri, Aug 6, 2021 at 2:48 AM Aubrey Li <aubrey.li@intel.com> wrote:
>>
>> 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.
>>
>> Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
>> ---
>> drivers/acpi/prmt.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c
>> index 31cf9ae..1f6007a 100644
>> --- a/drivers/acpi/prmt.c
>> +++ b/drivers/acpi/prmt.c
>> @@ -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,
>> --
>
> 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!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-08 14:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 0:46 [PATCH] ACPI/PRM: Deal with table not present or no module found Aubrey Li
2021-08-06 13:23 ` Rafael J. Wysocki
2021-08-08 23:53 ` Aubrey Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).