linux/drivers/xen/xen-pciback
Konrad Rzeszutek Wilk e8801a7418 xen/pciback: Don't deadlock when unbinding.
As commit 0a9fd01529
'xen/pciback: Document the entry points for 'pcistub_put_pci_dev''
explained there are four entry points in this function.
Two of them are when the user fiddles in the SysFS to
unbind a device which might be in use by a guest or not.

Both 'unbind' states will cause a deadlock as the the PCI lock has
already been taken, which then pci_device_reset tries to take.

We can simplify this by requiring that all callers of
pcistub_put_pci_dev MUST hold the device lock. And then
we can just call the lockless version of pci_device_reset.

To make it even simpler we will modify xen_pcibk_release_pci_dev
to quality whether it should take a lock or not - as it ends
up calling xen_pcibk_release_pci_dev and needs to hold the lock.

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
2014-12-04 12:41:58 +00:00
..
Makefile xen/pciback: Have 'passthrough' option instead of XEN_PCIDEV_BACKEND_PASS and XEN_PCIDEV_BACKEND_VPCI 2011-07-19 21:04:20 -04:00
conf_space.c PCI: create common pcibios_err_to_errno 2012-06-12 09:21:42 -06:00
conf_space.h xen/pciback: Drop two backends, squash and cleanup some code. 2011-07-19 20:58:35 -04:00
conf_space_capability.c xen/pciback: Drop two backends, squash and cleanup some code. 2011-07-19 20:58:35 -04:00
conf_space_header.c xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
conf_space_quirks.c xen/pciback: miscellaneous adjustments 2011-09-21 18:17:59 -04:00
conf_space_quirks.h xen/pciback: Drop two backends, squash and cleanup some code. 2011-07-19 20:58:35 -04:00
passthrough.c xen/pciback: Don't deadlock when unbinding. 2014-12-04 12:41:58 +00:00
pci_stub.c xen/pciback: Don't deadlock when unbinding. 2014-12-04 12:41:58 +00:00
pciback.h xen/pciback: Don't deadlock when unbinding. 2014-12-04 12:41:58 +00:00
pciback_ops.c arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00
vpci.c xen/pciback: Don't deadlock when unbinding. 2014-12-04 12:41:58 +00:00
xenbus.c xen/pciback: Don't deadlock when unbinding. 2014-12-04 12:41:58 +00:00