• Alex Williamson's avatar
    vfio-pci: Avoid deadlock on remove · d24cdbfd
    Alex Williamson authored
    If an attempt is made to unbind a device from vfio-pci while that
    device is in use, the request is blocked until the device becomes
    unused.  Unfortunately, that unbind path still grabs the device_lock,
    which certain things like __pci_reset_function() also want to take.
    This means we need to try to acquire the locks ourselves and use the
    pre-locked version, __pci_reset_function_locked().
    Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    d24cdbfd
vfio_pci.c 16 KB