lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <AS8PR04MB864270D86D36F0AEDFD5922A87212@AS8PR04MB8642.eurprd04.prod.outlook.com>
Date: Wed, 20 Nov 2024 09:41:27 +0000
From: Jacky Bai <ping.bai@....com>
To: Dhruva Gole <d-gole@...com>
CC: "lpieralisi@...nel.org" <lpieralisi@...nel.org>, "sudeep.holla@....com"
	<sudeep.holla@....com>, "rafael@...nel.org" <rafael@...nel.org>,
	"daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
	"james.morse@....com" <james.morse@....com>, "linux-pm@...r.kernel.org"
	<linux-pm@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
	"khilman@...libre.com" <khilman@...libre.com>
Subject: RE: [PATCH] cpuidle: psci: Init cpuidle only for present CPUs

> 
> Hi,
> 
> On Nov 20, 2024 at 15:06:08 +0800, Jacky Bai wrote:
> > With 'nosmp' or 'maxcpus=0' boot command line paremeters,
> 
> s/paremeters/parameters
> 
> checkpatch should've caught this for you.
> 

Thx, it is my bad, the checkpatch error fix was missed.
Will fix it in v2.

> > the 'cpu_present_mask' may not be the same as 'cpu_possible_mask'
> >
> > In current psci cpuidle driver init, for_each_possible_cpu() is used
> > to init the cpudile for each possible CPU. but in
> 
> s/cpudile/cpuidle
> 
> > drivers/base/cpu.c ->cpu_dev_register_generic(),
> > for_each_present_cpu() is used to register cpu device for present
> > CPUs.
> >
> > When boot system with 'nosmp' or 'maxcpus=0', the cpuidle driver init
> > failed due to no valid CPU device sysfs node for non-boot CPUs.
> >
> > [ 0.182993] Failed to register cpuidle device for cpu1
> 
> Please can we get a "Fixes:" Tag?
> 

OK, will add it in v2.

BR

> >
> > Use for_each_present_cpu() to register cpuidle only for present CPUs.
> >
> > Signed-off-by: Jacky Bai <ping.bai@....com>
> > ---
> >  drivers/cpuidle/cpuidle-psci.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/cpuidle/cpuidle-psci.c
> > b/drivers/cpuidle/cpuidle-psci.c index 2562dc001fc1..00117e9b33e8
> > 100644
> > --- a/drivers/cpuidle/cpuidle-psci.c
> > +++ b/drivers/cpuidle/cpuidle-psci.c
> > @@ -410,7 +410,7 @@ static int psci_cpuidle_probe(struct
> platform_device *pdev)
> >       struct cpuidle_driver *drv;
> >       struct cpuidle_device *dev;
> >
> > -     for_each_possible_cpu(cpu) {
> > +     for_each_present_cpu(cpu) {
> 
> With above concerns addressed,
> 
> Reviewed-by: Dhruva Gole <d-gole@...com>
> 
> >               ret = psci_idle_init_cpu(&pdev->dev, cpu);
> >               if (ret)
> >                       goto out_fail;
> > --
> > 2.34.1
> >
> >
> 
> --
> Best regards,
> Dhruva Gole
> Texas Instruments Incorporated

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ