diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-01-04 14:10:32 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-01-07 20:35:55 -0500 |
commit | 97309d3974fd371920cc8b932e2b6b5e4100c7c6 (patch) | |
tree | a25ccc64bcc8eedc1a49214bc98a8c1ed3ceedd8 /drivers/xen | |
parent | a800651e8893007d3a12bc281f0265f18043c4fa (diff) |
xen/pciback: Move the PCI_DEV_FLAGS_ASSIGNED ops to the "[un|]bind"
operation instead of doing it per guest creation/disconnection. Without
this we could have potentially unloaded the vf driver from the
xen pciback control even if the driver was binded to the xen-pciback.
This will hold on to it until the user "unbind"s the PCI device using
SysFS.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/xen-pciback/pci_stub.c | 2 | ||||
-rw-r--r-- | drivers/xen/xen-pciback/xenbus.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index 8f06e1ed028c..405445965690 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c | |||
@@ -99,6 +99,7 @@ static void pcistub_device_release(struct kref *kref) | |||
99 | kfree(pci_get_drvdata(psdev->dev)); | 99 | kfree(pci_get_drvdata(psdev->dev)); |
100 | pci_set_drvdata(psdev->dev, NULL); | 100 | pci_set_drvdata(psdev->dev, NULL); |
101 | 101 | ||
102 | psdev->dev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED; | ||
102 | pci_dev_put(psdev->dev); | 103 | pci_dev_put(psdev->dev); |
103 | 104 | ||
104 | kfree(psdev); | 105 | kfree(psdev); |
@@ -331,6 +332,7 @@ static int __devinit pcistub_init_device(struct pci_dev *dev) | |||
331 | dev_dbg(&dev->dev, "reset device\n"); | 332 | dev_dbg(&dev->dev, "reset device\n"); |
332 | xen_pcibk_reset_device(dev); | 333 | xen_pcibk_reset_device(dev); |
333 | 334 | ||
335 | dev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED; | ||
334 | return 0; | 336 | return 0; |
335 | 337 | ||
336 | config_release: | 338 | config_release: |
diff --git a/drivers/xen/xen-pciback/xenbus.c b/drivers/xen/xen-pciback/xenbus.c index c80f9c84d08e..87c5dc3368d0 100644 --- a/drivers/xen/xen-pciback/xenbus.c +++ b/drivers/xen/xen-pciback/xenbus.c | |||
@@ -241,7 +241,6 @@ static int xen_pcibk_export_device(struct xen_pcibk_device *pdev, | |||
241 | goto out; | 241 | goto out; |
242 | 242 | ||
243 | dev_dbg(&dev->dev, "registering for %d\n", pdev->xdev->otherend_id); | 243 | dev_dbg(&dev->dev, "registering for %d\n", pdev->xdev->otherend_id); |
244 | dev->dev_flags |= PCI_DEV_FLAGS_ASSIGNED; | ||
245 | if (xen_register_device_domain_owner(dev, | 244 | if (xen_register_device_domain_owner(dev, |
246 | pdev->xdev->otherend_id) != 0) { | 245 | pdev->xdev->otherend_id) != 0) { |
247 | dev_err(&dev->dev, "device has been assigned to another " \ | 246 | dev_err(&dev->dev, "device has been assigned to another " \ |
@@ -281,7 +280,6 @@ static int xen_pcibk_remove_device(struct xen_pcibk_device *pdev, | |||
281 | } | 280 | } |
282 | 281 | ||
283 | dev_dbg(&dev->dev, "unregistering for %d\n", pdev->xdev->otherend_id); | 282 | dev_dbg(&dev->dev, "unregistering for %d\n", pdev->xdev->otherend_id); |
284 | dev->dev_flags &= ~PCI_DEV_FLAGS_ASSIGNED; | ||
285 | xen_unregister_device_domain_owner(dev); | 283 | xen_unregister_device_domain_owner(dev); |
286 | 284 | ||
287 | xen_pcibk_release_pci_dev(pdev, dev); | 285 | xen_pcibk_release_pci_dev(pdev, dev); |