All of lore.kernel.org
 help / color / mirror / Atom feed
* PCI: Revert "PCI: Add runtime PM support for PCIe ports"
@ 2016-12-27 23:57 Bjorn Helgaas
  2016-12-28  9:17 ` Mika Westerberg
                   ` (3 more replies)
  0 siblings, 4 replies; 115+ messages in thread
From: Bjorn Helgaas @ 2016-12-27 23:57 UTC (permalink / raw)
  To: kilian.singer; +Cc: linux-pci, Mika Westerberg, Lukas Wunner, Rafael J. Wysocki

Hi Killian,

Thanks for the report (https://bugzilla.kernel.org/show_bug.cgi?id=190861)
and all the debugging you've done.  Below is a revert of the troublesome
commit.  Can you test it and verify that it also fixes the problem?

I assume Mika is looking at this and will have a better solution soon.
But if not, I'll queue this up for v4.10.


commit e648b1ca2b94d207289fedc2538d33c57cdbc4de
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Tue Dec 27 17:27:30 2016 -0600

    Revert "PCI: Add runtime PM support for PCIe ports"
    
    Revert 006d44e49a25 ("PCI: Add runtime PM support for PCIe ports").
    
    Killian reported that on a Lenovo W54l with i7-4810MQ, Intel HD Graphics
    4600, and NVIDIA Quadro® K1100M, locking the screen kills all keyboard and
    mouse interaction.  Reverting 006d44e49a25 fixes the problem.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=190861
    Reported-by: kilian.singer@quantumtechnology.info
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    CC: stable@vger.kernel.org	# v4.8+
    CC: Mika Westerberg <mika.westerberg@linux.intel.com>

diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index 9698289..dcb185c 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -11,7 +11,6 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/pm.h>
-#include <linux/pm_runtime.h>
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/pcieport_if.h>
@@ -343,8 +342,6 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
 		return retval;
 	}
 
-	pm_runtime_no_callbacks(device);
-
 	return 0;
 }
 
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 8aa3f14..d3af264 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -85,26 +85,6 @@ static int pcie_port_resume_noirq(struct device *dev)
 	return 0;
 }
 
-static int pcie_port_runtime_suspend(struct device *dev)
-{
-	return to_pci_dev(dev)->bridge_d3 ? 0 : -EBUSY;
-}
-
-static int pcie_port_runtime_resume(struct device *dev)
-{
-	return 0;
-}
-
-static int pcie_port_runtime_idle(struct device *dev)
-{
-	/*
-	 * Assume the PCI core has set bridge_d3 whenever it thinks the port
-	 * should be good to go to D3.  Everything else, including moving
-	 * the port to D3, is handled by the PCI core.
-	 */
-	return to_pci_dev(dev)->bridge_d3 ? 0 : -EBUSY;
-}
-
 static const struct dev_pm_ops pcie_portdrv_pm_ops = {
 	.suspend	= pcie_port_device_suspend,
 	.resume		= pcie_port_device_resume,
@@ -113,9 +93,6 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = {
 	.poweroff	= pcie_port_device_suspend,
 	.restore	= pcie_port_device_resume,
 	.resume_noirq	= pcie_port_resume_noirq,
-	.runtime_suspend = pcie_port_runtime_suspend,
-	.runtime_resume	= pcie_port_runtime_resume,
-	.runtime_idle	= pcie_port_runtime_idle,
 };
 
 #define PCIE_PORTDRV_PM_OPS	(&pcie_portdrv_pm_ops)
@@ -149,31 +126,11 @@ static int pcie_portdrv_probe(struct pci_dev *dev,
 		return status;
 
 	pci_save_state(dev);
-
-	if (pci_bridge_d3_possible(dev)) {
-		/*
-		 * Keep the port resumed 100ms to make sure things like
-		 * config space accesses from userspace (lspci) will not
-		 * cause the port to repeatedly suspend and resume.
-		 */
-		pm_runtime_set_autosuspend_delay(&dev->dev, 100);
-		pm_runtime_use_autosuspend(&dev->dev);
-		pm_runtime_mark_last_busy(&dev->dev);
-		pm_runtime_put_autosuspend(&dev->dev);
-		pm_runtime_allow(&dev->dev);
-	}
-
 	return 0;
 }
 
 static void pcie_portdrv_remove(struct pci_dev *dev)
 {
-	if (pci_bridge_d3_possible(dev)) {
-		pm_runtime_forbid(&dev->dev);
-		pm_runtime_get_noresume(&dev->dev);
-		pm_runtime_dont_use_autosuspend(&dev->dev);
-	}
-
 	pcie_port_device_remove(dev);
 }
 

^ permalink raw reply related	[flat|nested] 115+ messages in thread

end of thread, other threads:[~2017-01-25 17:58 UTC | newest]

Thread overview: 115+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-27 23:57 PCI: Revert "PCI: Add runtime PM support for PCIe ports" Bjorn Helgaas
2016-12-28  9:17 ` Mika Westerberg
2016-12-28 11:29 ` Lukas Wunner
2016-12-28 16:18   ` Bjorn Helgaas
2016-12-29  9:58     ` Kilian Singer
2016-12-29 16:02       ` Kilian Singer
2016-12-29 16:20         ` Kilian Singer
2016-12-29 17:50           ` Lukas Wunner
2016-12-29 22:52             ` Kilian Singer
2016-12-29 23:02               ` Kilian Singer
2016-12-29 23:05                 ` Kilian Singer
2016-12-29 23:48               ` Lukas Wunner
2016-12-29 23:20             ` Kilian Singer
2016-12-30  0:07               ` Lukas Wunner
2016-12-30  0:16                 ` Kilian Singer
2016-12-30  0:24                   ` Kilian Singer
2016-12-30  0:22                     ` Rafael J. Wysocki
2016-12-30  0:39                       ` Kilian Singer
2016-12-30  0:41                         ` Rafael J. Wysocki
2016-12-30  0:45                       ` Kilian Singer
2016-12-30  1:40                         ` Rafael J. Wysocki
2016-12-30  1:50                           ` Rafael J. Wysocki
2016-12-30  1:52                             ` Rafael J. Wysocki
2016-12-30 13:37                               ` Kilian Singer
2016-12-30 13:59                                 ` Kilian Singer
2016-12-30 14:44                                   ` Rafael J. Wysocki
2016-12-30 14:47                                 ` Rafael J. Wysocki
2017-01-02 12:22                                   ` Mika Westerberg
2017-01-03 17:12                                     ` Kilian Singer
2017-01-02 11:40                   ` Lukas Wunner
2017-01-02 12:10                     ` Mika Westerberg
2017-01-02 13:53                       ` Mika Westerberg
2017-01-02 14:48                       ` Mika Westerberg
2017-01-02 21:31                         ` Rafael J. Wysocki
2017-01-03  9:51                           ` Mika Westerberg
2017-01-03 15:15                             ` Peter Wu
2017-01-03 16:11                               ` Lukas Wunner
2017-01-03 16:31                                 ` Peter Wu
2017-01-03 16:44                                   ` Deucher, Alexander
2017-01-03 18:09                                   ` Lukas Wunner
2017-01-03 18:12                                   ` Bjorn Helgaas
2017-01-03 21:38                                     ` Rafael J. Wysocki
2017-01-03 21:52                                       ` Kilian Singer
2017-01-03 22:07                                         ` Rafael J. Wysocki
2017-01-03 22:25                                           ` Kilian Singer
2017-01-03 22:25                                       ` Bjorn Helgaas
2017-01-03 23:13                                         ` Rafael J. Wysocki
2017-01-04  0:05                                           ` Bjorn Helgaas
2017-01-04  1:09                                             ` Rafael J. Wysocki
2017-01-04  8:16                                             ` Lukas Wunner
2017-01-04 10:33                                               ` Kilian Singer
2017-01-04 12:29                                                 ` Mika Westerberg
2017-01-04 15:50                                               ` Deucher, Alexander
2017-01-04 21:09                                               ` Peter Wu
2017-01-04 21:58                                                 ` Rafael J. Wysocki
2017-01-04 23:21                                                   ` David Airlie
2017-01-05 15:06                                                     ` Lukas Wunner
2017-01-05 18:13                                                       ` Peter Jones
2017-01-05 19:36                                                         ` David Airlie
2017-01-09 15:11                                                           ` Lyude Paul
2017-01-09 15:21                                                             ` Hans de Goede
2017-01-09 18:48                                                               ` Kilian Singer
2017-01-10  0:33                                                                 ` David Airlie
2017-01-10  9:17                                                                   ` Kilian Singer
2017-01-12 18:10                                                                     ` Lyude Paul
2017-01-24  4:59                                                                       ` Lukas Wunner
2017-01-24 19:09                                                                         ` Lyude Paul
2017-01-11 20:40                                                               ` Lyude Paul
2017-01-12  1:13                                                                 ` Lyude Paul
2017-01-12  2:04                                                                   ` Lyude Paul
2017-01-12  2:12                                                                     ` Lukas Wunner
2017-01-17 15:55                                                                       ` Mika Westerberg
2017-01-17 18:06                                                                         ` Lyude Paul
2017-01-17 19:10                                                                           ` Bjorn Helgaas
2017-01-17 19:49                                                                             ` Lyude Paul
2017-01-07 11:45                                                       ` Hans de Goede
2017-01-07 12:16                                                         ` Lukas Wunner
2017-01-09 23:00                                                         ` Peter Jones
2017-01-10  0:17                                                           ` David Airlie
2017-01-10  1:24                                                             ` Lukas Wunner
2017-01-10  2:15                                                               ` David Airlie
2017-01-11 11:04                                                       ` Hans de Goede
2017-01-11 13:24                                                         ` Kilian Singer
2017-01-11 13:26                                                           ` Hans de Goede
2017-01-11 16:24                                                             ` Peter Jones
2017-01-11 19:20                                                               ` Kilian Singer
2017-01-05 10:49                                                   ` Mika Westerberg
2017-01-05 14:19                                                     ` Rafael J. Wysocki
2017-01-05 14:20                                                     ` Mika Westerberg
2017-01-05 14:23                                                       ` Rafael J. Wysocki
2017-01-05 14:42                                                 ` Lukas Wunner
2017-01-06  1:21                                                   ` Rafael J. Wysocki
2017-01-07  6:50                                                     ` Mika Westerberg
2017-01-07 11:35                                                   ` Peter Wu
2017-01-07 12:19                                                     ` Lukas Wunner
2017-01-07 12:36                                                       ` Peter Wu
2017-01-08 14:05                                                         ` Lukas Wunner
2017-01-04 21:55                                               ` Rafael J. Wysocki
2017-01-03 21:26                                 ` Rafael J. Wysocki
2017-01-03 17:37                               ` Kilian Singer
2017-01-03 17:10                       ` Kilian Singer
2017-01-03 16:59                     ` Kilian Singer
2017-01-03 17:08                     ` Kilian Singer
2016-12-30  0:19     ` Rafael J. Wysocki
2016-12-30 14:48       ` Rafael J. Wysocki
2017-01-17 14:56 ` Bjorn Helgaas
2017-01-17 15:49   ` Kilian Singer
2017-01-23 20:33   ` Bjorn Helgaas
2017-01-23 21:12     ` Mika Westerberg
2017-01-24  4:53       ` Lukas Wunner
2017-01-24 20:01       ` Bjorn Helgaas
2017-01-25  9:48         ` Mika Westerberg
2017-01-25 16:05           ` Kilian Singer
2017-01-25 16:31             ` Mika Westerberg
2017-01-25 17:58 ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.