]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jan 2020 15:17:34 +0000 (16:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jan 2020 15:17:34 +0000 (16:17 +0100)
added patches:
pci-pciehp-do-not-disable-interrupt-twice-on-suspend.patch

queue-5.4/pci-pciehp-do-not-disable-interrupt-twice-on-suspend.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/pci-pciehp-do-not-disable-interrupt-twice-on-suspend.patch b/queue-5.4/pci-pciehp-do-not-disable-interrupt-twice-on-suspend.patch
new file mode 100644 (file)
index 0000000..dcba10c
--- /dev/null
@@ -0,0 +1,100 @@
+From 75fcc0ce72e5cea2e357cdde858216c5bad40442 Mon Sep 17 00:00:00 2001
+From: Mika Westerberg <mika.westerberg@linux.intel.com>
+Date: Tue, 29 Oct 2019 20:00:21 +0300
+Subject: PCI: pciehp: Do not disable interrupt twice on suspend
+
+From: Mika Westerberg <mika.westerberg@linux.intel.com>
+
+commit 75fcc0ce72e5cea2e357cdde858216c5bad40442 upstream.
+
+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>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/pci/hotplug/pciehp_core.c |   25 +++++++++++++++++++++++--
+ 1 file changed, 23 insertions(+), 2 deletions(-)
+
+--- a/drivers/pci/hotplug/pciehp_core.c
++++ b/drivers/pci/hotplug/pciehp_core.c
+@@ -253,7 +253,7 @@ static bool pme_is_native(struct pcie_de
+       return pcie_ports_native || host->native_pme;
+ }
+-static int pciehp_suspend(struct pcie_device *dev)
++static void pciehp_disable_interrupt(struct pcie_device *dev)
+ {
+       /*
+        * Disable hotplug interrupt so that it does not trigger
+@@ -261,7 +261,19 @@ static int pciehp_suspend(struct pcie_de
+        */
+       if (pme_is_native(dev))
+               pcie_disable_interrupt(get_service_data(dev));
++}
++#ifdef CONFIG_PM_SLEEP
++static int pciehp_suspend(struct pcie_device *dev)
++{
++      /*
++       * If the port is already runtime suspended we can keep it that
++       * way.
++       */
++      if (dev_pm_smart_suspend_and_suspended(&dev->port->dev))
++              return 0;
++
++      pciehp_disable_interrupt(dev);
+       return 0;
+ }
+@@ -279,6 +291,7 @@ static int pciehp_resume_noirq(struct pc
+       return 0;
+ }
++#endif
+ static int pciehp_resume(struct pcie_device *dev)
+ {
+@@ -292,6 +305,12 @@ static int pciehp_resume(struct pcie_dev
+       return 0;
+ }
++static int pciehp_runtime_suspend(struct pcie_device *dev)
++{
++      pciehp_disable_interrupt(dev);
++      return 0;
++}
++
+ static int pciehp_runtime_resume(struct pcie_device *dev)
+ {
+       struct controller *ctrl = get_service_data(dev);
+@@ -318,10 +337,12 @@ static struct pcie_port_service_driver h
+       .remove         = pciehp_remove,
+ #ifdef        CONFIG_PM
++#ifdef        CONFIG_PM_SLEEP
+       .suspend        = pciehp_suspend,
+       .resume_noirq   = pciehp_resume_noirq,
+       .resume         = pciehp_resume,
+-      .runtime_suspend = pciehp_suspend,
++#endif
++      .runtime_suspend = pciehp_runtime_suspend,
+       .runtime_resume = pciehp_runtime_resume,
+ #endif        /* PM */
+ };
index 41ce815c36b7060fa1a18051162046d262c469ab..9251caef4d0593e45a235711db0190d80f589f86 100644 (file)
@@ -120,3 +120,4 @@ pinctl-ti-iodelay-fix-error-checking-on-pinctrl_count_index_with_args-call.patch
 pinctrl-sh-pfc-fix-pinmux_ipsr_phys-to-set-gpsr.patch
 pinctrl-sh-pfc-do-not-use-platform_get_irq-to-count-interrupts.patch
 pinctrl-lewisburg-update-pin-list-according-to-v1.1v6.patch
+pci-pciehp-do-not-disable-interrupt-twice-on-suspend.patch