From patchwork Mon Jun 12 20:49:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 9782779 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 7B8016038F for ; Mon, 12 Jun 2017 21:06:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DAD12864D for ; Mon, 12 Jun 2017 21:06:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6195A2866B; Mon, 12 Jun 2017 21:06:37 +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=unavailable 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 0B8502864D for ; Mon, 12 Jun 2017 21:06:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752996AbdFLVGD (ORCPT ); Mon, 12 Jun 2017 17:06:03 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:43102 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785AbdFLVEV (ORCPT ); Mon, 12 Jun 2017 17:04:21 -0400 Received: from 79.184.252.2.ipv4.supernova.orange.pl (79.184.252.2) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.82) id 939eabcd56f3df27; Mon, 12 Jun 2017 23:04:24 +0200 From: "Rafael J. Wysocki" To: Linux ACPI Cc: Linux PCI , Linux PM , Bjorn Helgaas , LKML , Mika Westerberg , Srinivas Pandruvada , Linux USB , Mathias Nyman , Felipe Balbi , Mario Limonciello , Andy Shevchenko , Dominik Brodowski , Hans De Goede , Alan Stern Subject: [PATCH v2 2/8] USB / PCI / PM: Allow the PCI core to do the resume cleanup Date: Mon, 12 Jun 2017 22:49:40 +0200 Message-ID: <38416217.53MZsF26VB@aspire.rjw.lan> User-Agent: KMail/4.14.10 (Linux/4.12.0-rc1+; KDE/4.14.9; x86_64; ; ) In-Reply-To: <1615075.mBkoKApGGc@aspire.rjw.lan> References: <8918199.uo13RZ8hZk@aspire.rjw.lan> <1615075.mBkoKApGGc@aspire.rjw.lan> MIME-Version: 1.0 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 From: Rafael J. Wysocki hcd_pci_resume_noirq() used as a universal _resume_noirq handler for PCI USB controllers calls pci_back_from_sleep() which is unnecessary and may become problematic. It is unnecessary, because the PCI bus type carries out post-suspend cleanup of all PCI devices during resume and that covers all things done by the pci_back_from_sleep(). There is no reason why USB cannot follow all of the other PCI devices in that respect. It will become problematic after subsequent changes that make it possible to go back to sleep again after executing dpm_resume_noirq() if no valid system wakeup events have been detected at that point. Namely, calling pci_back_from_sleep() at the _resume_noirq stage will cause the wakeup status of the devices in question to be cleared and if any of them has triggered system wakeup, that event may be missed then. For the above reasons, drop the pci_back_from_sleep() invocation from hcd_pci_resume_noirq(). Signed-off-by: Rafael J. Wysocki Acked-by: Alan Stern Acked-by: Greg Kroah-Hartman --- drivers/usb/core/hcd-pci.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) Index: linux-pm/drivers/usb/core/hcd-pci.c =================================================================== --- linux-pm.orig/drivers/usb/core/hcd-pci.c +++ linux-pm/drivers/usb/core/hcd-pci.c @@ -584,12 +584,7 @@ static int hcd_pci_suspend_noirq(struct static int hcd_pci_resume_noirq(struct device *dev) { - struct pci_dev *pci_dev = to_pci_dev(dev); - - powermac_set_asic(pci_dev, 1); - - /* Go back to D0 and disable remote wakeup */ - pci_back_from_sleep(pci_dev); + powermac_set_asic(to_pci_dev(dev), 1); return 0; }