diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 18:39:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 18:39:34 -0400 |
commit | 5e152b4c9e0fce6149c74406346a7ae7e7a17727 (patch) | |
tree | 12503a50142797c1babfd87099c193b3e4d54f93 /virt | |
parent | a77febbef105554c5a37241cf903f48ab7bc03c7 (diff) | |
parent | 9251bac97d47fdaea406ea0595c2d0aa50022f12 (diff) |
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (27 commits)
PCI: Don't use dmi_name_in_vendors in quirk
PCI: remove unused AER functions
PCI/sysfs: move bus cpuaffinity to class dev_attrs
PCI: add rescan to /sys/.../pci_bus/.../
PCI: update bridge resources to get more big ranges when allocating space (again)
KVM: Use pci_store/load_saved_state() around VM device usage
PCI: Add interfaces to store and load the device saved state
PCI: Track the size of each saved capability data area
PCI/e1000e: Add and use pci_disable_link_state_locked()
x86/PCI: derive pcibios_last_bus from ACPI MCFG
PCI: add latency tolerance reporting enable/disable support
PCI: add OBFF enable/disable support
PCI: add ID-based ordering enable/disable support
PCI hotplug: acpiphp: assume device is in state D0 after powering on a slot.
PCI: Set PCIE maxpayload for card during hotplug insertion
PCI/ACPI: Report _OSC control mask returned on failure to get control
x86/PCI: irq and pci_ids patch for Intel Panther Point DeviceIDs
PCI: handle positive error codes
PCI: check pci_vpd_pci22_wait() return
PCI: Use ICH6_GPIO_EN in ich6_lpc_acpi_gpio
...
Fix up trivial conflicts in include/linux/pci_ids.h: commit a6e5e2be4461
moved the intel SMBUS ID definitons to the i2c-i801.c driver.
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/assigned-dev.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c index ae72ae604c89..6cc4b97ec458 100644 --- a/virt/kvm/assigned-dev.c +++ b/virt/kvm/assigned-dev.c | |||
@@ -197,8 +197,13 @@ static void kvm_free_assigned_device(struct kvm *kvm, | |||
197 | { | 197 | { |
198 | kvm_free_assigned_irq(kvm, assigned_dev); | 198 | kvm_free_assigned_irq(kvm, assigned_dev); |
199 | 199 | ||
200 | __pci_reset_function(assigned_dev->dev); | 200 | pci_reset_function(assigned_dev->dev); |
201 | pci_restore_state(assigned_dev->dev); | 201 | if (pci_load_and_free_saved_state(assigned_dev->dev, |
202 | &assigned_dev->pci_saved_state)) | ||
203 | printk(KERN_INFO "%s: Couldn't reload %s saved state\n", | ||
204 | __func__, dev_name(&assigned_dev->dev->dev)); | ||
205 | else | ||
206 | pci_restore_state(assigned_dev->dev); | ||
202 | 207 | ||
203 | pci_release_regions(assigned_dev->dev); | 208 | pci_release_regions(assigned_dev->dev); |
204 | pci_disable_device(assigned_dev->dev); | 209 | pci_disable_device(assigned_dev->dev); |
@@ -516,7 +521,10 @@ static int kvm_vm_ioctl_assign_device(struct kvm *kvm, | |||
516 | 521 | ||
517 | pci_reset_function(dev); | 522 | pci_reset_function(dev); |
518 | pci_save_state(dev); | 523 | pci_save_state(dev); |
519 | 524 | match->pci_saved_state = pci_store_saved_state(dev); | |
525 | if (!match->pci_saved_state) | ||
526 | printk(KERN_DEBUG "%s: Couldn't store %s saved state\n", | ||
527 | __func__, dev_name(&dev->dev)); | ||
520 | match->assigned_dev_id = assigned_dev->assigned_dev_id; | 528 | match->assigned_dev_id = assigned_dev->assigned_dev_id; |
521 | match->host_segnr = assigned_dev->segnr; | 529 | match->host_segnr = assigned_dev->segnr; |
522 | match->host_busnr = assigned_dev->busnr; | 530 | match->host_busnr = assigned_dev->busnr; |
@@ -546,7 +554,9 @@ out: | |||
546 | mutex_unlock(&kvm->lock); | 554 | mutex_unlock(&kvm->lock); |
547 | return r; | 555 | return r; |
548 | out_list_del: | 556 | out_list_del: |
549 | pci_restore_state(dev); | 557 | if (pci_load_and_free_saved_state(dev, &match->pci_saved_state)) |
558 | printk(KERN_INFO "%s: Couldn't reload %s saved state\n", | ||
559 | __func__, dev_name(&dev->dev)); | ||
550 | list_del(&match->list); | 560 | list_del(&match->list); |
551 | pci_release_regions(dev); | 561 | pci_release_regions(dev); |
552 | out_disable: | 562 | out_disable: |