From e47d854e57698d3be4579d2118f6057f9f12a17c Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Thu, 29 Mar 2012 12:48:19 +0530 Subject: virtio: balloon: Allow stats update after restore from S4 There's no reason stats update after restore can't work. If a host requested for stats, and before servicing the request, the guest entered S4, upon restore, the stats request can still be processed and sent off to the host. Signed-off-by: Amit Shah --- drivers/virtio/virtio_balloon.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'drivers/virtio/virtio_balloon.c') diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 958e5129c60..9f1bb36d67f 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -405,14 +405,6 @@ static int virtballoon_thaw(struct virtio_device *vdev) static int virtballoon_restore(struct virtio_device *vdev) { - struct virtio_balloon *vb = vdev->priv; - - /* - * If a request wasn't complete at the time of freezing, this - * could have been set. - */ - vb->need_stats_update = 0; - return restore_common(vdev); } #endif -- cgit v1.2.3-70-g09d2 From f38f8387cbdc4138a492ce9f2a5f04fd3cd3cf33 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Thu, 29 Mar 2012 12:50:20 +0530 Subject: virtio: drop thaw PM operation The thaw operation was used by the balloon driver, but after the last commit there's no reason to have separate thaw and restore callbacks. Signed-off-by: Amit Shah --- drivers/virtio/virtio_balloon.c | 6 ------ drivers/virtio/virtio_pci.c | 28 +--------------------------- include/linux/virtio.h | 1 - 3 files changed, 1 insertion(+), 34 deletions(-) (limited to 'drivers/virtio/virtio_balloon.c') diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 9f1bb36d67f..05f0a80818a 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -398,11 +398,6 @@ static int restore_common(struct virtio_device *vdev) return 0; } -static int virtballoon_thaw(struct virtio_device *vdev) -{ - return restore_common(vdev); -} - static int virtballoon_restore(struct virtio_device *vdev) { return restore_common(vdev); @@ -426,7 +421,6 @@ static struct virtio_driver virtio_balloon_driver = { #ifdef CONFIG_PM .freeze = virtballoon_freeze, .restore = virtballoon_restore, - .thaw = virtballoon_thaw, #endif }; diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 635e1efb379..a35a402dfd7 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -773,32 +773,6 @@ static int restore_common(struct device *dev) return ret; } -static int virtio_pci_thaw(struct device *dev) -{ - struct pci_dev *pci_dev = to_pci_dev(dev); - struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); - struct virtio_driver *drv; - int ret; - - ret = restore_common(dev); - if (ret) - return ret; - - drv = container_of(vp_dev->vdev.dev.driver, - struct virtio_driver, driver); - - if (drv && drv->thaw) - ret = drv->thaw(&vp_dev->vdev); - else if (drv && drv->restore) - ret = drv->restore(&vp_dev->vdev); - - /* Finally, tell the device we're all set */ - if (!ret) - vp_set_status(&vp_dev->vdev, vp_dev->saved_status); - - return ret; -} - static int virtio_pci_restore(struct device *dev) { struct pci_dev *pci_dev = to_pci_dev(dev); @@ -824,7 +798,7 @@ static const struct dev_pm_ops virtio_pci_pm_ops = { .suspend = virtio_pci_suspend, .resume = virtio_pci_resume, .freeze = virtio_pci_freeze, - .thaw = virtio_pci_thaw, + .thaw = virtio_pci_restore, .restore = virtio_pci_restore, .poweroff = virtio_pci_suspend, }; diff --git a/include/linux/virtio.h b/include/linux/virtio.h index d0018d27c28..8efd28ae559 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -96,7 +96,6 @@ struct virtio_driver { void (*config_changed)(struct virtio_device *dev); #ifdef CONFIG_PM int (*freeze)(struct virtio_device *dev); - int (*thaw)(struct virtio_device *dev); int (*restore)(struct virtio_device *dev); #endif }; -- cgit v1.2.3-70-g09d2