Skip to content

Commit 04c2322

Browse files
committed
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 <[email protected]>
1 parent 0517fdd commit 04c2322

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

drivers/virtio/virtio_pci.c

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -720,24 +720,6 @@ static void __devexit virtio_pci_remove(struct pci_dev *pci_dev)
720720
}
721721

722722
#ifdef CONFIG_PM
723-
static 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-
732-
static 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-
741723
static int virtio_pci_freeze(struct device *dev)
742724
{
743725
struct pci_dev *pci_dev = to_pci_dev(dev);
@@ -786,12 +768,12 @@ static int virtio_pci_restore(struct device *dev)
786768
}
787769

788770
static const struct dev_pm_ops virtio_pci_pm_ops = {
789-
.suspend = virtio_pci_suspend,
790-
.resume = virtio_pci_resume,
771+
.suspend = virtio_pci_freeze,
772+
.resume = virtio_pci_restore,
791773
.freeze = virtio_pci_freeze,
792774
.thaw = virtio_pci_restore,
793775
.restore = virtio_pci_restore,
794-
.poweroff = virtio_pci_suspend,
776+
.poweroff = virtio_pci_freeze,
795777
};
796778
#endif
797779

0 commit comments

Comments
 (0)