aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2012-03-29 03:21:41 -0400
committerAmit Shah <amit.shah@redhat.com>2012-03-30 22:39:51 -0400
commit04c2322bee841121cfdd7f284e1d4274e9e60e33 (patch)
treeb1968224ab84bef66adba00d7480d4b449a0c946 /drivers/virtio
parent0517fdd156c46c23501451158c6b0ff9fb7236d1 (diff)
virtio-pci: S3 support
There's no difference in supporting S3 and S4 for virtio devices: the vqs have to be re-created as the device has to be assumed to be reset at restore-time. Since S4 already handles this situation, we can directly use the same code and callbacks for S3 support. Signed-off-by: Amit Shah <amit.shah@redhat.com>
Diffstat (limited to 'drivers/virtio')
-rw-r--r--drivers/virtio/virtio_pci.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 982d6c9a2bf0..0fa4f8551c3a 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -720,24 +720,6 @@ static void __devexit virtio_pci_remove(struct pci_dev *pci_dev)
720} 720}
721 721
722#ifdef CONFIG_PM 722#ifdef CONFIG_PM
723static int virtio_pci_suspend(struct device *dev)
724{
725 struct pci_dev *pci_dev = to_pci_dev(dev);
726
727 pci_save_state(pci_dev);
728 pci_set_power_state(pci_dev, PCI_D3hot);
729 return 0;
730}
731
732static int virtio_pci_resume(struct device *dev)
733{
734 struct pci_dev *pci_dev = to_pci_dev(dev);
735
736 pci_restore_state(pci_dev);
737 pci_set_power_state(pci_dev, PCI_D0);
738 return 0;
739}
740
741static int virtio_pci_freeze(struct device *dev) 723static int virtio_pci_freeze(struct device *dev)
742{ 724{
743 struct pci_dev *pci_dev = to_pci_dev(dev); 725 struct pci_dev *pci_dev = to_pci_dev(dev);
@@ -786,12 +768,12 @@ static int virtio_pci_restore(struct device *dev)
786} 768}
787 769
788static const struct dev_pm_ops virtio_pci_pm_ops = { 770static const struct dev_pm_ops virtio_pci_pm_ops = {
789 .suspend = virtio_pci_suspend, 771 .suspend = virtio_pci_freeze,
790 .resume = virtio_pci_resume, 772 .resume = virtio_pci_restore,
791 .freeze = virtio_pci_freeze, 773 .freeze = virtio_pci_freeze,
792 .thaw = virtio_pci_restore, 774 .thaw = virtio_pci_restore,
793 .restore = virtio_pci_restore, 775 .restore = virtio_pci_restore,
794 .poweroff = virtio_pci_suspend, 776 .poweroff = virtio_pci_freeze,
795}; 777};
796#endif 778#endif
797 779