public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-pm@lists.linux-foundation.org, gregkh@suse.de
Subject: Re: [PATCH 00/05] PM: Runtime PM v13 for Platform Devices 20090807
Date: Sat, 8 Aug 2009 15:47:56 +0200	[thread overview]
Message-ID: <200908081547.56394.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0908071206380.3063-100000@iolanthe.rowland.org>

On Friday 07 August 2009, Alan Stern wrote:
> On Sat, 8 Aug 2009, Magnus Damm wrote:
> 
> > On Fri, Aug 7, 2009 at 11:32 PM, Alan Stern<stern@rowland.harvard.edu> wrote:
> > > On Fri, 7 Aug 2009, Magnus Damm wrote:
> > >
> > >> PM: Runtime PM v13 for Platform Devices 20090807
> > >>
> > >> [PATCH 01/05] PM: Runtime PM v13 - add dev_pm_ops helpers
> > >
> > > This patch doesn't do anything much, besides reverting a change I asked
> > > Rafael to make.  I don't see how it helps platform-specific code do
> > > anything.
> > 
> > It's helping different bus types to implement the runtime part of the
> > dev_pm_ops in a consistent way. I suggest that all bus types should
> > return -ENOSYS if the callback is missing.
> 
> Doesn't Rafael's code already do this?
> 
> >  And they can do so by using
> > the helper functions. The change is not platform specific, but my
> > latest SuperH platform Runtime PM prototype makes use of it.
> > 
> > The latest SuperH specific Runtime PM implementation require
> > dev_pm_ops even though there is no work to be done for the driver. The
> > code works in a sort of opt-in way at this point, so callbacks are
> > explicitly required. I'd like us to standardize on this behaviour if
> > possible, so runtime pm enabled platform drivers can be shared between
> > different platform bus implementations. So my LCDC platform driver
> > will work fine on both SuperH SoCs and ARM SoCs.
> 
> I still don't see the connection.  Why are helper functions useful?
> 
> > Sorry for reverting your change, but I couldn't see any clear benefit
> > with the v11->v13 lock-drop-inside-the-if-case change. Isn't it just
> > avoiding dropping the lock in the uncommon error case? Maybe I'm
> > misunderstanding.
> 
> Basically you are right, except for one thing: The error case might not
> be so uncommon.  That's the benefit.
> 
> Rafael, along these lines, I suspect we might not want to go into an
> error state if a runtime suspend fails because there is no callback
> function.  Returning -ENOSYS to the caller is fine, but leave 
> runtime_error set to 0.  Maybe do the same for runtime resume.

Yes, I've just made this change.

> > >> [PATCH 02/05] PM: Runtime PM v13 - let bus-less devices succeed
> > >
> > > This could be added without 01/05.  But why do you want it?  Busless
> > > devices don't have PM runtime callbacks, so whether the core thinks the
> > > callbacks succeed or not doesn't make any difference.
> > >
> > > You say that "Runtime suspend and resume of devices on the platform bus
> > > is impossible without this change", but you don't explain why -- or why
> > > the patch makes runtime suspend and resume of these devices possible.
> > 
> > Right now, in the standard upstream kernel all platform devices get
> > assigned a parent device unless one exists are registration time. The
> > shared parent device is parent-less. Since the Runtime PM code resumes
> > the parent before the child, the resume operation will fail because
> > there is no dev_pm_ops for the shared parent.
> 
> Not if the parent is disabled for runtime PM, which it is in this case, 
> right?
> 
> > So I wonder which way that is the best to allow resuming platform
> > devices. Patch [02/05] is one way, but maybe there are more elegant
> > ways to handle it? Should the platform code be modified instead? If
> > so, how? I suppose root hubs for USB may have a similar issue, no?
> 
> If necessary, I would suggest adding appropriate dummy runtime PM 
> routines for that catch-all parent device.  But it may not be 
> necessary.
> 
> 
> > >> [PATCH 03/05] PM: Runtime PM v13 - add debug printouts
> > >
> > > This looks good.
> > 
> > Thanks. Maybe it's a good plan to add similar printouts to other
> > functions as well?
> 
> Perhaps so.  When writing similar code for USB I found that lots of 
> debugging printouts were needed all over the place, to get everything 
> working right.  Once it was working, they were a nuisance.

I've added such messages to __pm_runtime_idle(), for consistency.

Thanks,
Rafael

  reply	other threads:[~2009-08-08 13:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-07  7:33 [PATCH 00/05] PM: Runtime PM v13 for Platform Devices 20090807 Magnus Damm
2009-08-07  7:33 ` [PATCH 01/05] PM: Runtime PM v13 - add dev_pm_ops helpers Magnus Damm
2009-08-07  7:33 ` [PATCH 02/05] PM: Runtime PM v13 - let bus-less devices succeed Magnus Damm
2009-08-07  7:33 ` [PATCH 03/05] PM: Runtime PM v13 - add debug printouts Magnus Damm
2009-08-08 13:28   ` Rafael J. Wysocki
2009-08-07  7:33 ` [PATCH 04/05] PM: Runtime PM v13 - CONFIG_PM_SLEEP=n support Magnus Damm
2009-08-07  7:34 ` [PATCH 05/05] PM: Runtime PM v13 - platform device bus support Magnus Damm
2009-08-07 14:32 ` [PATCH 00/05] PM: Runtime PM v13 for Platform Devices 20090807 Alan Stern
2009-08-07 15:42   ` Magnus Damm
2009-08-07 16:17     ` Alan Stern
2009-08-08 13:47       ` Rafael J. Wysocki [this message]
2009-08-10 10:57       ` Magnus Damm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200908081547.56394.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=gregkh@suse.de \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox