mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "lihuisong (C)" <lihuisong@huawei.com>
To: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>, <rafael@kernel.org>,
	<lenb@kernel.org>, <linux-acpi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <CobeChen@zhaoxin.com>, <LindaChai@zhaoxin.com>, <lihuisong@huawei.com>
Subject: Re: [PATCH] ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver
Date: Mon, 8 Jun 2026 18:06:54 +0800	[thread overview]
Message-ID: <15af5635-e3a3-4ffc-9f02-82e35a95154f@huawei.com> (raw)
In-Reply-To: <20260608063812.2533-1-TonyWWang-oc@zhaoxin.com>


On 6/8/2026 2:38 PM, Tony W Wang-oc wrote:
> Commit 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idle
> driver registration") moved the ACPI idle driver registration to
> acpi_processor_driver_init(), but it didn't check whether a cpuidle
> driver was already registered.
>
> For example, on Intel platforms, if the intel_idle driver is already
> loaded, the code would still evaluate the _CST object in the ACPI
> table and attempt to register the acpi_idle driver. This registration
> would fail with -EBUSY due to the existing check in cpuidle_register_driver.
>
> Add a check at the beginning of acpi_processor_register_idle_driver()
> to avoid unnecessary _CST evaluate and potential registration failures.
Now look good to me. Thanks.
> Fixes: 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idle driver registration")
> Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
> ---
>   drivers/acpi/processor_idle.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index ee5facccbe10..0409411abb83 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -1355,6 +1355,11 @@ void acpi_processor_register_idle_driver(void)
>   	int ret = -ENODEV;
>   	int cpu;
>   
Can you add some like below comment?
"No need to register the ACPI idle driver when platform don't use this 
driver."
> +	if (cpuidle_get_driver()) {
> +		pr_debug("cpuidle driver %pS already registered.\n", cpuidle_get_driver());
> +		return;
> +	}
> +
>   	acpi_processor_update_max_cstate();
>   
>   	/*

  reply	other threads:[~2026-06-08 10:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08  6:38 Tony W Wang-oc
2026-06-08 10:06 ` lihuisong (C) [this message]
2026-06-08 19:03   ` [PATCH v2] " Tony W Wang-oc
2026-06-08 12:43     ` Rafael J. Wysocki
  -- strict thread matches above, loose matches on Subject: below --
2026-05-19  9:19 [PATCH] " Tony W Wang-oc
2026-05-28  9:35 ` lihuisong (C)

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=15af5635-e3a3-4ffc-9f02-82e35a95154f@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=CobeChen@zhaoxin.com \
    --cc=LindaChai@zhaoxin.com \
    --cc=TonyWWang-oc@zhaoxin.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®