* [PATCH] ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver
@ 2026-06-08 6:38 Tony W Wang-oc
2026-06-08 10:06 ` lihuisong (C)
0 siblings, 1 reply; 6+ messages in thread
From: Tony W Wang-oc @ 2026-06-08 6:38 UTC (permalink / raw)
To: rafael, lenb, linux-acpi, linux-kernel, lihuisong; +Cc: CobeChen, LindaChai
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.
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;
+ if (cpuidle_get_driver()) {
+ pr_debug("cpuidle driver %pS already registered.\n", cpuidle_get_driver());
+ return;
+ }
+
acpi_processor_update_max_cstate();
/*
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver
2026-06-08 6:38 [PATCH] ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver Tony W Wang-oc
@ 2026-06-08 10:06 ` lihuisong (C)
2026-06-08 19:03 ` [PATCH v2] " Tony W Wang-oc
0 siblings, 1 reply; 6+ messages in thread
From: lihuisong (C) @ 2026-06-08 10:06 UTC (permalink / raw)
To: Tony W Wang-oc, rafael, lenb, linux-acpi, linux-kernel
Cc: CobeChen, LindaChai, lihuisong
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();
>
> /*
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v2] ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver
2026-06-08 10:06 ` lihuisong (C)
@ 2026-06-08 19:03 ` Tony W Wang-oc
2026-06-08 12:43 ` Rafael J. Wysocki
0 siblings, 1 reply; 6+ messages in thread
From: Tony W Wang-oc @ 2026-06-08 19:03 UTC (permalink / raw)
To: rafael, lenb, linux-acpi, linux-kernel, lihuisong; +Cc: CobeChen, LindaChai
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.
Fixes: 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idle driver registration")
Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
---
Changes in v2:
- Added comment to explain why we skip registration when a driver is
already present.
drivers/acpi/processor_idle.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index ee5facccbe10..390ab5f1d313 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1355,6 +1355,15 @@ void acpi_processor_register_idle_driver(void)
int ret = -ENODEV;
int cpu;
+ /*
+ * If a cpuidle driver is already registered, there is no need to
+ * evaluate _CST or attempt to register the ACPI idle driver.
+ */
+ if (cpuidle_get_driver()) {
+ pr_debug("cpuidle driver %pS already registered.\n", cpuidle_get_driver());
+ return;
+ }
+
acpi_processor_update_max_cstate();
/*
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2] ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver
2026-06-08 19:03 ` [PATCH v2] " Tony W Wang-oc
@ 2026-06-08 12:43 ` Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2026-06-08 12:43 UTC (permalink / raw)
To: Tony W Wang-oc
Cc: rafael, lenb, linux-acpi, linux-kernel, lihuisong, CobeChen, LindaChai
On Mon, Jun 8, 2026 at 1:04 PM Tony W Wang-oc <TonyWWang-oc@zhaoxin.com> 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.
>
> Fixes: 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idle driver registration")
> Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
> ---
> Changes in v2:
> - Added comment to explain why we skip registration when a driver is
> already present.
>
> drivers/acpi/processor_idle.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index ee5facccbe10..390ab5f1d313 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -1355,6 +1355,15 @@ void acpi_processor_register_idle_driver(void)
> int ret = -ENODEV;
> int cpu;
>
> + /*
> + * If a cpuidle driver is already registered, there is no need to
> + * evaluate _CST or attempt to register the ACPI idle driver.
> + */
> + if (cpuidle_get_driver()) {
> + pr_debug("cpuidle driver %pS already registered.\n", cpuidle_get_driver());
> + return;
> + }
> +
> acpi_processor_update_max_cstate();
>
> /*
> --
Applied as 7.2 material, thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver
@ 2026-05-19 9:19 Tony W Wang-oc
2026-05-28 9:35 ` lihuisong (C)
0 siblings, 1 reply; 6+ messages in thread
From: Tony W Wang-oc @ 2026-05-19 9:19 UTC (permalink / raw)
To: rafael, lenb, linux-acpi, linux-kernel; +Cc: CobeChen, LindaChai
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1587 bytes --]
Commit 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idledriver registration") moved the ACPI idle driver registration toacpi_processor_driver_init(), but it didn't check whether a cpuidledriver was already registered.For example, on Intel platforms, if the intel_idle driver is alreadyloaded, the code would still evaluate the _CST object in the ACPItable and attempt to register the acpi_idle driver. This registrationwould 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.--- drivers/acpi/processor_idle.c | 5 +++++ 1 file changed, 5 insertions(+)diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.cindex 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; + if (cpuidle_get_driver()) {+ pr_debug("cpuidle driver %pS already registered.\n", cpuidle_get_driver());+ return;+ }+ acpi_processor_update_max_cstate(); /*-- 2.25.1
保密声明
本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。
This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or forwarding of this email or the content of this email is strictly prohibited.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver
2026-05-19 9:19 [PATCH] " Tony W Wang-oc
@ 2026-05-28 9:35 ` lihuisong (C)
0 siblings, 0 replies; 6+ messages in thread
From: lihuisong (C) @ 2026-05-28 9:35 UTC (permalink / raw)
To: Tony W Wang-oc, rafael, lenb, linux-acpi, linux-kernel
Cc: CobeChen, LindaChai, lihuisong
Hello Tony,
Thank you for reporting this issue. Good point.
This patch is messy and not good to review and merge. please resend it.
In addition, suggest you add a fixed tag.
/Huisong
On 5/19/2026 5:19 PM, Tony W Wang-oc wrote:
> Commit 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idledriver registration") moved the ACPI idle driver registration toacpi_processor_driver_init(), but it didn't check whether a cpuidledriver was already registered.For example, on Intel platforms, if the intel_idle driver is alreadyloaded, the code would still evaluate the _CST object in the ACPItable and attempt to register the acpi_idle driver. This registrationwould 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.--- drivers/acpi/processor_idle.c | 5 +++++ 1 file changed, 5 insertions(+)diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.cindex 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; + if (cpuidle_get_driver()) {+ pr_debug("cpuidle driver %pS already registered.\n", cpuidle_get_driver());+ return;+ }+ acpi_processor_update_max_cstate(); /*-- 2.25.1
>
>
>
>
> 保密声明
> 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。
>
> This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or forwarding of this email or the content of this email is strictly prohibited.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-08 12:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-08 6:38 [PATCH] ACPI: processor: Add cpuidle driver check in acpi_processor_register_idle_driver Tony W Wang-oc
2026-06-08 10:06 ` lihuisong (C)
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)
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®