[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0iPVx0KXB5qQ46iQ7CKG6KJC1CnXogQ=e8or24vZuytrw@mail.gmail.com>
Date: Fri, 23 May 2025 12:50:13 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Alexandre Ghiti <alex@...ti.fr>
Cc: Armin Wolf <W_Armin@....de>, Alexandre Ghiti <alexghiti@...osinc.com>,
"Rafael J . Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Mario Limonciello <mario.limonciello@....com>, Mark Pearson <mpearson-lenovo@...ebb.ca>,
Arnd Bergmann <arnd@...db.de>, linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: Re: [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
On Fri, May 23, 2025 at 12:11 PM Alexandre Ghiti <alex@...ti.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@...osinc.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@...ts.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-riscv
Powered by blists - more mailing lists