PCI: Add flag for devices that don't reset on D3hot->D0 transition
authorAlex Williamson <alex.williamson@redhat.com>
Fri, 21 Nov 2014 18:24:08 +0000 (11:24 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 16 Jan 2015 16:06:48 +0000 (10:06 -0600)
commit51e537387990dc1f00752103f314fd135cb94bc6
tree93d6c4b45bf5f65ead423237e206cc1e1ee1f97f
parentc3e59ee4e76686b0c84ca8faa1011d10cd4ca1b8
PCI: Add flag for devices that don't reset on D3hot->D0 transition

Per the PCI Power Management spec r1.2, sec 3.2.4, a device that advertises
No_Soft_Reset == 0 in the PMCSR register (reported by lspci as "NoSoftRst-")
should perform an internal reset when transitioning from D3hot to D0 via
software control.  Configuration context is lost and the device requires a
full reinitialization sequence.

Unfortunately the definition of "internal reset", beyond the application of
the configuration context, is largely left to the interpretation of the
specific device.  Some devices don't seem to perform an "internal reset"
even if they report No_Soft_Reset == 0.

We still need to honor the PCI specification and restore PCI config context
in the event that we do a PM reset, so we don't cache and modify the
PCI_PM_CTRL_NO_SOFT_RESET bit for the device, but for interfaces where the
intention is to reset the device, like pci_reset_function(), we need a
mechanism to flag that PM reset (a D3hot->D0 transition) doesn't perform
any significant "internal reset" of the device.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci.c
include/linux/pci.h