Re: [PATCH] PCI/IOV: Fix recursive locking deadlock on pci_rescan_remove_lock
From: Sebastian Andrzej Siewior
Date: Wed Feb 11 2026 - 02:37:44 EST
On 2026-02-09 11:12:36 [+0100], Niklas Schnelle wrote:
> Agree, this looks related to the deadlock I later found with that
> commit and that lead to this revert+new fix that has now been queued
> for the v6.20/v7.00 here:
>
> https://lore.kernel.org/linux-pci/20251216-revert_sriov_lock-v3-0-dac4925a7621@xxxxxxxxxxxxx/
So this particular problem is solved then.
> That said I do find this approach interesting. Benjamin and I are
> actually still looking into a related problem with not taking the
> rescan/remove lock as part of vfio-pci tear down and there this
> approach could work better than just moving the locking up into the
> sysfs handler. So far we haven't found a good place to take the lock in
> that path that doesn't suffer from the recursive locking in other
> paths. On the other hand conditionally taking a mutex is always a
> little ugly in my opinion.
If you could split the calling chain and have one side "I need the lock"
and the other one "I don't need the lock" that would be nicer than this.
> Thanks,
> Niklas
Sebastian