mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/1] PCI/IOV: Add reentrant locking in sriov_add_vfs/sriov_del_vfs
@ 2026-02-19 21:26 Ionut Nechita (Wind River)
  2026-02-19 21:26 ` [PATCH v2] PCI/IOV: Add reentrant locking in sriov_add_vfs/sriov_del_vfs for complete serialization Ionut Nechita (Wind River)
  0 siblings, 1 reply; 3+ messages in thread
From: Ionut Nechita (Wind River) @ 2026-02-19 21:26 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Bjorn Helgaas, Sebastian Ott, Niklas Schnelle, Benjamin Block,
	Farhan Ali, Julian Ruess, Ionut Nechita, linux-pci, linux-kernel,
	stable, Ionut Nechita

From: Ionut Nechita <ionut.nechita@windriver.com>

Hi,

This is v2 of the patch adding owner-tracked reentrant locking for
pci_rescan_remove_lock in sriov_add_vfs() and sriov_del_vfs(), to
serialize VF addition/removal against concurrent hotplug events
(including platform-generated events on s390) without deadlocking
on paths that already hold the lock.

v1 was tested by Benjamin Block on s390 with lockdep enabled, including
hot-unplug events and driver unbind paths, with no splats or deadlocks.

Changes in v2 (all based on review feedback from Benjamin Block):
 - Renamed from pci_lock_rescan_remove_nested() to
   pci_lock_rescan_remove_reentrant() to avoid confusion with
   mutex_lock_nested() lockdep annotations
 - Added pci_unlock_rescan_remove_reentrant(const bool locked) helper
   to avoid open-coding conditional unlock at each call site
 - Moved declarations from drivers/pci/pci.h to include/linux/pci.h
   alongside existing lock/unlock declarations
 - Simplified callers: removed negation of return value and manual
   conditional unlock in favor of the paired lock/unlock helpers

Link: https://lore.kernel.org/linux-pci/
  20260214193235.262219-5-ionut.nechita@windriver.com/ [v1]

Ionut Nechita (1):
  PCI/IOV: Add reentrant locking in sriov_add_vfs/sriov_del_vfs for
    complete serialization

 drivers/pci/iov.c   |  7 +++++++
 drivers/pci/probe.c | 19 +++++++++++++++++++
 include/linux/pci.h |  2 ++
 3 files changed, 28 insertions(+)

--
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-25 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-19 21:26 [PATCH v2 0/1] PCI/IOV: Add reentrant locking in sriov_add_vfs/sriov_del_vfs Ionut Nechita (Wind River)
2026-02-19 21:26 ` [PATCH v2] PCI/IOV: Add reentrant locking in sriov_add_vfs/sriov_del_vfs for complete serialization Ionut Nechita (Wind River)
2026-02-25 18:43   ` Dragos Tatulea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®