Re: [PATCH v5 1/1] PCI/IOV: Add reentrant locking in sriov_add_vfs/sriov_del_vfs for complete serialization

From: Niklas Schnelle

Date: Tue Mar 03 2026 - 15:00:32 EST


On Tue, 2026-03-03 at 20:28 +0100, Lukas Wunner wrote:
> On Tue, Mar 03, 2026 at 07:19:31PM +0100, Lukas Wunner wrote:
> > Also, I would put this in the existing pci_lock_rescan_remove(),
> > i.e. without introducing a new _reentrant variant, because these
> > deadlocks exist elsewhere. They're known to happen on unplug in
> > pciehp as well.
>
> Actually, scratch this particular comment. The deadlock in pciehp
> is actually an AB-BA deadlock, not recursive acquisition.

Hi Lukas,

Do you have a link to a report or a lockdep splat for this issue? We're
currently working on another series restructuring the use of the
rescan/remove lock in s390 PCI code to handle another deadlock. And
while most of that is s390 specific code this may give helpful
insights. Also definitely underlines how tricky this lock is.

Thanks,
Niklas