[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250919113922.7tozmbts6cs3y5va@lcpd911>
Date: Fri, 19 Sep 2025 17:09:22 +0530
From: Dhruva Gole <d-gole@...com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
CC: Linux PM <linux-pm@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>
Subject: Re: [PATCH v2] cpuidle: Fail cpuidle device registration if there is
one already
Hi Rafael,
On Sep 19, 2025 at 13:22:20 +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Refuse to register a cpuidle device if the given CPU has a cpuidle
> device already and print a message regarding it.
>
> Without this, an attempt to register a new cpuidle device without
> unregistering the existing one leads to the removal of the existing
> cpuidle device without removing its sysfs interface.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
>
> v1 -> v2:
> * Add the new check before the driver module reference counting (Dhruva).
Thanks for addressing!
>
> ---
> drivers/cpuidle/cpuidle.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -635,8 +635,14 @@ static void __cpuidle_device_init(struct
> static int __cpuidle_register_device(struct cpuidle_device *dev)
> {
> struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);
> + unsigned int cpu = dev->cpu;
> int i, ret;
>
> + if (per_cpu(cpuidle_devices, cpu)) {
> + pr_info("CPU%d: cpuidle device already registered\n", cpu);
Sorry for not pointing this earlier,
perhaps pr_err makes more sense?
Anyway if you respin/ fix while applying:
Reviewed-by: Dhruva Gole <d-gole@...com>
--
Best regards,
Dhruva Gole
Texas Instruments Incorporated
Powered by blists - more mailing lists