From: Sudeep Holla <sudeep.holla@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Linux PM <linux-pm@vger.kernel.org>,
Sudeep Holla <sudeep.holla@kernel.org>,
Linux ACPI <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH v1 17/17] intel_idle: Add ACPI _LPI support
Date: Mon, 13 Jul 2026 15:56:13 +0100 [thread overview]
Message-ID: <20260713-aquatic-okapi-of-wind-9e657c@sudeepholla> (raw)
In-Reply-To: <2280567.Icojqenx9y@rafael.j.wysocki>
On Thu, Jul 09, 2026 at 02:44:23PM +0200, Rafael J. Wysocki wrote:
> From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
>
> Allow intel_idle to use idle states information coming from ACPI _LPI
> objects by making it call acpi_processor_extract_lpi_info() and, if
> that is successful, using the list of idle states produced by that
> function instead of the one coming from acpi_processor_evaluate_cst().
>
May be it is lack of my knowledge. I always assumed intel_idle is fine
tuned with for specific intel cores. But now if the information is being
fetched from _LPI, what is the difference between intel_idle driver
and ACPI processor idle if the FFH backend can be MWAIT.
Couple of more questions below, all just for my understanding and it
doesn't add as a review comment.
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> drivers/idle/intel_idle.c | 160 ++++++++++++++++++++++++++++++++------
> 1 file changed, 138 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> index fedaa8142121..bcc2725769c5 100644
> --- a/drivers/idle/intel_idle.c
> +++ b/drivers/idle/intel_idle.c
> @@ -1779,6 +1779,7 @@ module_param_named(no_native, no_native, bool, 0444);
> MODULE_PARM_DESC(no_native, "Ignore cpu specific (native) idle states in lieu of ACPI idle states");
>
> static struct acpi_processor_power acpi_state_table __initdata;
> +static bool acpi_lpi_available __initdata;
>
> /**
> * intel_idle_cst_usable - Check if the _CST information can be used.
> @@ -1803,18 +1804,37 @@ static bool __init intel_idle_cst_usable(void)
> return true;
> }
>
> -static bool __init intel_idle_acpi_cst_extract(void)
> +static bool __init intel_idle_acpi_extract_lpi_cstates(void)
> {
> unsigned int cpu;
>
> - if (no_acpi) {
> - pr_debug("Not allowed to use ACPI _CST\n");
> - return false;
> + for_each_possible_cpu(cpu) {
> + struct acpi_processor *pr;
> +
> + pr = per_cpu(processors, cpu);
> + if (!pr)
> + continue;
> +
> + if (acpi_processor_extract_lpi_info(pr->handle,
> + &acpi_state_table, true))
> + continue;
> +
> + acpi_lpi_available = true;
> + return true;
On the first CPU for which acpi_processor_extract_lpi_info() returns 0,
it sets acpi_lpi_available and immediately returns true.
Consequently, one CPU’s _LPI data populates the global acpi_state_table,
which initializes the single intel_idle_driver. Remaining CPUs are neither
queried nor compared which is fine IIUC on x86. But then the questions is
why does this needs to be in a loop as you? Can't it be just the boot CPU
for instance.
> }
>
> + pr_debug("No ACPI _LPI idle states\n");
> + return false;
> +}
> +
> +static bool __init intel_idle_acpi_extract_cst_cstates(void)
> +{
> + unsigned int cpu;
> +
> for_each_possible_cpu(cpu) {
> - struct acpi_processor *pr = per_cpu(processors, cpu);
> + struct acpi_processor *pr;
>
> + pr = per_cpu(processors, cpu);
> if (!pr)
> continue;
>
> @@ -1826,14 +1846,36 @@ static bool __init intel_idle_acpi_cst_extract(void)
> if (!intel_idle_cst_usable())
> continue;
>
> - if (!acpi_processor_claim_cst_control())
> - break;
> + return true;
> + }
> +
> + pr_debug("ACPI _CST not found or not usable\n");
> + return false;
> +}
>
> +static bool __init intel_idle_acpi_extract_cstates(void)
> +{
> + if (intel_idle_acpi_extract_lpi_cstates())
> + return true;
> +
> + if (intel_idle_acpi_extract_cst_cstates())
> return true;
> +
> + return false;
> +}
> +
> +static bool __init intel_idle_acpi_probe(void)
> +{
> + if (no_acpi) {
> + pr_debug("Not allowed to use ACPI for C-states extraction\n");
> + return false;
> }
>
The intel_idle documentation and module parameter descriptions should be
updated to reflect _LPI support IMO.
Documentation/admin-guide/pm/intel_idle.rst should no longer imply that
intel_idle only looks for _CST or only uses _CST-derived state
names/construction rules.
--
Regards,
Sudeep
next prev parent reply other threads:[~2026-07-13 14:56 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 12:29 [PATCH v1 00/17] ACPI: processor: idle/intel_idle: Add ACPI _LPI support to intel_idle Rafael J. Wysocki
2026-07-09 12:30 ` [PATCH v1 01/17] ACPI: processor: idle: Expand _LPI package sanity checks Rafael J. Wysocki
2026-07-13 11:22 ` Sudeep Holla
2026-07-16 9:05 ` lihuisong (C)
2026-07-09 12:31 ` [PATCH v1 02/17] ACPI: processor: idle: Ignore _LPI states with SYSTEMIO entry method Rafael J. Wysocki
2026-07-13 11:24 ` Sudeep Holla
2026-07-16 9:08 ` lihuisong (C)
2026-07-09 12:32 ` [PATCH v1 03/17] ACPI: processor: idle: Unify debug in acpi_processor_evaluate_lpi() Rafael J. Wysocki
2026-07-13 11:27 ` Sudeep Holla
2026-07-16 9:16 ` lihuisong (C)
2026-07-09 12:33 ` [PATCH v1 04/17] ACPI: processor: idle: Rearrange acpi_processor_evaluate_lpi() Rafael J. Wysocki
2026-07-13 11:29 ` Sudeep Holla
2026-07-16 9:46 ` lihuisong (C)
2026-07-16 10:36 ` Rafael J. Wysocki (Intel)
2026-07-16 11:51 ` lihuisong (C)
2026-07-16 12:57 ` Rafael J. Wysocki (Intel)
2026-07-09 12:34 ` [PATCH v1 05/17] ACPI: processor: idle: Split acpi_processor_evaluate_lpi() Rafael J. Wysocki
2026-07-13 13:17 ` Sudeep Holla
2026-07-16 11:55 ` lihuisong (C)
2026-07-16 12:58 ` Rafael J. Wysocki (Intel)
2026-07-17 2:04 ` lihuisong (C)
2026-07-09 12:35 ` [PATCH v1 06/17] ACPI: processor: idle: Introduce lpi_state_debug() Rafael J. Wysocki
2026-07-09 12:36 ` [PATCH v1 07/17] ACPI: processor: idle: Rearrange acpi_processor_get_lpi_info() Rafael J. Wysocki
2026-07-13 13:18 ` Sudeep Holla
2026-07-16 12:06 ` lihuisong (C)
2026-07-09 12:37 ` [PATCH v1 08/17] ACPI: processor: idle: Rework first-level _LPI states processing Rafael J. Wysocki
2026-07-13 13:20 ` Sudeep Holla
2026-07-16 12:44 ` lihuisong (C)
2026-07-16 13:03 ` Rafael J. Wysocki (Intel)
2026-07-09 12:37 ` [PATCH v1 09/17] ACPI: processor: idle: Drop redundant _LPI presence checks Rafael J. Wysocki
2026-07-13 13:21 ` Sudeep Holla
2026-07-16 12:47 ` lihuisong (C)
2026-07-09 12:38 ` [PATCH v1 10/17] ACPI: processor: idle: Rearrange loop in acpi_processor_get_lpi_info() Rafael J. Wysocki
2026-07-13 13:21 ` Sudeep Holla
2026-07-16 12:49 ` lihuisong (C)
2026-07-09 12:39 ` [PATCH v1 11/17] ACPI: processor: idle: Rework flatten_lpi_states() Rafael J. Wysocki
2026-07-13 13:23 ` Sudeep Holla
2026-07-17 1:36 ` lihuisong (C)
2026-07-09 12:39 ` [PATCH v1 12/17] ACPI: processor: idle: Introduce too_many_states() for _LPI Rafael J. Wysocki
2026-07-13 13:23 ` Sudeep Holla
2026-07-17 1:38 ` lihuisong (C)
2026-07-09 12:40 ` [PATCH v1 13/17] ACPI: processor: idle: Introduce acpi_processor_extract_lpi_info() Rafael J. Wysocki
2026-07-13 13:32 ` Sudeep Holla
2026-07-17 1:46 ` lihuisong (C)
2026-07-09 12:41 ` [PATCH v1 14/17] ACPI: processor: idle: Relocate acpi_processor_extract_lpi_info() Rafael J. Wysocki
2026-07-13 13:30 ` Sudeep Holla
2026-07-17 1:56 ` lihuisong (C)
2026-07-09 12:42 ` [PATCH v1 15/17] ACPI: processor: idle: Add switch for strict _LPI processing Rafael J. Wysocki
2026-07-13 13:33 ` Sudeep Holla
2026-07-17 1:58 ` lihuisong (C)
2026-07-09 12:43 ` [PATCH v1 16/17] intel_idle: Prepare for adding ACPI _LPI support Rafael J. Wysocki
2026-07-09 12:44 ` [PATCH v1 17/17] intel_idle: Add " Rafael J. Wysocki
2026-07-13 14:56 ` Sudeep Holla [this message]
2026-07-14 13:25 ` Rafael J. Wysocki (Intel)
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=20260713-aquatic-okapi-of-wind-9e657c@sudeepholla \
--to=sudeep.holla@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@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