mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Rabin Vincent <rabin@rab.in>,
	stern@rowland.harvard.edu, linux-pm@lists.linux-foundation.org,
	linux-i2c@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: platform/i2c busses: pm runtime and system sleep
Date: Sat, 18 Dec 2010 15:59:50 +0100	[thread overview]
Message-ID: <201012181559.50347.rjw@sisk.pl> (raw)
In-Reply-To: <20101218132029.GA22273@opensource.wolfsonmicro.com>

On Saturday, December 18, 2010, Mark Brown wrote:
> On Sat, Dec 18, 2010 at 01:54:57PM +0100, Rafael J. Wysocki wrote:
> > On Saturday, December 18, 2010, Mark Brown wrote:
> 
> > > SPI and platform (the first two buses I looked at) both seem to have
> > > legacy suspend operations too?  Clearly the bus would need to provide an
> > > op to invoke the legacy call but the logic which prioritises the pm_ops
> > > over the legacy operation is generic.
> 
> > Well, the problem with that is the driver would need to tell the generic call
> > what the legacy routine is and there's no, er, generic way to do that.
> 
> > In the i2c case, for example, there is struct i2c_driver that contains the
> > ->suspend() and ->resume() pointers, so the bus type driver _knows_ how to
> > get there, but the PM core doesn't have this information.
> 
> Sure, but this could be readily accomplished by providing bus
> legacy_suspend() and legacy_resume() operations that the generic code
> could use to do the actual call.

First, there already are ->suspend() and ->resume() callbacks in
struct bus_type which are regarded as "legacy".  The PM core uses those as
appropriate in drivers/base/power/main.c .

Second, the situation at hand is that the bus type implements dev_pm_ops,
but the driver doesn't.  Now, pm_generic_suspend() is called with a struct
device pointer, so it would have to go back to dev->bus, find the
->legacy_suspend() callback (as opposed to ->suspend(), which also is legacy,
but is called by the PM core instead).  May I call that confusing?

> This would save them all implmeneting
> essentially the same decision making code for all the various different 
> PM operations - the only bit that differs between buses is going to be
> the actual process for calling the legacy API.
> 
> Like I say, I'm not sure if it's actually worth it.

Well, I don't really think so.

Thanks,
Rafael

  reply	other threads:[~2010-12-18 15:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-16 18:26 Rabin Vincent
2010-12-17  0:09 ` Rafael J. Wysocki
2011-02-17 15:25   ` Rabin Vincent
2011-02-18  2:48     ` Rabin Vincent
2011-02-18 15:05       ` Alan Stern
2011-02-18 18:28       ` Rafael J. Wysocki
2011-02-18 19:25         ` Rabin Vincent
2011-02-18 20:20           ` Rafael J. Wysocki
2011-02-18 20:27             ` Russell King - ARM Linux
2011-02-18 22:16               ` Mark Brown
2011-02-19  7:24               ` Rabin Vincent
2011-02-19  9:54               ` Linus Walleij
2011-02-19 10:00                 ` Russell King - ARM Linux
2011-02-19 10:16                   ` Linus Walleij
2010-12-17 12:54 ` Mark Brown
2010-12-17 13:25   ` Rafael J. Wysocki
2010-12-17 13:34     ` Mark Brown
2010-12-17 13:49       ` Rafael J. Wysocki
2010-12-17 14:24         ` Mark Brown
2010-12-17 23:01           ` Rafael J. Wysocki
2010-12-18  1:04             ` Mark Brown
2010-12-18 12:54               ` Rafael J. Wysocki
2010-12-18 13:20                 ` Mark Brown
2010-12-18 14:59                   ` Rafael J. Wysocki [this message]
2010-12-20 15:00                     ` Mark Brown
2010-12-20 21:13                       ` Rafael J. Wysocki
2010-12-21 23:51                         ` Mark Brown
2010-12-22  0:35                           ` 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=201012181559.50347.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rabin@rab.in \
    --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

all inboxes | Powered by JetHome®