[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0jjezx5sUEZwsbsw-iZiwbirmB+690-syOCur26DvOSNQ@mail.gmail.com>
Date: Tue, 11 Mar 2025 15:58:02 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Ulf Hansson <ulf.hansson@...aro.org>
Cc: rafael@...nel.org, Jacky Bai <ping.bai@....com>, daniel.lezcano@...aro.org,
lpieralisi@...nel.org, sudeep.holla@....com, james.morse@....com,
d-gole@...com, anup@...infault.org, paul.walmsley@...ive.com,
palmer@...belt.com, aou@...s.berkeley.edu, linux-pm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org, imx@...ts.linux.dev, khilman@...libre.com,
quic_tingweiz@...cinc.com, quic_yuanjiey@...cinc.com
Subject: Re: [PATCH v5] cpuidle: Init cpuidle only for present CPUs
On Tue, Mar 11, 2025 at 3:43 PM Ulf Hansson <ulf.hansson@...aro.org> wrote:
>
> On Fri, 7 Mar 2025 at 15:54, Jacky Bai <ping.bai@....com> wrote:
> >
> > for_each_possible_cpu() is currently used to initialize cpuidle
> > in below cpuidle drivers:
> > drivers/cpuidle/cpuidle-arm.c
> > drivers/cpuidle/cpuidle-big_little.c
> > drivers/cpuidle/cpuidle-psci.c
> > drivers/cpuidle/cpuidle-qcom-spm.c
> > drivers/cpuidle/cpuidle-riscv-sbi.c
> >
> > However, in cpu_dev_register_generic(), for_each_present_cpu()
> > is used to register CPU devices which means the CPU devices are
> > only registered for present CPUs and not all possible CPUs.
> >
> > With nosmp or maxcpus=0, only the boot CPU is present, lead
> > to the failure:
> >
> > | Failed to register cpuidle device for cpu1
> >
> > Then rollback to cancel all CPUs' cpuidle registration.
> >
> > Change for_each_possible_cpu() to for_each_present_cpu() in the
> > above cpuidle drivers to ensure it only registers cpuidle devices
> > for CPUs that are actually present.
> >
> > Fixes: b0c69e1214bc ("drivers: base: Use present CPUs in GENERIC_CPU_DEVICES")
> > Reviewed-by: Dhruva Gole <d-gole@...com>
> > Reviewed-by: Sudeep Holla <sudeep.holla@....com>
> > Tested-by: Yuanjie Yang <quic_yuanjiey@...cinc.com>
> > Signed-off-by: Jacky Bai <ping.bai@....com>
>
> Reviewed-by: Ulf Hansson <ulf.hansson@...aro.org>
>
> Rafael, I assume you will pick these up? Or let me know if you want me
> to take them via my pmdomain tree.
I can pick it up.
Powered by blists - more mailing lists