* [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
@ 2025-05-22 14:13 Alexandre Ghiti
2025-05-22 14:18 ` Arnd Bergmann
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Alexandre Ghiti @ 2025-05-22 14:13 UTC (permalink / raw)
To: Rafael J . Wysocki, Len Brown, Ilpo Järvinen,
Mario Limonciello, Mark Pearson, Armin Wolf, Arnd Bergmann,
linux-acpi, linux-kernel, linux-riscv
Cc: Alexandre Ghiti
The platform profile driver is loaded even on platforms that do not have
acpi enabled. The initialization of the sysfs entries was recently moved
from platform_profile_register() to the module init call, and those
entries need acpi_kobj to be initialized which is not the case when acpi
is disabled.
This results in the following warning:
WARNING: CPU: 5 PID: 1 at fs/sysfs/group.c:131 internal_create_group+0xa22/0xdd8
Modules linked in:
CPU: 5 UID: 0 PID: 1 Comm: swapper/0 Tainted: G W 6.15.0-rc7-dirty #6 PREEMPT
Tainted: [W]=WARN
Hardware name: riscv-virtio,qemu (DT)
epc : internal_create_group+0xa22/0xdd8
ra : internal_create_group+0xa22/0xdd8
Call Trace:
internal_create_group+0xa22/0xdd8
sysfs_create_group+0x22/0x2e
platform_profile_init+0x74/0xb2
do_one_initcall+0x198/0xa9e
kernel_init_freeable+0x6d8/0x780
kernel_init+0x28/0x24c
ret_from_fork+0xe/0x18
Fix this by checking if acpi is enabled before trying to create sysfs
entries.
Fixes: 77be5cacb2c2 ("ACPI: platform_profile: Create class for ACPI platform profile")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
---
drivers/acpi/platform_profile.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
index ffbfd32f4cf1..b43f4459a4f6 100644
--- a/drivers/acpi/platform_profile.c
+++ b/drivers/acpi/platform_profile.c
@@ -688,6 +688,9 @@ static int __init platform_profile_init(void)
{
int err;
+ if (acpi_disabled)
+ return -EOPNOTSUPP;
+
err = class_register(&platform_profile_class);
if (err)
return err;
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
2025-05-22 14:13 [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms Alexandre Ghiti
@ 2025-05-22 14:18 ` Arnd Bergmann
2025-05-22 14:20 ` Mark Pearson
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2025-05-22 14:18 UTC (permalink / raw)
To: Alexandre Ghiti, Rafael J . Wysocki, Len Brown,
Ilpo Järvinen, Mario Limonciello, Mark Pearson, Armin Wolf,
linux-acpi, linux-kernel, linux-riscv
On Thu, May 22, 2025, at 16:13, Alexandre Ghiti wrote:
> Fixes: 77be5cacb2c2 ("ACPI: platform_profile: Create class for ACPI
> platform profile")
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
2025-05-22 14:13 [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms Alexandre Ghiti
2025-05-22 14:18 ` Arnd Bergmann
@ 2025-05-22 14:20 ` Mark Pearson
2025-05-22 20:04 ` Armin Wolf
2025-06-10 16:28 ` patchwork-bot+linux-riscv
3 siblings, 0 replies; 10+ messages in thread
From: Mark Pearson @ 2025-05-22 14:20 UTC (permalink / raw)
To: Alexandre Ghiti, Rafael J. Wysocki, Len Brown, Ilpo Järvinen,
Limonciello, Mario, Armin Wolf, Arnd Bergmann,
linux-acpi@vger.kernel.org, linux-kernel, linux-riscv
On Thu, May 22, 2025, at 10:13 AM, Alexandre Ghiti wrote:
> The platform profile driver is loaded even on platforms that do not have
> acpi enabled. The initialization of the sysfs entries was recently moved
> from platform_profile_register() to the module init call, and those
> entries need acpi_kobj to be initialized which is not the case when acpi
> is disabled.
>
> This results in the following warning:
>
> WARNING: CPU: 5 PID: 1 at fs/sysfs/group.c:131
> internal_create_group+0xa22/0xdd8
> Modules linked in:
> CPU: 5 UID: 0 PID: 1 Comm: swapper/0 Tainted: G W
> 6.15.0-rc7-dirty #6 PREEMPT
> Tainted: [W]=WARN
> Hardware name: riscv-virtio,qemu (DT)
> epc : internal_create_group+0xa22/0xdd8
> ra : internal_create_group+0xa22/0xdd8
>
> Call Trace:
>
> internal_create_group+0xa22/0xdd8
> sysfs_create_group+0x22/0x2e
> platform_profile_init+0x74/0xb2
> do_one_initcall+0x198/0xa9e
> kernel_init_freeable+0x6d8/0x780
> kernel_init+0x28/0x24c
> ret_from_fork+0xe/0x18
>
> Fix this by checking if acpi is enabled before trying to create sysfs
> entries.
>
> Fixes: 77be5cacb2c2 ("ACPI: platform_profile: Create class for ACPI
> platform profile")
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> ---
> drivers/acpi/platform_profile.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
> index ffbfd32f4cf1..b43f4459a4f6 100644
> --- a/drivers/acpi/platform_profile.c
> +++ b/drivers/acpi/platform_profile.c
> @@ -688,6 +688,9 @@ static int __init platform_profile_init(void)
> {
> int err;
>
> + if (acpi_disabled)
> + return -EOPNOTSUPP;
> +
> err = class_register(&platform_profile_class);
> if (err)
> return err;
> --
> 2.43.0
Looks good to me.
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Mark
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
2025-05-22 14:13 [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms Alexandre Ghiti
2025-05-22 14:18 ` Arnd Bergmann
2025-05-22 14:20 ` Mark Pearson
@ 2025-05-22 20:04 ` Armin Wolf
2025-05-23 10:11 ` Alexandre Ghiti
2025-05-23 10:44 ` Arnd Bergmann
2025-06-10 16:28 ` patchwork-bot+linux-riscv
3 siblings, 2 replies; 10+ messages in thread
From: Armin Wolf @ 2025-05-22 20:04 UTC (permalink / raw)
To: Alexandre Ghiti, Rafael J . Wysocki, Len Brown,
Ilpo Järvinen, Mario Limonciello, Mark Pearson,
Arnd Bergmann, linux-acpi, linux-kernel, linux-riscv
Am 22.05.25 um 16:13 schrieb Alexandre Ghiti:
> The platform profile driver is loaded even on platforms that do not have
> acpi enabled. The initialization of the sysfs entries was recently moved
> from platform_profile_register() to the module init call, and those
> entries need acpi_kobj to be initialized which is not the case when acpi
> is disabled.
>
> This results in the following warning:
>
> WARNING: CPU: 5 PID: 1 at fs/sysfs/group.c:131 internal_create_group+0xa22/0xdd8
> Modules linked in:
> CPU: 5 UID: 0 PID: 1 Comm: swapper/0 Tainted: G W 6.15.0-rc7-dirty #6 PREEMPT
> Tainted: [W]=WARN
> Hardware name: riscv-virtio,qemu (DT)
> epc : internal_create_group+0xa22/0xdd8
> ra : internal_create_group+0xa22/0xdd8
>
> Call Trace:
>
> internal_create_group+0xa22/0xdd8
> sysfs_create_group+0x22/0x2e
> platform_profile_init+0x74/0xb2
> do_one_initcall+0x198/0xa9e
> kernel_init_freeable+0x6d8/0x780
> kernel_init+0x28/0x24c
> ret_from_fork+0xe/0x18
>
> Fix this by checking if acpi is enabled before trying to create sysfs
> entries.
I already submitted a patch for this problem (see https://lore.kernel.org/linux-acpi/a6d92cdd-4dc3-4080-9ed9-5b1f02f247e0@gmx.de/T/)
that only disables the legacy sysfs interface while keeping the class-based interface functional
as it does not depend on ACPI at all.
Thank,
Armin Wolf
> Fixes: 77be5cacb2c2 ("ACPI: platform_profile: Create class for ACPI platform profile")
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> ---
> drivers/acpi/platform_profile.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
> index ffbfd32f4cf1..b43f4459a4f6 100644
> --- a/drivers/acpi/platform_profile.c
> +++ b/drivers/acpi/platform_profile.c
> @@ -688,6 +688,9 @@ static int __init platform_profile_init(void)
> {
> int err;
>
> + if (acpi_disabled)
> + return -EOPNOTSUPP;
> +
> err = class_register(&platform_profile_class);
> if (err)
> return err;
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
2025-05-22 20:04 ` Armin Wolf
@ 2025-05-23 10:11 ` Alexandre Ghiti
2025-05-23 10:50 ` Rafael J. Wysocki
2025-05-23 10:44 ` Arnd Bergmann
1 sibling, 1 reply; 10+ messages in thread
From: Alexandre Ghiti @ 2025-05-23 10:11 UTC (permalink / raw)
To: Armin Wolf, Alexandre Ghiti, Rafael J . Wysocki, Len Brown,
Ilpo Järvinen, Mario Limonciello, Mark Pearson,
Arnd Bergmann, linux-acpi, linux-kernel, linux-riscv
On 5/22/25 22:04, Armin Wolf wrote:
> Am 22.05.25 um 16:13 schrieb Alexandre Ghiti:
>
>> The platform profile driver is loaded even on platforms that do not have
>> acpi enabled. The initialization of the sysfs entries was recently moved
>> from platform_profile_register() to the module init call, and those
>> entries need acpi_kobj to be initialized which is not the case when acpi
>> is disabled.
>>
>> This results in the following warning:
>>
>> WARNING: CPU: 5 PID: 1 at fs/sysfs/group.c:131
>> internal_create_group+0xa22/0xdd8
>> Modules linked in:
>> CPU: 5 UID: 0 PID: 1 Comm: swapper/0 Tainted: G W
>> 6.15.0-rc7-dirty #6 PREEMPT
>> Tainted: [W]=WARN
>> Hardware name: riscv-virtio,qemu (DT)
>> epc : internal_create_group+0xa22/0xdd8
>> ra : internal_create_group+0xa22/0xdd8
>>
>> Call Trace:
>>
>> internal_create_group+0xa22/0xdd8
>> sysfs_create_group+0x22/0x2e
>> platform_profile_init+0x74/0xb2
>> do_one_initcall+0x198/0xa9e
>> kernel_init_freeable+0x6d8/0x780
>> kernel_init+0x28/0x24c
>> ret_from_fork+0xe/0x18
>>
>> Fix this by checking if acpi is enabled before trying to create sysfs
>> entries.
>
> I already submitted a patch for this problem (see
> https://lore.kernel.org/linux-acpi/a6d92cdd-4dc3-4080-9ed9-5b1f02f247e0@gmx.de/T/)
> that only disables the legacy sysfs interface while keeping the
> class-based interface functional
> as it does not depend on ACPI at all.
Great, I understand if your patchset is not merged for rc1 but it would
be nice to have it merged in 6.16 though to fix riscv syzkaller
instance. Perhaps you could add the Fixes tag that Arnd mentioned too?
Thanks,
Alex
>
> Thank,
> Armin Wolf
>
>> Fixes: 77be5cacb2c2 ("ACPI: platform_profile: Create class for ACPI
>> platform profile")
>> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
>> ---
>> drivers/acpi/platform_profile.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/acpi/platform_profile.c
>> b/drivers/acpi/platform_profile.c
>> index ffbfd32f4cf1..b43f4459a4f6 100644
>> --- a/drivers/acpi/platform_profile.c
>> +++ b/drivers/acpi/platform_profile.c
>> @@ -688,6 +688,9 @@ static int __init platform_profile_init(void)
>> {
>> int err;
>> + if (acpi_disabled)
>> + return -EOPNOTSUPP;
>> +
>> err = class_register(&platform_profile_class);
>> if (err)
>> return err;
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
2025-05-22 20:04 ` Armin Wolf
2025-05-23 10:11 ` Alexandre Ghiti
@ 2025-05-23 10:44 ` Arnd Bergmann
1 sibling, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2025-05-23 10:44 UTC (permalink / raw)
To: Armin Wolf, Alexandre Ghiti, Rafael J . Wysocki, Len Brown,
Ilpo Järvinen, Mario Limonciello, Mark Pearson, linux-acpi,
linux-kernel, linux-riscv
On Thu, May 22, 2025, at 22:04, Armin Wolf wrote:
> Am 22.05.25 um 16:13 schrieb Alexandre Ghiti:
>
> I already submitted a patch for this problem (see
> https://lore.kernel.org/linux-acpi/a6d92cdd-4dc3-4080-9ed9-5b1f02f247e0@gmx.de/T/)
> that only disables the legacy sysfs interface while keeping the
> class-based interface functional
> as it does not depend on ACPI at all.
Just for my understanding: what users of the platform profile are
there that work without ACPI? I see that CONFIG_ACPI_PLATFORM_PROFILE
is hidden under CONFIG_ACPI and cannot be selected in configurations
that turn off ACPI, so if that is an intended usecase, there is
probably still something wrong in Kconfig.
Should the driver be moved out of drivers/acpi to drivers/platform
in order to let non-ACPI platforms use it?
Arnd
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
2025-05-23 10:11 ` Alexandre Ghiti
@ 2025-05-23 10:50 ` Rafael J. Wysocki
2025-05-23 14:46 ` Rafael J. Wysocki
0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2025-05-23 10:50 UTC (permalink / raw)
To: Alexandre Ghiti
Cc: Armin Wolf, Alexandre Ghiti, Rafael J . Wysocki, Len Brown,
Ilpo Järvinen, Mario Limonciello, Mark Pearson,
Arnd Bergmann, linux-acpi, linux-kernel, linux-riscv
On Fri, May 23, 2025 at 12:11 PM Alexandre Ghiti <alex@ghiti.fr> wrote:
>
> On 5/22/25 22:04, Armin Wolf wrote:
> > Am 22.05.25 um 16:13 schrieb Alexandre Ghiti:
> >
> >> The platform profile driver is loaded even on platforms that do not have
> >> acpi enabled. The initialization of the sysfs entries was recently moved
> >> from platform_profile_register() to the module init call, and those
> >> entries need acpi_kobj to be initialized which is not the case when acpi
> >> is disabled.
> >>
> >> This results in the following warning:
> >>
> >> WARNING: CPU: 5 PID: 1 at fs/sysfs/group.c:131
> >> internal_create_group+0xa22/0xdd8
> >> Modules linked in:
> >> CPU: 5 UID: 0 PID: 1 Comm: swapper/0 Tainted: G W
> >> 6.15.0-rc7-dirty #6 PREEMPT
> >> Tainted: [W]=WARN
> >> Hardware name: riscv-virtio,qemu (DT)
> >> epc : internal_create_group+0xa22/0xdd8
> >> ra : internal_create_group+0xa22/0xdd8
> >>
> >> Call Trace:
> >>
> >> internal_create_group+0xa22/0xdd8
> >> sysfs_create_group+0x22/0x2e
> >> platform_profile_init+0x74/0xb2
> >> do_one_initcall+0x198/0xa9e
> >> kernel_init_freeable+0x6d8/0x780
> >> kernel_init+0x28/0x24c
> >> ret_from_fork+0xe/0x18
> >>
> >> Fix this by checking if acpi is enabled before trying to create sysfs
> >> entries.
> >
> > I already submitted a patch for this problem (see
> > https://lore.kernel.org/linux-acpi/a6d92cdd-4dc3-4080-9ed9-5b1f02f247e0@gmx.de/T/)
> > that only disables the legacy sysfs interface while keeping the
> > class-based interface functional
> > as it does not depend on ACPI at all.
>
>
> Great, I understand if your patchset is not merged for rc1 but it would
> be nice to have it merged in 6.16 though to fix riscv syzkaller
> instance. Perhaps you could add the Fixes tag that Arnd mentioned too?
I actually prefer your patch to the Armin's one because there are
questions regarding the latter (see the most recent message from Arnd
in this thread).
Thanks!
> >> Fixes: 77be5cacb2c2 ("ACPI: platform_profile: Create class for ACPI
> >> platform profile")
> >> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> >> ---
> >> drivers/acpi/platform_profile.c | 3 +++
> >> 1 file changed, 3 insertions(+)
> >>
> >> diff --git a/drivers/acpi/platform_profile.c
> >> b/drivers/acpi/platform_profile.c
> >> index ffbfd32f4cf1..b43f4459a4f6 100644
> >> --- a/drivers/acpi/platform_profile.c
> >> +++ b/drivers/acpi/platform_profile.c
> >> @@ -688,6 +688,9 @@ static int __init platform_profile_init(void)
> >> {
> >> int err;
> >> + if (acpi_disabled)
> >> + return -EOPNOTSUPP;
> >> +
> >> err = class_register(&platform_profile_class);
> >> if (err)
> >> return err;
> >
> > _______________________________________________
> > linux-riscv mailing list
> > linux-riscv@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
2025-05-23 10:50 ` Rafael J. Wysocki
@ 2025-05-23 14:46 ` Rafael J. Wysocki
2025-05-23 20:01 ` Alexandre Ghiti
0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2025-05-23 14:46 UTC (permalink / raw)
To: Alexandre Ghiti
Cc: Armin Wolf, Alexandre Ghiti, Rafael J . Wysocki, Len Brown,
Ilpo Järvinen, Mario Limonciello, Mark Pearson,
Arnd Bergmann, linux-acpi, linux-kernel, linux-riscv
On Fri, May 23, 2025 at 12:50 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Fri, May 23, 2025 at 12:11 PM Alexandre Ghiti <alex@ghiti.fr> wrote:
> >
> > On 5/22/25 22:04, Armin Wolf wrote:
> > > Am 22.05.25 um 16:13 schrieb Alexandre Ghiti:
> > >
> > >> The platform profile driver is loaded even on platforms that do not have
> > >> acpi enabled. The initialization of the sysfs entries was recently moved
> > >> from platform_profile_register() to the module init call, and those
> > >> entries need acpi_kobj to be initialized which is not the case when acpi
> > >> is disabled.
> > >>
> > >> This results in the following warning:
> > >>
> > >> WARNING: CPU: 5 PID: 1 at fs/sysfs/group.c:131
> > >> internal_create_group+0xa22/0xdd8
> > >> Modules linked in:
> > >> CPU: 5 UID: 0 PID: 1 Comm: swapper/0 Tainted: G W
> > >> 6.15.0-rc7-dirty #6 PREEMPT
> > >> Tainted: [W]=WARN
> > >> Hardware name: riscv-virtio,qemu (DT)
> > >> epc : internal_create_group+0xa22/0xdd8
> > >> ra : internal_create_group+0xa22/0xdd8
> > >>
> > >> Call Trace:
> > >>
> > >> internal_create_group+0xa22/0xdd8
> > >> sysfs_create_group+0x22/0x2e
> > >> platform_profile_init+0x74/0xb2
> > >> do_one_initcall+0x198/0xa9e
> > >> kernel_init_freeable+0x6d8/0x780
> > >> kernel_init+0x28/0x24c
> > >> ret_from_fork+0xe/0x18
> > >>
> > >> Fix this by checking if acpi is enabled before trying to create sysfs
> > >> entries.
> > >
> > > I already submitted a patch for this problem (see
> > > https://lore.kernel.org/linux-acpi/a6d92cdd-4dc3-4080-9ed9-5b1f02f247e0@gmx.de/T/)
> > > that only disables the legacy sysfs interface while keeping the
> > > class-based interface functional
> > > as it does not depend on ACPI at all.
> >
> >
> > Great, I understand if your patchset is not merged for rc1 but it would
> > be nice to have it merged in 6.16 though to fix riscv syzkaller
> > instance. Perhaps you could add the Fixes tag that Arnd mentioned too?
>
> I actually prefer your patch to the Armin's one because there are
> questions regarding the latter (see the most recent message from Arnd
> in this thread).
And so it has been applied as 6.16 material now, thanks!
> > >> Fixes: 77be5cacb2c2 ("ACPI: platform_profile: Create class for ACPI
> > >> platform profile")
> > >> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> > >> ---
> > >> drivers/acpi/platform_profile.c | 3 +++
> > >> 1 file changed, 3 insertions(+)
> > >>
> > >> diff --git a/drivers/acpi/platform_profile.c
> > >> b/drivers/acpi/platform_profile.c
> > >> index ffbfd32f4cf1..b43f4459a4f6 100644
> > >> --- a/drivers/acpi/platform_profile.c
> > >> +++ b/drivers/acpi/platform_profile.c
> > >> @@ -688,6 +688,9 @@ static int __init platform_profile_init(void)
> > >> {
> > >> int err;
> > >> + if (acpi_disabled)
> > >> + return -EOPNOTSUPP;
> > >> +
> > >> err = class_register(&platform_profile_class);
> > >> if (err)
> > >> return err;
> > >
> > > _______________________________________________
> > > linux-riscv mailing list
> > > linux-riscv@lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
2025-05-23 14:46 ` Rafael J. Wysocki
@ 2025-05-23 20:01 ` Alexandre Ghiti
0 siblings, 0 replies; 10+ messages in thread
From: Alexandre Ghiti @ 2025-05-23 20:01 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Armin Wolf, Alexandre Ghiti, Len Brown, Ilpo Järvinen,
Mario Limonciello, Mark Pearson, Arnd Bergmann, linux-acpi,
linux-kernel, linux-riscv
Hi Rafael,
On 5/23/25 16:46, Rafael J. Wysocki wrote:
> On Fri, May 23, 2025 at 12:50 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>> On Fri, May 23, 2025 at 12:11 PM Alexandre Ghiti <alex@ghiti.fr> wrote:
>>> On 5/22/25 22:04, Armin Wolf wrote:
>>>> Am 22.05.25 um 16:13 schrieb Alexandre Ghiti:
>>>>
>>>>> The platform profile driver is loaded even on platforms that do not have
>>>>> acpi enabled. The initialization of the sysfs entries was recently moved
>>>>> from platform_profile_register() to the module init call, and those
>>>>> entries need acpi_kobj to be initialized which is not the case when acpi
>>>>> is disabled.
>>>>>
>>>>> This results in the following warning:
>>>>>
>>>>> WARNING: CPU: 5 PID: 1 at fs/sysfs/group.c:131
>>>>> internal_create_group+0xa22/0xdd8
>>>>> Modules linked in:
>>>>> CPU: 5 UID: 0 PID: 1 Comm: swapper/0 Tainted: G W
>>>>> 6.15.0-rc7-dirty #6 PREEMPT
>>>>> Tainted: [W]=WARN
>>>>> Hardware name: riscv-virtio,qemu (DT)
>>>>> epc : internal_create_group+0xa22/0xdd8
>>>>> ra : internal_create_group+0xa22/0xdd8
>>>>>
>>>>> Call Trace:
>>>>>
>>>>> internal_create_group+0xa22/0xdd8
>>>>> sysfs_create_group+0x22/0x2e
>>>>> platform_profile_init+0x74/0xb2
>>>>> do_one_initcall+0x198/0xa9e
>>>>> kernel_init_freeable+0x6d8/0x780
>>>>> kernel_init+0x28/0x24c
>>>>> ret_from_fork+0xe/0x18
>>>>>
>>>>> Fix this by checking if acpi is enabled before trying to create sysfs
>>>>> entries.
>>>> I already submitted a patch for this problem (see
>>>> https://lore.kernel.org/linux-acpi/a6d92cdd-4dc3-4080-9ed9-5b1f02f247e0@gmx.de/T/)
>>>> that only disables the legacy sysfs interface while keeping the
>>>> class-based interface functional
>>>> as it does not depend on ACPI at all.
>>>
>>> Great, I understand if your patchset is not merged for rc1 but it would
>>> be nice to have it merged in 6.16 though to fix riscv syzkaller
>>> instance. Perhaps you could add the Fixes tag that Arnd mentioned too?
>> I actually prefer your patch to the Armin's one because there are
>> questions regarding the latter (see the most recent message from Arnd
>> in this thread).
> And so it has been applied as 6.16 material now, thanks!
Thank you very much!
Alex
>
>>>>> Fixes: 77be5cacb2c2 ("ACPI: platform_profile: Create class for ACPI
>>>>> platform profile")
>>>>> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
>>>>> ---
>>>>> drivers/acpi/platform_profile.c | 3 +++
>>>>> 1 file changed, 3 insertions(+)
>>>>>
>>>>> diff --git a/drivers/acpi/platform_profile.c
>>>>> b/drivers/acpi/platform_profile.c
>>>>> index ffbfd32f4cf1..b43f4459a4f6 100644
>>>>> --- a/drivers/acpi/platform_profile.c
>>>>> +++ b/drivers/acpi/platform_profile.c
>>>>> @@ -688,6 +688,9 @@ static int __init platform_profile_init(void)
>>>>> {
>>>>> int err;
>>>>> + if (acpi_disabled)
>>>>> + return -EOPNOTSUPP;
>>>>> +
>>>>> err = class_register(&platform_profile_class);
>>>>> if (err)
>>>>> return err;
>>>> _______________________________________________
>>>> linux-riscv mailing list
>>>> linux-riscv@lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/linux-riscv
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
2025-05-22 14:13 [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms Alexandre Ghiti
` (2 preceding siblings ...)
2025-05-22 20:04 ` Armin Wolf
@ 2025-06-10 16:28 ` patchwork-bot+linux-riscv
3 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+linux-riscv @ 2025-06-10 16:28 UTC (permalink / raw)
To: Alexandre Ghiti
Cc: linux-riscv, rafael, lenb, ilpo.jarvinen, mario.limonciello,
mpearson-lenovo, W_Armin, arnd, linux-acpi, linux-kernel
Hello:
This patch was applied to riscv/linux.git (fixes)
by Rafael J. Wysocki <rafael.j.wysocki@intel.com>:
On Thu, 22 May 2025 16:13:56 +0200 you wrote:
> The platform profile driver is loaded even on platforms that do not have
> acpi enabled. The initialization of the sysfs entries was recently moved
> from platform_profile_register() to the module init call, and those
> entries need acpi_kobj to be initialized which is not the case when acpi
> is disabled.
>
> This results in the following warning:
>
> [...]
Here is the summary with links:
- drivers: acpi: Fix platform profile driver on !acpi platforms
https://git.kernel.org/riscv/c/dd133162c9cf
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-06-10 19:58 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 14:13 [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms Alexandre Ghiti
2025-05-22 14:18 ` Arnd Bergmann
2025-05-22 14:20 ` Mark Pearson
2025-05-22 20:04 ` Armin Wolf
2025-05-23 10:11 ` Alexandre Ghiti
2025-05-23 10:50 ` Rafael J. Wysocki
2025-05-23 14:46 ` Rafael J. Wysocki
2025-05-23 20:01 ` Alexandre Ghiti
2025-05-23 10:44 ` Arnd Bergmann
2025-06-10 16:28 ` patchwork-bot+linux-riscv
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).