PCI: pciehp: Do not disable interrupt twice on suspend
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 29 Oct 2019 17:00:21 +0000 (20:00 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 12 Nov 2019 22:27:33 +0000 (16:27 -0600)
commit75fcc0ce72e5cea2e357cdde858216c5bad40442
tree59446dcdf235db6a5459eb66540f8f95a0bad13e
parentb94ec12dfaee41bdd6a8b6d75e5715d9ba2c92cc
PCI: pciehp: Do not disable interrupt twice on suspend

We try to keep PCIe hotplug ports runtime suspended when entering system
suspend. Because the PCIe portdrv sets the DPM_FLAG_NEVER_SKIP flag, the PM
core always calls system suspend/resume hooks even if the device is left
runtime suspended. Since PCIe hotplug driver re-used the same function for
both runtime suspend and system suspend, it ended up disabling hotplug
interrupt twice and the second time following was printed:

  pciehp 0000:03:01.0:pcie204: pcie_do_write_cmd: no response from device

Prevent this from happening by checking whether the device is already
runtime suspended when the system suspend hook is called.

Fixes: 9c62f0bfb832 ("PCI: pciehp: Implement runtime PM callbacks")
Link: https://lore.kernel.org/r/20191029170022.57528-1-mika.westerberg@linux.intel.com
Reported-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/pci/hotplug/pciehp_core.c