From patchwork Mon Jun 21 21:03:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Stern X-Patchwork-Id: 107249 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5LL3EXZ016248 for ; Mon, 21 Jun 2010 21:03:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758123Ab0FUVDN (ORCPT ); Mon, 21 Jun 2010 17:03:13 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:53080 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751595Ab0FUVDN (ORCPT ); Mon, 21 Jun 2010 17:03:13 -0400 Received: (qmail 5097 invoked by uid 2102); 21 Jun 2010 17:03:11 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 21 Jun 2010 17:03:11 -0400 Date: Mon, 21 Jun 2010 17:03:11 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Jesse Barnes cc: "Rafael J. Wysocki" , Subject: [PATCH] PCI: use pm_runtime_get_sync during system suspend Message-ID: MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 21 Jun 2010 21:03:51 +0000 (UTC) Index: usb-2.6/drivers/pci/pci-driver.c =================================================================== --- usb-2.6.orig/drivers/pci/pci-driver.c +++ usb-2.6/drivers/pci/pci-driver.c @@ -623,10 +623,13 @@ static int pci_pm_prepare(struct device * system from the sleep state, we'll have to prevent it from signaling * wake-up. */ - pm_runtime_resume(dev); + pm_runtime_get_sync(dev); - if (drv && drv->pm && drv->pm->prepare) + if (drv && drv->pm && drv->pm->prepare) { error = drv->pm->prepare(dev); + if (error) + pm_runtime_put_sync(dev); + } return error; } @@ -637,6 +640,7 @@ static void pci_pm_complete(struct devic if (drv && drv->pm && drv->pm->complete) drv->pm->complete(dev); + pm_runtime_put_sync(dev); } #else /* !CONFIG_PM_SLEEP */