diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2019-02-09 21:43:30 +0100 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2019-02-18 22:55:53 +0100 |
commit | 51ef3a004b1eb6241e56b3aa8495769a092a4dc2 (patch) | |
tree | efbec861a722c7ab01af18d246e286e45f4bb0a8 /drivers/iio | |
parent | vfio/spapr_tce: Skip unsetting already unset table (diff) | |
download | linux-51ef3a004b1eb6241e56b3aa8495769a092a4dc2.tar.xz linux-51ef3a004b1eb6241e56b3aa8495769a092a4dc2.zip |
vfio/pci: Restore device state on PM transition
PCI core handles save and restore of device state around reset, but
when using pci_set_power_state() we can unintentionally trigger a soft
reset of the device, where PCI core only restores the BAR state. If
we're using vfio-pci's idle D3 support to try to put devices into low
power when unused, this might trigger a reset when the device is woken
for use. Also power state management by the user, or within a guest,
can put the device into D3 power state with potentially limited
ability to restore the device if it should undergo a reset. The PCI
spec does not define the extent of a soft reset and many devices
reporting soft reset on D3->D0 transition do not undergo a PCI config
space reset. It's therefore assumed safe to unconditionally restore
the remainder of the state if the device indicates soft reset
support, even on a user initiated wakeup.
Implement a wrapper in vfio-pci to tag devices reporting PM reset
support, save their state on transitions into D3 and restore on
transitions back to D0.
Reported-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/iio')
0 files changed, 0 insertions, 0 deletions