The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Mark Pearson" <mpearson-lenovo@squebb.ca>
To: "Alexandre Ghiti" <alexghiti@rivosinc.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Len Brown" <lenb@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Limonciello, Mario" <mario.limonciello@amd.com>,
	"Armin Wolf" <W_Armin@gmx.de>, "Arnd Bergmann" <arnd@arndb.de>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH] drivers: acpi: Fix platform profile driver on !acpi platforms
Date: Thu, 22 May 2025 10:20:10 -0400	[thread overview]
Message-ID: <83d4fd6f-805f-4b96-b772-70aa55c8c1f9@app.fastmail.com> (raw)
In-Reply-To: <20250522141410.31315-1-alexghiti@rivosinc.com>

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

  parent reply	other threads:[~2025-05-22 14:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d4fd6f-805f-4b96-b772-70aa55c8c1f9@app.fastmail.com \
    --to=mpearson-lenovo@squebb.ca \
    --cc=W_Armin@gmx.de \
    --cc=alexghiti@rivosinc.com \
    --cc=arnd@arndb.de \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mario.limonciello@amd.com \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox