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: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	pm list
	<linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
	Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [linux-pm] [PATCH] i2c: Use generic subsystem-level power management callbacks
Date: Mon, 15 Mar 2010 20:34:12 +0100	[thread overview]
Message-ID: <201003152034.12195.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1003142117200.7108-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>

On Monday 15 March 2010, Alan Stern wrote:
> On Sun, 14 Mar 2010, Rafael J. Wysocki wrote:
> 
> > On Sunday 14 March 2010, Alan Stern wrote:
> > > On Sun, 14 Mar 2010, Rafael J. Wysocki wrote:
> > > 
> > > > > You know, maybe we should allow bus types to use both the old and new
> > > > > interfaces.  It would make life easier for other subsystems in addition
> > > > > to i2c.
> > > > > 
> > > > > This doesn't mean that the core would end up calling two sets of
> > > > > suspend routines.  If the bus type uses legacy routines then all the
> > > > > non-runtime entries in the pm_ops structure would be empty.
> > > > > 
> > > > > The changes to the PM core necessary to do this are quite small.
> > > > 
> > > > Not really.  The detection that the particular callback is not present happens
> > > > in pm_op(), while the decision which framework to use is made at the
> > > > device_[suspend|resume]() level.
> > > 
> > > All you have to do is change the "else if" lines in
> > > device_[suspend|resume]() to "if".
> > 
> > Then, if a bus type implements both "new" and "old" callbacks, we'll end up
> > calling both.  Not nice.
> 
> Why would a bus type implement both?  Or looked at another way, if it 
> did implement both then wouldn't it want both sets of callbacks to be 
> invoked?
> 
> If a bus type does define both types of callback by mistake and only 
> wants one of them to be used, that's a bug -- pure and simple.  It's 
> not the PM core's fault if something goes wrong under those 
> circumstances.

In fact, I'd like the "legacy" callbacks to go, at least at the subsystem
level, so I'd prefer not to make it easier to keep them around.

How many bus types are there and how many of them actually implement power
management callbacks?  I don't really think the issue is so big.

Rafael

  parent reply	other threads:[~2010-03-15 19:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-13 21:04 [PATCH] i2c: Use generic subsystem-level power management callbacks Rafael J. Wysocki
     [not found] ` <201003132204.30905.rjw-KKrjLPT3xs0@public.gmane.org>
2010-03-13 21:34   ` [linux-pm] " Alan Stern
     [not found]     ` <Pine.LNX.4.44L0.1003131627270.19476-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-03-14 19:58       ` Rafael J. Wysocki
     [not found]         ` <201003142058.45981.rjw-KKrjLPT3xs0@public.gmane.org>
2010-03-14 20:26           ` Alan Stern
     [not found]             ` <Pine.LNX.4.44L0.1003141620540.1752-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-03-14 22:52               ` Rafael J. Wysocki
     [not found]                 ` <201003142352.50692.rjw-KKrjLPT3xs0@public.gmane.org>
2010-03-15  1:28                   ` Alan Stern
     [not found]                     ` <Pine.LNX.4.44L0.1003142117200.7108-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-03-15 19:34                       ` Rafael J. Wysocki [this message]
     [not found]                         ` <201003152034.12195.rjw-KKrjLPT3xs0@public.gmane.org>
2010-03-15 20:38                           ` Alan Stern
     [not found]                             ` <Pine.LNX.4.44L0.1003151630370.1332-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-03-15 22:06                               ` Rafael J. Wysocki
2010-03-19 22:44   ` [PATCH] i2c: Fix bus-level " Rafael J. Wysocki
     [not found]     ` <201003192344.09000.rjw-KKrjLPT3xs0@public.gmane.org>
2010-03-25  8:57       ` Jean Delvare
     [not found]         ` <20100325095720.0b115056-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-25  9:28           ` Mark Brown
     [not found]             ` <20100325092802.GA27729-HF5t3jzXg/6ND3a5+9QAFujbO/Zr0HzV@public.gmane.org>
2010-03-25 20:16               ` 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=201003152034.12195.rjw@sisk.pl \
    --to=rjw-kkrjlpt3xs0@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@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).