[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hb19Xy8dOP4itU-F5F7OjDXBVNGYiwoxAVc_yGuUv=Aw@mail.gmail.com>
Date: Wed, 17 Sep 2025 22:01:58 +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, linuxarm@...wei.com,
jonathan.cameron@...wei.com, zhanjie9@...ilicon.com, zhenglifeng1@...wei.com,
yubowen8@...wei.com
Subject: Re: [PATCH v3 3/3] ACPI: processor: Do not expose the global
acpi_idle_driver variable
On Thu, Sep 11, 2025 at 1:24 PM Huisong Li <lihuisong@...wei.com> wrote:
>
> Currently, processor_driver just use the global acpi_idle_driver variable
> to check if the cpuidle driver is acpi_idle_driver. Actually, there is no
> need to expose this global variable defined in processor_idle.c to outside.
> So move the related logical to acpi_processor_power_init() and do not
> expose it.
And it can also be made static, can't it?
Please do that too.
> Signed-off-by: Huisong Li <lihuisong@...wei.com>
> ---
> drivers/acpi/processor_driver.c | 3 +--
> drivers/acpi/processor_idle.c | 5 +++++
> include/acpi/processor.h | 1 -
> 3 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
> index bc9f58a02c1d..5d824435b26b 100644
> --- a/drivers/acpi/processor_driver.c
> +++ b/drivers/acpi/processor_driver.c
> @@ -166,8 +166,7 @@ static int __acpi_processor_start(struct acpi_device *device)
> if (result && !IS_ENABLED(CONFIG_ACPI_CPU_FREQ_PSS))
> dev_dbg(&device->dev, "CPPC data invalid or not present\n");
>
> - if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver)
> - acpi_processor_power_init(pr);
> + acpi_processor_power_init(pr);
>
> acpi_pss_perf_init(pr);
>
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index 5dacf41d7cc0..967fb13f38fa 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -1404,6 +1404,11 @@ int acpi_processor_power_init(struct acpi_processor *pr)
> {
> int retval;
> struct cpuidle_device *dev;
> + struct cpuidle_driver *drv;
> +
> + drv = cpuidle_get_driver();
> + if (drv && drv != &acpi_idle_driver)
> + return 0;
>
> if (disabled_by_idle_boot_param())
> return 0;
> diff --git a/include/acpi/processor.h b/include/acpi/processor.h
> index 6ee4a69412de..bd96dde5eef5 100644
> --- a/include/acpi/processor.h
> +++ b/include/acpi/processor.h
> @@ -417,7 +417,6 @@ static inline void acpi_processor_throttling_init(void) {}
> #endif /* CONFIG_ACPI_CPU_FREQ_PSS */
>
> /* in processor_idle.c */
> -extern struct cpuidle_driver acpi_idle_driver;
> #ifdef CONFIG_ACPI_PROCESSOR_IDLE
> int acpi_processor_power_init(struct acpi_processor *pr);
> int acpi_processor_power_exit(struct acpi_processor *pr);
> --
Powered by blists - more mailing lists