From patchwork Wed Sep 30 00:44:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 7291691 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C2827BEEA4 for ; Wed, 30 Sep 2015 00:16:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D58B204FB for ; Wed, 30 Sep 2015 00:16:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 684B8205DE for ; Wed, 30 Sep 2015 00:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751084AbbI3AQL (ORCPT ); Tue, 29 Sep 2015 20:16:11 -0400 Received: from v094114.home.net.pl ([79.96.170.134]:49163 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750947AbbI3AQK (ORCPT ); Tue, 29 Sep 2015 20:16:10 -0400 Received: from afjp86.neoplus.adsl.tpnet.pl (95.49.249.86) (HELO vostro.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer v0.80) id 2f976dfa5f0a8775; Wed, 30 Sep 2015 02:16:07 +0200 From: "Rafael J. Wysocki" To: Linux PM list Cc: Linux PCI , Linux Kernel Mailing List , Bjorn Helgaas , Alan Stern Subject: [PATCH] PM / sleep: Drop pm_request_idle() from pm_generic_complete() Date: Wed, 30 Sep 2015 02:44:29 +0200 Message-ID: <4970284.9k6NVjxDce@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.1.0-rc5+; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafael J. Wysocki The pm_request_idle() in pm_generic_complete() is pointless as it is called with the runtime PM usage counter different from zero (bumped up by the core during the prepare phase of system suspend) and the core calls pm_runtime_put() for all devices after executing their complete callbacks, so drop it. This allows the PCI PM layer to use pm_generic_complete() too. Signed-off-by: Rafael J. Wysocki Reviewed-by: Ulf Hansson --- On top of https://patchwork.kernel.org/patch/7291251/ . --- drivers/base/power/generic_ops.c | 6 ------ drivers/pci/pci-driver.c | 9 ++------- 2 files changed, 2 insertions(+), 13 deletions(-) -- 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 Index: linux-pm/drivers/base/power/generic_ops.c =================================================================== --- linux-pm.orig/drivers/base/power/generic_ops.c +++ linux-pm/drivers/base/power/generic_ops.c @@ -296,11 +296,5 @@ void pm_generic_complete(struct device * if (drv && drv->pm && drv->pm->complete) drv->pm->complete(dev); - - /* - * Let runtime PM try to suspend devices that haven't been in use before - * going into the system-wide sleep state we're resuming from. - */ - pm_request_idle(dev); } #endif /* CONFIG_PM_SLEEP */ Index: linux-pm/drivers/pci/pci-driver.c =================================================================== --- linux-pm.orig/drivers/pci/pci-driver.c +++ linux-pm/drivers/pci/pci-driver.c @@ -686,13 +686,8 @@ static int pci_pm_prepare(struct device static void pci_pm_complete(struct device *dev) { - struct device_driver *drv = dev->driver; - struct pci_dev *pci_dev = to_pci_dev(dev); - - pci_dev_complete_resume(pci_dev); - - if (drv && drv->pm && drv->pm->complete) - drv->pm->complete(dev); + pci_dev_complete_resume(to_pci_dev(dev)); + pm_generic_complete(dev); } #else /* !CONFIG_PM_SLEEP */