public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] vfio/pci: fixes related with power management
@ 2022-02-17 12:21 Abhishek Sahu
  2022-02-17 12:21 ` [PATCH v3 1/2] vfio/pci: fix memory leak during D3hot to D0 transition Abhishek Sahu
  2022-02-17 12:21 ` [PATCH v3 2/2] vfio/pci: wake-up devices around reset functions Abhishek Sahu
  0 siblings, 2 replies; 3+ messages in thread
From: Abhishek Sahu @ 2022-02-17 12:21 UTC (permalink / raw)
  To: kvm, Alex Williamson, Cornelia Huck
  Cc: Max Gurtovoy, Yishai Hadas, Zhen Lei, Jason Gunthorpe,
	linux-kernel, Abhishek Sahu

The commit 51ef3a004b1e ("vfio/pci: Restore device state on PM
transition") added a wrapper function vfio_pci_probe_power_state().
For the devices which do not have No_Soft_Reset bit set in its
PMCSR config register, inside this function, the current PCI state
will be saved locally in 'vfio_pci_core_device::pm_save' during
D0->D3hot transition and same will be restored back during D3hot->D0
transition. We have few IOCTLs and internal functions in vfio-pci
driver which can be invoked when the device power state is non-D0.
This patch series fixes issues around reset-related API's if reset
is invoked in the D3hot state.

* Changes in v3

- Split the changes into 2 patches.
- Updated comments and commit message according to updated changes.
- Added code to wakeup devices for vfio_pci_dev_set_try_reset().

* Changes in v2

- Add the Fixes tag and sent this patch independently.
- Invoke vfio_pci_set_power_state() before invoking reset related API's.
- Removed saving of power state locally.
- Removed warning before 'kfree(vdev->pm_save)'.
- Updated comments and commit message according to updated changes.

* v1 of this patch was sent in
https://lore.kernel.org/lkml/20220124181726.19174-4-abhsahu@nvidia.com/

Abhishek Sahu (2):
  vfio/pci: fix memory leak during D3hot to D0 transition
  vfio/pci: wake-up devices around reset functions

 drivers/vfio/pci/vfio_pci_core.c | 61 ++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-17 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-17 12:21 [PATCH v3 0/2] vfio/pci: fixes related with power management Abhishek Sahu
2022-02-17 12:21 ` [PATCH v3 1/2] vfio/pci: fix memory leak during D3hot to D0 transition Abhishek Sahu
2022-02-17 12:21 ` [PATCH v3 2/2] vfio/pci: wake-up devices around reset functions Abhishek Sahu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox