* arch/s390/pci/pci_bus.c:312:3: warning: calling function 'zpci_bus_put' requires holding mutex 'pci_rescan_remove_lock' exclusively
@ 2026-09-30 13:19 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-30 13:19 UTC (permalink / raw)
To: Benjamin Block; +Cc: llvm, oe-kbuild-all, 0day robot
tree: https://github.com/intel-lab-lkp/linux/commits/Benjamin-Block/PCI-IOV-Make-pci_lock_rescan_remove-reentrant-and-protect-sriov_add_vfs-sriov_del_vfs/20260924-182927
head: ca5e1336f1cf45fbd7a38048643bceed16b522a9
commit: ca5e1336f1cf45fbd7a38048643bceed16b522a9 s390/pci: Fix circular/recursive deadlocks in PCI-bus and -device release
date: 6 days ago
config: s390-randconfig-2000-20260930 (https://download.01.org/0day-ci/archive/20260930/202609301529.u3dcGRKQ-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 1f84168f595dab2e23aab4181997da0a7f486dc7)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260930/202609301529.u3dcGRKQ-lkp@intel.com/reproduce)
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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609301529.u3dcGRKQ-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> arch/s390/pci/pci_bus.c:312:3: warning: calling function 'zpci_bus_put' requires holding mutex 'pci_rescan_remove_lock' exclusively [-Wthread-safety-analysis]
312 | zpci_bus_put(curp);
| ^
arch/s390/pci/pci_bus.c:445:3: warning: calling function 'zpci_bus_put' requires holding mutex 'pci_rescan_remove_lock' exclusively [-Wthread-safety-analysis]
445 | zpci_bus_put(zbus);
| ^
arch/s390/pci/pci_bus.c:473:2: warning: calling function 'zpci_bus_put' requires holding mutex 'pci_rescan_remove_lock' exclusively [-Wthread-safety-analysis]
473 | zpci_bus_put(zbus);
| ^
arch/s390/pci/pci_bus.c:483:2: warning: calling function 'zpci_bus_put' requires holding mutex 'pci_rescan_remove_lock' exclusively [-Wthread-safety-analysis]
483 | zpci_bus_put(zbus);
| ^
4 warnings generated.
--
>> arch/s390/pci/pci.c:638:2: warning: calling function 'zpci_zdev_put' requires holding mutex 'pci_rescan_remove_lock' exclusively [-Wthread-safety-analysis]
638 | zpci_zdev_put(zdev);
| ^
arch/s390/pci/pci.c:979:2: warning: calling function 'zpci_zdev_put' requires holding mutex 'pci_rescan_remove_lock' exclusively [-Wthread-safety-analysis]
979 | zpci_zdev_put(zdev);
| ^
>> arch/s390/pci/pci.c:1000:3: warning: calling function 'zpci_cleanup_bus_resources' requires holding mutex 'pci_rescan_remove_lock' exclusively [-Wthread-safety-analysis]
1000 | zpci_cleanup_bus_resources(zdev);
| ^
3 warnings generated.
vim +312 arch/s390/pci/pci_bus.c
44510d6fa0c00a Pierre Morel 2020-04-22 276
4cb92fa763823d Benjamin Block 2025-12-05 277 /**
4cb92fa763823d Benjamin Block 2025-12-05 278 * zpci_bus_get_next - get the next zbus object from given position in the list
4cb92fa763823d Benjamin Block 2025-12-05 279 * @pos: current position/cursor in the global zbus list
4cb92fa763823d Benjamin Block 2025-12-05 280 *
4cb92fa763823d Benjamin Block 2025-12-05 281 * Acquires and releases references as the cursor iterates (might also free/
4cb92fa763823d Benjamin Block 2025-12-05 282 * release the cursor). Is tolerant of concurrent operations on the list.
4cb92fa763823d Benjamin Block 2025-12-05 283 *
4cb92fa763823d Benjamin Block 2025-12-05 284 * To begin the iteration, set *@pos to %NULL before calling the function.
4cb92fa763823d Benjamin Block 2025-12-05 285 *
4cb92fa763823d Benjamin Block 2025-12-05 286 * *@pos is set to %NULL in cases where either the list is empty, or *@pos is
4cb92fa763823d Benjamin Block 2025-12-05 287 * the last element in the list.
4cb92fa763823d Benjamin Block 2025-12-05 288 *
4cb92fa763823d Benjamin Block 2025-12-05 289 * Context: Process context. May sleep.
4cb92fa763823d Benjamin Block 2025-12-05 290 */
4cb92fa763823d Benjamin Block 2025-12-05 291 void zpci_bus_get_next(struct zpci_bus **pos)
4cb92fa763823d Benjamin Block 2025-12-05 292 {
4cb92fa763823d Benjamin Block 2025-12-05 293 struct zpci_bus *curp = *pos, *next = NULL;
4cb92fa763823d Benjamin Block 2025-12-05 294
4cb92fa763823d Benjamin Block 2025-12-05 295 mutex_lock(&zbus_list_lock);
4cb92fa763823d Benjamin Block 2025-12-05 296 if (curp)
4cb92fa763823d Benjamin Block 2025-12-05 297 next = list_next_entry(curp, bus_next);
4cb92fa763823d Benjamin Block 2025-12-05 298 else
4cb92fa763823d Benjamin Block 2025-12-05 299 next = list_first_entry(&zbus_list, typeof(*curp), bus_next);
4cb92fa763823d Benjamin Block 2025-12-05 300
4cb92fa763823d Benjamin Block 2025-12-05 301 if (list_entry_is_head(next, &zbus_list, bus_next))
4cb92fa763823d Benjamin Block 2025-12-05 302 next = NULL;
4cb92fa763823d Benjamin Block 2025-12-05 303
4cb92fa763823d Benjamin Block 2025-12-05 304 if (next)
4cb92fa763823d Benjamin Block 2025-12-05 305 __zpci_bus_get(next);
4cb92fa763823d Benjamin Block 2025-12-05 306
4cb92fa763823d Benjamin Block 2025-12-05 307 *pos = next;
4cb92fa763823d Benjamin Block 2025-12-05 308 mutex_unlock(&zbus_list_lock);
4cb92fa763823d Benjamin Block 2025-12-05 309
4cb92fa763823d Benjamin Block 2025-12-05 310 /* zpci_bus_put() might drop refcount to 0 and locks zbus_list_lock */
4cb92fa763823d Benjamin Block 2025-12-05 311 if (curp)
4cb92fa763823d Benjamin Block 2025-12-05 @312 zpci_bus_put(curp);
4cb92fa763823d Benjamin Block 2025-12-05 313 }
4cb92fa763823d Benjamin Block 2025-12-05 314
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-30 13:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-30 13:19 arch/s390/pci/pci_bus.c:312:3: warning: calling function 'zpci_bus_put' requires holding mutex 'pci_rescan_remove_lock' exclusively kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox