On Wed, 13 Apr 2022 10:10:36 -0300 Jason Gunthorpe <jgg@xxxxxxxxxx> wrote: > @@ -1732,8 +1705,30 @@ static int vfio_pci_bus_notifier(struct notifier_block *nb, > static int vfio_pci_vf_init(struct vfio_pci_core_device *vdev) > { > struct pci_dev *pdev = vdev->pdev; > + struct vfio_pci_core_device *cur; > + struct pci_dev *physfn; > int ret; > > + if (pdev->is_virtfn) { > + /* > + * If this VF was created by our vfio_pci_core_sriov_configure() > + * then we can find the PF vfio_pci_core_device now, and due to > + * the locking in pci_disable_sriov() it cannot change until > + * this VF device driver is removed. > + */ > + physfn = pci_physfn(vdev->pdev); > + mutex_lock(&vfio_pci_sriov_pfs_mutex); > + list_for_each_entry (cur, &vfio_pci_sriov_pfs, sriov_pfs_item) { ^ | checkpatch noted the space here ---- Fixed on commit, looks good otherwise. Applied to vfio for-linus branch for v5.18. Thanks, Alex