On Tue, Nov 1, 2022 at 11:38 AM Jason Gunthorpe <jgg@xxxxxxxx> wrote: > I've been meaning to take a deeper look, but I'm thinking vfio_pci > doesn't need open_count at all any more. I spent some time looking at it, but I'm not very familiar with this area. None of the fields in vfio_pci_core_device look usable as a substitute for open_count, but calling pci_is_enabled() on the PCI device might be sufficient. pci_enable_device()/pci_disable_device() appear to be called in the right locations in vfio_pci_core. I'm happy to submit a separate patch to check pci_is_enabled() if the PCI device life cycle makes sense. Anthony