From: "lihuisong (C)" <lihuisong@huawei.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Linux ACPI <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>,
"Mario Limonciello" <mario.limonciello@amd.com>,
"Shenoy, Gautham Ranjal" <gautham.shenoy@amd.com>
Subject: Re: [PATCH v1 1/2] ACPI: processor: Update cpuidle driver check in __acpi_processor_start()
Date: Mon, 22 Sep 2025 09:16:33 +0800 [thread overview]
Message-ID: <c642d834-dbaa-43bb-95fd-bb9603ba81f2@huawei.com> (raw)
In-Reply-To: <CAJZ5v0gXHedm9WwwMuTN7vYyf5fNB6yOGLp_-GxSoZAEhSx5aw@mail.gmail.com>
在 2025/9/19 19:17, Rafael J. Wysocki 写道:
> On Thu, Sep 18, 2025 at 11:10 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>
>> Commit 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idle
>> driver registration") moved the ACPI idle driver registration to
>> acpi_processor_driver_init() and acpi_processor_power_init() does
>> not register an idle driver any more, so the cpuidle driver check
>> in __acpi_processor_start() needs to be updated to avoid calling
>> acpi_processor_power_init() without a cpuidle driver (in which
>> case the registration of the cpuidle device in that function
>> would fail anyway).
> It's worse, it won't just fail, it'll lead to a NULL pointer
> dereference in __cpuidle_register_device().
>
> I'll update the changelog while applying the patch.
Yeah, thanks for fixing it.
Acked-by: lihuisong@huawei.com
>
>> Fixes: 7a8c994cbb2d ("ACPI: processor: idle: Optimize ACPI idle driver registration")
>> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> ---
>>
>> Commit 7a8c994cbb2d is only in linux-next at this point.
>>
>> ---
>> drivers/acpi/processor_driver.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --- a/drivers/acpi/processor_driver.c
>> +++ b/drivers/acpi/processor_driver.c
>> @@ -166,7 +166,7 @@ static int __acpi_processor_start(struct
>> 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)
>> + if (cpuidle_get_driver() == &acpi_idle_driver)
>> acpi_processor_power_init(pr);
>>
>> acpi_pss_perf_init(pr);
>>
>>
>>
>>
next prev parent reply other threads:[~2025-09-22 1:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 21:07 [PATCH v1 0/2] ACPI: processor: idle: Fix and cleanup Rafael J. Wysocki
2025-09-18 21:09 ` [PATCH v1 1/2] ACPI: processor: Update cpuidle driver check in __acpi_processor_start() Rafael J. Wysocki
2025-09-19 11:17 ` Rafael J. Wysocki
2025-09-22 1:16 ` lihuisong (C) [this message]
2025-09-18 21:10 ` [PATCH v1 2/2] ACPI: processor: idle: Redefine two functions as void Rafael J. Wysocki
2025-09-22 1:17 ` lihuisong (C)
2025-09-19 18:44 ` [PATCH v1 0/2] ACPI: processor: idle: Fix and cleanup Mario Limonciello (AMD) (kernel.org)
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=c642d834-dbaa-43bb-95fd-bb9603ba81f2@huawei.com \
--to=lihuisong@huawei.com \
--cc=gautham.shenoy@amd.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--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