[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1e55d104-9746-4b37-8663-12714cc00026@huawei.com>
Date: Thu, 18 Sep 2025 20:23:00 +0800
From: "lihuisong (C)" <lihuisong@...wei.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
CC: <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
在 2025/9/18 4:01, Rafael J. Wysocki 写道:
> 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?
ok, will do it in next version. Thanks.
>
> 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