summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAbhishek Sahu <abhsahu@nvidia.com>2022-08-29 17:18:50 +0530
committerAlex Williamson <alex.williamson@redhat.com>2022-09-01 15:29:11 -0600
commit453e6c98fd2bdae0df9adbc86af8d8bf1164edd5 (patch)
tree7bfdd49212e04dec7d0eaf6a380e938187b71daa /kernel
parentcc2742fe3660cc6500021d3da8f937d326392dbd (diff)
downloadlinux-stable-453e6c98fd2bdae0df9adbc86af8d8bf1164edd5.tar.gz
linux-stable-453e6c98fd2bdae0df9adbc86af8d8bf1164edd5.tar.bz2
linux-stable-453e6c98fd2bdae0df9adbc86af8d8bf1164edd5.zip
vfio/pci: Implement VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP
This patch implements VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP device feature. In the VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY, if there is any access for the VFIO device on the host side, then the device will be moved out of the low power state without the user's guest driver involvement. Once the device access has been finished, then the host can move the device again into low power state. With the low power entry happened through VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP, the device will not be moved back into the low power state and a notification will be sent to the user by triggering wakeup eventfd. vfio_pci_core_pm_entry() will be called for both the variants of low power feature entry so add an extra argument for wakeup eventfd context and store locally in 'struct vfio_pci_core_device'. For the entry happened without wakeup eventfd, all the exit related handling will be done by the LOW_POWER_EXIT device feature only. When the LOW_POWER_EXIT will be called, then the vfio core layer vfio_device_pm_runtime_get() will increment the usage count and will resume the device. In the driver runtime_resume callback, the 'pm_wake_eventfd_ctx' will be NULL. Then vfio_pci_core_pm_exit() will call vfio_pci_runtime_pm_exit() and all the exit related handling will be done. For the entry happened with wakeup eventfd, in the driver resume callback, eventfd will be triggered and all the exit related handling will be done. When vfio_pci_runtime_pm_exit() will be called by vfio_pci_core_pm_exit(), then it will return early. But if the runtime suspend has not happened on the host side, then all the exit related handling will be done in vfio_pci_core_pm_exit() only. Signed-off-by: Abhishek Sahu <abhsahu@nvidia.com> Link: https://lore.kernel.org/r/20220829114850.4341-6-abhsahu@nvidia.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions