linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>
To: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
Cc: Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
	Rabin Vincent <rabin-66gdRtMMWGc@public.gmane.org>,
	linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [linux-pm] pm_runtime_suspended() and non-pm_runtime-using (i2c) drivers
Date: Wed, 15 Dec 2010 01:15:52 +0100	[thread overview]
Message-ID: <201012150115.52545.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1012141406500.2087-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>

On Tuesday, December 14, 2010, Alan Stern wrote:
> On Tue, 14 Dec 2010, Mark Brown wrote:
> 
> > On Tue, Dec 14, 2010 at 12:44:24PM -0500, Alan Stern wrote:
> > > On Tue, 14 Dec 2010, Mark Brown wrote:
> > > > On Tue, Dec 14, 2010 at 11:16:45AM -0500, Alan Stern wrote:
> > 
> > > > > I'm not familiar with the details of how the i2c subsystem works.  But
> > > > > in general, the subsystem code should call pm_runtime_set_active()  
> > > > > for every device before registering it.  Then if a driver doesn't use
> > > > > any runtime-PM functions, pm_runtime_suspended() will return false.
> > 
> > > > Hrm, if that's the case then we also need to update at least the
> > > > platform and SPI buses.  Though looking at the documentation this is
> > > > going to get a bit interesting as there's a requirement that the parent
> > > > has runtime PM enabled on it...
> > 
> > > The parent can either be set to the active state or set to ignore its 
> > > children.  The parent does not have to be enabled for runtime PM.
> > 
> > Both of those require that the parent is set up to know something about
> > runtime PM to some extent - in the case of buses like I2C the parent is
> > a largely unrelated thing on a different bus which may or may not have
> > runtime PM implemented.
> > 
> > > >  It's certainly not terribly apparent
> > > > from the documentation.
> > 
> > > What part isn't clear from the documentation?  I think the description 
> > > of pm_runtime_set_active() in Documentation/power/runtime_pm.txt is 
> > > pretty straightforward.
> > 
> > It's not clear to me that one needs to do this in order to avoid
> > breaking the suspend and resume calls of drivers that aren't doing
> > anything with runtime PM.  It's clear what it does, but it's less clear
> > that the bus should do it or that not doing it will have an impact on
> > stuff that isn't using runtime PM.
> > 
> > > > It'd be really helpful if it were clearer what noop buses like this were
> > > > supposed to do to get runtime PM working.
> > 
> > > I'm a little confused.  When you say this is a "noop" bus, do you mean
> > > that it can't do any power management?  If so, why does it need to get
> > > runtime PM working?
> > 
> > The bus as a whole may not be able to do anything useful with runtime PM
> > but individual devices on it may be able to do so - for example, a multi
> > function device provides a parent device and a bunch of children for
> > that device.  Runtime PM provides a nice way for the children to
> > individually suspend themselves and let the parent implement extra power
> > savings if all the children suspend.  It also provides a userspace API
> > for controlling runtime suspend behaviour which drivers may find useful,
> > and stuff like the autosuspend delays might be useful to some.
> 
> I see.  It sounds like you're really saying that new devices default to 
> the wrong runtime state.  If pm_runtime_init() would set new devices to 
> RPM_ACTIVE instead of RPM_SUSPENDED then this problem wouldn't arise.  
> Children could do whatever they want, and even if the parent's driver 
> was totally ignorant of runtime PM, it would work out.

Actaully, pm_runtime_init() also sets power.disable_depth to 1, which disables
runtime PM and (with the pm_runtime_suspended() change I proposed earlier)
that should be sufficient, unless someone blindly calls pm_runtime_enable()
for the device without changing its status as appropriate beforehand.  That,
however, is a bug in the code doing this IMnsHO.

Thanks,
Rafael

  parent reply	other threads:[~2010-12-15  0:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14 15:54 pm_runtime_suspended() and non-pm_runtime-using (i2c) drivers Rabin Vincent
     [not found] ` <AANLkTik7D2mDJN=BaasvLa4xx0fQBgjHREqQB06aD9JU-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-14 16:16   ` [linux-pm] " Alan Stern
     [not found]     ` <Pine.LNX.4.44L0.1012141114150.2087-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-12-14 16:40       ` Mark Brown
     [not found]         ` <20101214164059.GE5723-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2010-12-14 17:44           ` Alan Stern
     [not found]             ` <Pine.LNX.4.44L0.1012141236530.2087-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-12-14 18:09               ` Mark Brown
     [not found]                 ` <20101214180941.GB13644-HF5t3jzXg/6ND3a5+9QAFujbO/Zr0HzV@public.gmane.org>
2010-12-14 19:10                   ` Alan Stern
     [not found]                     ` <Pine.LNX.4.44L0.1012141406500.2087-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-12-14 22:00                       ` Mark Brown
     [not found]                         ` <20101214220050.GB25106-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2010-12-14 23:03                           ` Alan Stern
     [not found]                             ` <Pine.LNX.4.44L0.1012141754190.2087-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-12-14 23:19                               ` Mark Brown
2010-12-15  0:15                       ` Rafael J. Wysocki [this message]
2010-12-14 23:28       ` Rafael J. Wysocki
     [not found]         ` <201012150028.07938.rjw-KKrjLPT3xs0@public.gmane.org>
2010-12-14 23:57           ` Rafael J. Wysocki
     [not found]             ` <201012150057.31237.rjw-KKrjLPT3xs0@public.gmane.org>
2010-12-15  0:19               ` Rafael J. Wysocki
     [not found]                 ` <201012150119.59801.rjw-KKrjLPT3xs0@public.gmane.org>
2010-12-15 20:38                   ` Alan Stern
     [not found]                     ` <Pine.LNX.4.44L0.1012151530590.2171-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-12-15 22:01                       ` Rafael J. Wysocki
     [not found]                         ` <201012152301.18700.rjw-KKrjLPT3xs0@public.gmane.org>
2010-12-15 23:39                           ` Rafael J. Wysocki

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=201012150115.52545.rjw@sisk.pl \
    --to=rjw-kkrjlpt3xs0@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=rabin-66gdRtMMWGc@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).