diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2014-11-21 11:24:08 -0700 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-12-02 22:35:32 -0500 |
commit | 9d51125d02727c945a25671960c8a9c0dcb7def2 (patch) | |
tree | d6c04e5caae02a171348a6d2a3939bc011530385 /drivers/pci | |
parent | 16d8da6c17a7024180e3b9865eb9fad605a9b382 (diff) | |
download | linux-stable-9d51125d02727c945a25671960c8a9c0dcb7def2.tar.gz linux-stable-9d51125d02727c945a25671960c8a9c0dcb7def2.tar.bz2 linux-stable-9d51125d02727c945a25671960c8a9c0dcb7def2.zip |
PCI: Add flag for devices that don't reset on D3hot->D0 transition
[ Upstream commit 51e537387990dc1f00752103f314fd135cb94bc6 ]
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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index ff7af33f2353..ce0aa47222f6 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3206,7 +3206,7 @@ static int pci_pm_reset(struct pci_dev *dev, int probe) { u16 csr; - if (!dev->pm_cap) + if (!dev->pm_cap || dev->dev_flags & PCI_DEV_FLAGS_NO_PM_RESET) return -ENOTTY; pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &csr); |