[PATCH v3 0/1] PCI/IOV: Add reentrant locking in sriov_add_vfs/sriov_del_vfs

ionut.nechita@windriver.com posted 1 patch 1 month, 2 weeks ago
There is a newer version of this series
drivers/pci/iov.c   |  7 +++++++
drivers/pci/probe.c | 19 +++++++++++++++++++
include/linux/pci.h |  2 ++
3 files changed, 28 insertions(+)
[PATCH v3 0/1] PCI/IOV: Add reentrant locking in sriov_add_vfs/sriov_del_vfs
Posted by ionut.nechita@windriver.com 1 month, 2 weeks ago
From: Ionut Nechita <ionut_n2001@yahoo.com>

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

Hi,

This is v3 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.

Rebased on linux-next (next-20260225).

No code changes from v2. Only added collected tags.

Changes in v3:
 - Rebased on linux-next (next-20260225)
 - Added Tested-by from Dragos Tatulea (NVIDIA)
 - Added Reviewed-by from Benjamin Block (IBM)
 - No code changes from v2

Changes in v2:
 - Renamed from pci_lock_rescan_remove_nested() to
   pci_lock_rescan_remove_reentrant() to avoid confusion with
   mutex_lock_nested() lockdep annotations (Benjamin Block)
 - Added pci_unlock_rescan_remove_reentrant(const bool locked) helper
   to avoid open-coding conditional unlock at each call site
   (Benjamin Block)
 - Moved declarations from drivers/pci/pci.h to include/linux/pci.h
   alongside existing lock/unlock declarations (Benjamin Block)
 - 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]
Link: https://lore.kernel.org/linux-pci/
  20260219212620.3801194-1-ionut.nechita@windriver.com/ [v2]

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
Re: [PATCH v3 0/1] PCI/IOV: Add reentrant locking in sriov_add_vfs/sriov_del_vfs
Posted by Benjamin Block 1 month, 2 weeks ago
Hey Ionut,

On Wed, Feb 25, 2026 at 10:24:33PM +0200, ionut.nechita@windriver.com wrote:
> This is v3 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.
> 
> Rebased on linux-next (next-20260225).
> 
> No code changes from v2. Only added collected tags.
> 
> Changes in v3:
>  - Rebased on linux-next (next-20260225)
>  - Added Tested-by from Dragos Tatulea (NVIDIA)
>  - Added Reviewed-by from Benjamin Block (IBM)

I am reviewing/testing the patch, but I have not given you my Reviewed-by yet.

-- 
Best Regards, Benjamin Block        /        Linux on IBM Z Kernel Development
IBM Deutschland Research & Development GmbH    /   https://www.ibm.com/privacy
Vors. Aufs.-R.: Wolfgang Wendt         /        Geschäftsführung: David Faller
Sitz der Ges.: Ehningen     /     Registergericht: AmtsG Stuttgart, HRB 243294