]> git.baikalelectronics.ru Git - kernel.git/commit
vfio-pci: Avoid deadlock on remove
authorAlex Williamson <alex.williamson@redhat.com>
Mon, 10 Jun 2013 22:40:57 +0000 (16:40 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 24 Jul 2013 22:36:41 +0000 (16:36 -0600)
commitfd3c34eaa76f8dff616de6574011f076449d87b5
tree5121604d0025974356f09bb0027e018f1be05e03
parent0cc5c0fad1f2f7aca99cf3f75c018d09fafde70c
vfio-pci: Avoid deadlock on remove

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: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci.c