linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] PCI/IOV: Fix deadlock when removing PF with enabled SR-IOV
@ 2025-10-30 10:26 Niklas Schnelle
  2025-10-30 10:26 ` [PATCH 1/2] Revert "PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV" Niklas Schnelle
  2025-10-30 10:26 ` [PATCH 2/2] PCI/IOV: Fix race between SR-IOV enable/disable and hotplug Niklas Schnelle
  0 siblings, 2 replies; 5+ messages in thread
From: Niklas Schnelle @ 2025-10-30 10:26 UTC (permalink / raw)
  To: Bjorn Helgaas, Lukas Wunner
  Cc: Keith Busch, Gerd Bayer, Matthew Rosato, Benjamin Block,
	Halil Pasic, Farhan Ali, Julian Ruess, Heiko Carstens,
	Vasily Gorbik, Alexander Gordeev, linux-pci, linux-kernel,
	Niklas Schnelle

Hi Bjorn, Hi Lukas,

Doing additional testing for a distribution backport of commit
05703271c3cd ("PCI/IOV: Add PCI rescan-remove locking when
enabling/disabling SR-IOV") Benjamin found a hang with s390's
recover attribute. Further investigation showed this to be a deadlock by
recursively trying to take pci_rescan_remove lock when removing a PF
with enabled SR-IOV.

The issue can be reproduced on both s390 and x86_64 with:

    $ echo <NUM> > /sys/bus/pci/devices/<pf>/sriov_numvfs
    $ echo 1 > /sys/bus/pci/devices/<pf>/remove

As this seems worse than the original, hard to hit, race fixed by the
cited commit I think we first want to revert the broken fix.

Following that patch 2 attempts to fix the original issue by taking the
PCI rescan/remove lock directly before calling into the driver's
sriov_configure() callback establishing the rule that this should only
be called with the pci_rescan_remove_lock held.

Thanks,
Niklas

Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
---
Niklas Schnelle (2):
      Revert "PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV"
      PCI/IOV: Fix race between SR-IOV enable/disable and hotplug

 drivers/pci/iov.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
base-commit: dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa
change-id: 20251029-revert_sriov_lock-aef4557f360f

Best regards,
-- 
Niklas Schnelle


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

end of thread, other threads:[~2025-11-07 14:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30 10:26 [PATCH 0/2] PCI/IOV: Fix deadlock when removing PF with enabled SR-IOV Niklas Schnelle
2025-10-30 10:26 ` [PATCH 1/2] Revert "PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV" Niklas Schnelle
2025-11-07 10:54   ` Benjamin Block
2025-10-30 10:26 ` [PATCH 2/2] PCI/IOV: Fix race between SR-IOV enable/disable and hotplug Niklas Schnelle
2025-11-07 14:51   ` Benjamin Block

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).