[PATCH] cpufreq: Init cpufreq only for present CPUs
Jacky Bai
ping.bai at nxp.com
Mon Mar 10 03:56:51 PDT 2025
Hi Sudeep,
> Subject: Re: [PATCH] cpufreq: Init cpufreq only for present CPUs
>
> On Mon, Mar 10, 2025 at 03:16:40PM +0800, Jacky Bai wrote:
> > for_each_possible_cpu() is currently used to initialize cpufreq in
> > below cpufreq drivers:
> > drivers/cpufreq/cpufreq-dt.c
> > drivers/cpufreq/mediatek-cpufreq-hw.c
> > drivers/cpufreq/mediatek-cpufreq.c
> > drivers/cpufreq/qcom-cpufreq-nvmem.c
> > drivers/cpufreq/sun50i-cpufreq-nvmem.c
> >
>
> Again how did you just narrow down to the list above ? Is that just a random
> pick ? As I suggested with corresponding cpuidle changes, please look into the
> details in side the for_each_possible_cpu() loop and then decide if it applies
> or not.
>
> For me, it applied to the below files as well at the least.
>
> drivers/cpufreq/mvebu-cpufreq.c
> drivers/cpufreq/qcom-cpufreq-hw.c
> drivers/cpufreq/scmi-cpufreq.c
> drivers/cpufreq/scpi-cpufreq.c
> drivers/cpufreq/virtual-cpufreq.c
>
I checked these drivers before, these drivers has logic to check
if the cpu device is available, then skip the not present cpu.
>From my understanding, using 'for_each_possible_cpu' will not
cause the cpufreq driver failed to register for nosmp case, so I skipped.
For those I just changed in the patch, the cpufreq will be failed to register totally.
I can changes all of them together as you suggested if no other guys object.
Thank you for your comments. :)
BR
Jacky Bai
> Please check everything thoroughly as I just looked at these briefly.
>
> --
> Regards,
> Sudeep
More information about the linux-arm-kernel
mailing list