lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0htzNf2nPT2GQ8aaunp9gfrFbfZzMaMACA=JaXLBiqz9A@mail.gmail.com>
Date: Wed, 22 Oct 2025 16:49:09 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Huisong Li <lihuisong@...wei.com>
Cc: rafael@...nel.org, lenb@...nel.org, linux-acpi@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Sudeep.Holla@....com, linuxarm@...wei.com, 
	jonathan.cameron@...wei.com, zhanjie9@...ilicon.com, zhenglifeng1@...wei.com, 
	yubowen8@...wei.com
Subject: Re: [PATCH v1 4/9] ACPI: processor: idle: Move the initialization of
 state->flags to acpi_processor_setup_cstates

On Mon, Sep 29, 2025 at 11:38 AM Huisong Li <lihuisong@...wei.com> wrote:
>
> The acpi_processor_setup_cpuidle_cx() is called by
> acpi_processor_setup_cpuidle_dev() which is used to setup cpuidle device.
> However, acpi_processor_setup_cpuidle_cx() also initializes the states
> in acpi_idle_driver, which isn't good. And acpi_processor_setup_cstates()
> is aimed to initializes cstates in acpi_idle_driver. So the initialization
> of state->flags should be here.
>
> Signed-off-by: Huisong Li <lihuisong@...wei.com>
> ---
>  drivers/acpi/processor_idle.c | 20 +++++++++-----------
>  1 file changed, 9 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index f36f9514b6c7..5684925338b3 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -737,13 +737,11 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
>  {
>         int i, count = ACPI_IDLE_STATE_START;
>         struct acpi_processor_cx *cx;
> -       struct cpuidle_state *state;
>
>         if (max_cstate == 0)
>                 max_cstate = 1;
>
>         for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
> -               state = &acpi_idle_driver.states[count];
>                 cx = &pr->power.states[i];
>
>                 if (!cx->valid)
> @@ -751,15 +749,6 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
>
>                 per_cpu(acpi_cstate[count], dev->cpu) = cx;
>
> -               if (lapic_timer_needs_broadcast(pr, cx))
> -                       state->flags |= CPUIDLE_FLAG_TIMER_STOP;
> -
> -               if (cx->type == ACPI_STATE_C3) {
> -                       state->flags |= CPUIDLE_FLAG_TLB_FLUSHED;
> -                       if (pr->flags.bm_check)
> -                               state->flags |= CPUIDLE_FLAG_RCU_IDLE;
> -               }
> -
>                 count++;
>                 if (count == CPUIDLE_STATE_MAX)
>                         break;
> @@ -818,6 +807,15 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr)
>                 if (cx->type != ACPI_STATE_C1 && !acpi_idle_fallback_to_c1(pr))
>                         state->enter_s2idle = acpi_idle_enter_s2idle;
>
> +               if (lapic_timer_needs_broadcast(pr, cx))
> +                       state->flags |= CPUIDLE_FLAG_TIMER_STOP;
> +
> +               if (cx->type == ACPI_STATE_C3) {
> +                       state->flags |= CPUIDLE_FLAG_TLB_FLUSHED;
> +                       if (pr->flags.bm_check)
> +                               state->flags |= CPUIDLE_FLAG_RCU_IDLE;
> +               }
> +
>                 count++;
>                 if (count == CPUIDLE_STATE_MAX)
>                         break;
> --

Applied with rewritten subject and changelog as 6.19 material, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ