From patchwork Tue Dec 27 23:57:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 9489933 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 07CDC601D2 for ; Tue, 27 Dec 2016 23:57:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E52D92018F for ; Tue, 27 Dec 2016 23:57:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9C8C223A6; Tue, 27 Dec 2016 23:57:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FDDD25E13 for ; Tue, 27 Dec 2016 23:57:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754363AbcL0X5o (ORCPT ); Tue, 27 Dec 2016 18:57:44 -0500 Received: from mail.kernel.org ([198.145.29.136]:35090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755891AbcL0X5m (ORCPT ); Tue, 27 Dec 2016 18:57:42 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E52720513; Tue, 27 Dec 2016 23:57:40 +0000 (UTC) Received: from localhost (unknown [69.71.4.155]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 73A1D20519; Tue, 27 Dec 2016 23:57:38 +0000 (UTC) Date: Tue, 27 Dec 2016 17:57:37 -0600 From: Bjorn Helgaas To: kilian.singer@quantumtechnology.info Cc: linux-pci@vger.kernel.org, Mika Westerberg , Lukas Wunner , "Rafael J. Wysocki" Subject: PCI: Revert "PCI: Add runtime PM support for PCIe ports" Message-ID: <20161227235737.GB24366@bhelgaas-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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 CC: stable@vger.kernel.org # v4.8+ CC: Mika Westerberg --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 #include #include -#include #include #include #include @@ -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); }