Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752926AbZGaSxX (ORCPT ); Fri, 31 Jul 2009 14:53:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752905AbZGaSxU (ORCPT ); Fri, 31 Jul 2009 14:53:20 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:60753 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752903AbZGaSxR (ORCPT ); Fri, 31 Jul 2009 14:53:17 -0400 From: "Rafael J. Wysocki" To: Magnus Damm Subject: Re: [PATCH update] PM: Introduce core framework for run-time PM of I/O devices (rev. 11) Date: Fri, 31 Jul 2009 20:53:17 +0200 User-Agent: KMail/1.11.2 (Linux/2.6.31-rc4-rjw; KDE/4.2.4; x86_64; ; ) Cc: Alan Stern , Greg KH , LKML , ACPI Devel Maling List , "Linux-pm mailing list" , Pavel Machek References: <200907221701.50449.rjw@sisk.pl> <200907222110.47701.rjw@sisk.pl> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907312053.17914.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2354 Lines: 62 On Friday 31 July 2009, Magnus Damm wrote: > Hi Rafail Hi, > [Runtime PM v11] > > Thanks for your work on this. The code is getting better and better. > I've just finished posting a bunch of patches related to v11 of your > Runtime PM patch. Basically everything seems fine except a few minor > details and the code below: =) Thanks a lot for your feedback. > On Thu, Jul 23, 2009 at 4:10 AM, Rafael J. Wysocki wrote: > > On Wednesday 22 July 2009, Rafael J. Wysocki wrote: > > Index: linux-2.6/drivers/base/dd.c > > =================================================================== > > --- linux-2.6.orig/drivers/base/dd.c > > +++ linux-2.6/drivers/base/dd.c > > @@ -23,6 +23,7 @@ > > #include > > #include > > #include > > +#include > > > > #include "base.h" > > #include "power/power.h" > > @@ -202,7 +203,9 @@ int driver_probe_device(struct device_dr > > pr_debug("bus: '%s': %s: matched device %s with driver %s\n", > > drv->bus->name, __func__, dev_name(dev), drv->name); > > > > + pm_runtime_get_noresume(dev); > > ret = really_probe(dev, drv); > > + pm_runtime_put_noidle(dev); > > > > return ret; > > } > > This creates problems when drivers want to performing runtime resume > from within probe(). For more details please have a look at "[PATCH > 04/04] video: Runtime PM hack for SuperH LCDC driver". Ah, I see. You'd like to call pm_runtime_get_sync() from .probe(), but that sees the usage counter different from zero and exits immediately. OTOH, I think we should prevent suspends from racing with .probe() at the core level. Hmm. One possible approach could be to call pm_runtime_resume() from sh_mobile_lcdc_probe() instead of pm_runtime_put_noidle(). Then, the platform code will have a chance to turn the device on and the later pm_runtime_get*() and pm_runtime_put*() calls will be balanced. Of course, in that case the pm_runtime_get_noresume() in sh_mobile_lcdc_probe() won't be necessary any more. Am I overlooking anything? Rafael -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/