mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
virtio: pci: add PM notification handlers for restore, freeze, thaw, poweroff
Handle thaw, restore and freeze notifications from the PM core. Expose these to individual virtio drivers that can quiesce and resume vq operations. For drivers not implementing the thaw() method, use the restore method instead. These functions also save device-specific data so that the device can be put in pre-suspend state after resume, and disable and enable the PCI device in the freeze and resume functions, respectively. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
d077536386
commit
f0fe6f1150
2 changed files with 97 additions and 2 deletions
|
@ -94,6 +94,11 @@ struct virtio_driver {
|
|||
int (*probe)(struct virtio_device *dev);
|
||||
void (*remove)(struct virtio_device *dev);
|
||||
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
|
||||
};
|
||||
|
||||
int register_virtio_driver(struct virtio_driver *drv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue