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: <202511272353.nOqEau6n-lkp@intel.com>
Date: Thu, 27 Nov 2025 21:09:54 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: oe-kbuild@...ts.linux.dev, Huisong Li <lihuisong@...wei.com>,
	rafael@...nel.org, lenb@...nel.org
Cc: lkp@...el.com, oe-kbuild-all@...ts.linux.dev,
	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	Sudeep.Holla@....com, linuxarm@...wei.com,
	jonathan.cameron@...wei.com, zhanjie9@...ilicon.com,
	zhenglifeng1@...wei.com, yubowen8@...wei.com, lihuisong@...wei.com
Subject: Re: [PATCH 3/3] ACPI: processor: idle: Update idle states from
 avaiable power information

Hi Huisong,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Huisong-Li/cpuidle-Add-enable_cpuidle-interface/20251125-153615
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link:    https://lore.kernel.org/r/20251125072933.3706006-4-lihuisong%40huawei.com
patch subject: [PATCH 3/3] ACPI: processor: idle: Update idle states from avaiable power information
config: i386-randconfig-141-20251126 (https://download.01.org/0day-ci/archive/20251127/202511272353.nOqEau6n-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
| Closes: https://lore.kernel.org/r/202511272353.nOqEau6n-lkp@intel.com/

smatch warnings:
drivers/acpi/processor_idle.c:1339 acpi_processor_power_state_has_changed() error: we previously assumed '_pr' could be null (see line 1339)

vim +/_pr +1339 drivers/acpi/processor_idle.c

a36a7fecfe6071 Sudeep Holla              2016-07-21  1294  int acpi_processor_power_state_has_changed(struct acpi_processor *pr)
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1295  {
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1296  	int cpu;
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1297  	struct acpi_processor *_pr;
3d339dcbb56d8d Daniel Lezcano            2012-09-17  1298  	struct cpuidle_device *dev;
ffff9603ddf90a Huisong Li                2025-11-25  1299  	int ret = 0;
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1300  
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1301  	if (disabled_by_idle_boot_param())
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1302  		return 0;
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1303  
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1304  	if (!pr->flags.power_setup_done)
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1305  		return -ENODEV;
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1306  
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1307  	/*
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1308  	 * FIXME:  Design the ACPI notification to make it once per
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1309  	 * system instead of once per-cpu.  This condition is a hack
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1310  	 * to make the code that updates C-States be called once.
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1311  	 */
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1312  
9505626d7bfeb5 Paul E. McKenney          2012-02-28  1313  	if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) {
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1314  
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1315  		/* Protect against cpu-hotplug */
95ac706744de78 Sebastian Andrzej Siewior 2021-08-03  1316  		cpus_read_lock();
6726655dfdd2dc Jiri Kosina               2014-09-03  1317  		cpuidle_pause_and_lock();
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1318  
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1319  		/* Disable all cpuidle devices */
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1320  		for_each_online_cpu(cpu) {
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1321  			_pr = per_cpu(processors, cpu);
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1322  			if (!_pr || !_pr->flags.power_setup_done)
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1323  				continue;
3d339dcbb56d8d Daniel Lezcano            2012-09-17  1324  			dev = per_cpu(acpi_cpuidle_device, cpu);
3d339dcbb56d8d Daniel Lezcano            2012-09-17  1325  			cpuidle_disable_device(dev);
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1326  		}
46bcfad7a819bd Deepthi Dharwar           2011-10-28  1327  
ffff9603ddf90a Huisong Li                2025-11-25  1328  		/*
ffff9603ddf90a Huisong Li                2025-11-25  1329  		 * Update C-state information based on new power information.
ffff9603ddf90a Huisong Li                2025-11-25  1330  		 *
ffff9603ddf90a Huisong Li                2025-11-25  1331  		 * The same idle state is used for all CPUs.
ffff9603ddf90a Huisong Li                2025-11-25  1332  		 * The old idle state may not be usable anymore if fail to get
092a52b5417fd4 Huisong Li                2025-11-25  1333  		 * available ACPI power information from any online CPU.
ffff9603ddf90a Huisong Li                2025-11-25  1334  		 * The cpuidle of all CPUs should be disabled.
ffff9603ddf90a Huisong Li                2025-11-25  1335  		 */
092a52b5417fd4 Huisong Li                2025-11-25  1336  		ret = -ENODEV;
092a52b5417fd4 Huisong Li                2025-11-25  1337  		for_each_online_cpu(cpu) {
092a52b5417fd4 Huisong Li                2025-11-25  1338  			_pr = per_cpu(processors, cpu);
092a52b5417fd4 Huisong Li                2025-11-25 @1339  			if (!_pr && !_pr->flags.power_setup_done)
                                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
if _pr is NULL this will crash.  s/&&/||/

092a52b5417fd4 Huisong Li                2025-11-25  1340  				continue;
092a52b5417fd4 Huisong Li                2025-11-25  1341  			ret = acpi_processor_get_power_info(_pr);
092a52b5417fd4 Huisong Li                2025-11-25  1342  			if (!ret) {
092a52b5417fd4 Huisong Li                2025-11-25  1343  				acpi_processor_setup_cpuidle_states(_pr);

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ