All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>,
	Magnus Damm <magnus.damm@gmail.com>,
	Linux-pm mailing list <linux-pm@lists.linux-foundation.org>,
	ACPI Devel Mailing List <linux-acpi@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Greg KH <gregkh@suse.de>
Subject: Re: [patch update 3] PM: Introduce core framework for run-time PM of I/O devices
Date: Wed, 24 Jun 2009 23:23:14 +0200	[thread overview]
Message-ID: <200906242323.15409.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0906241604510.22054-100000@iolanthe.rowland.org>

On Wednesday 24 June 2009, Alan Stern wrote:
> On Wed, 24 Jun 2009, Rafael J. Wysocki wrote:
> 
> > > The difficulty is that some USB interface drivers require remote wakeup
> > > to be enabled while their interfaces are suspended.  But remote wakeup
> > > is a global setting; it doesn't take effect until the entire physical
> > > device is suspended.  (To put it another way, USB has no notion of
> > > suspending interfaces.)  This means we must not allow these interfaces
> > > to be suspended before the whole device is.  But the whole device is
> > > the parent of the interfaces -- if we can't suspend the children before
> > > suspending the parent then we're stuck.
> > 
> > Not if we use the power.ignore_children flag on the parent.
> > 
> > > Clearly this is something the USB stack has to deal with; it shouldn't
> > > affect the general PM framework.  However the only solution I can think
> > > of involves subverting the framework, which isn't very nice.  The idea
> > > is to ignore runtime_suspend callbacks for these interface drivers;
> > > allow them to keep on running even though the PM core thinks they are
> > > suspended.  Then suspend and resume them as part of the callbacks for
> > > the entire device.  (For interface drivers that don't require remote
> > > wakeup there is no problem; it doesn't matter when they get suspended.)
> > > 
> > > This will work, but it's a hack.  Does anybody have a better idea?
> > 
> > Well, as I said above, you can set power.ignore_children on the device
> > and then it can be suspended even if the interfaces aren't.
> 
> Hmm.  The hard part still remains: to make sure that the interfaces 
> don't get suspended without the device also getting suspended.
> 
> I suppose we could attack this by making the device do a runtime_get on
> each of the interfaces, which would be released in the device's
> runtime_suspend method.  But then conversely, each interface driver
> would have to do its gets and puts on the _device's_ resume_counter.  
> If they used the interface counters then the values would never go to 0
> and so nothing would ever be suspended.
> 
> You've got to admit, this does sound rather bizarre.  :-)

Yeah.

> But it ought to work...

Alternatively, there can be a USB-specific flag for the interfaces meaning
"device suspended" if set.  Then, the device driver will have to set that flag
for all the interfaces so that they can be suspended and the interface drivers
as well as the device driver will use the device's resume counter to block
suspends of the whole thing.

Best,
Rafael

  reply	other threads:[~2009-06-24 21:22 UTC|newest]

Thread overview: 117+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-13 22:23 [PATCH] PM: Introduce core framework for run-time PM of I/O devices Rafael J. Wysocki
2009-06-14  9:41 ` Magnus Damm
2009-06-14  9:41 ` Magnus Damm
2009-06-14  9:41   ` Magnus Damm
2009-06-14 10:29   ` Rafael J. Wysocki
2009-06-14 10:29   ` Rafael J. Wysocki
2009-06-14  9:58 ` [linux-pm] " Rafael J. Wysocki
2009-06-14 22:57   ` [patch update] " Rafael J. Wysocki
2009-06-14 23:18     ` Arjan van de Ven
2009-06-15 20:02       ` Rafael J. Wysocki
2009-06-15 20:02       ` Rafael J. Wysocki
2009-06-14 23:18     ` Arjan van de Ven
2009-06-15 21:08     ` Alan Stern
2009-06-15 21:08     ` Alan Stern
2009-06-15 21:08       ` Alan Stern
2009-06-15 23:21       ` Rafael J. Wysocki
2009-06-16 14:30         ` Alan Stern
2009-06-16 14:30         ` Alan Stern
2009-06-16 14:30           ` Alan Stern
2009-06-16 21:30           ` [patch update 2] " Rafael J. Wysocki
2009-06-16 21:30           ` Rafael J. Wysocki
2009-06-16 22:33             ` [patch update 2 fix] " Rafael J. Wysocki
2009-06-17 20:08               ` Alan Stern
2009-06-17 20:08                 ` Alan Stern
2009-06-17 23:07                 ` Rafael J. Wysocki
2009-06-18 18:17                   ` Alan Stern
2009-06-18 18:17                   ` Alan Stern
2009-06-18 18:17                     ` Alan Stern
2009-06-19  0:38                     ` Rafael J. Wysocki
2009-06-19  0:38                     ` Rafael J. Wysocki
2009-06-19 16:25                       ` Alan Stern
2009-06-19 16:25                       ` Alan Stern
2009-06-19 16:25                         ` Alan Stern
2009-06-19 22:42                         ` Rafael J. Wysocki
2009-06-20  2:34                           ` Alan Stern
2009-06-20  2:34                           ` Alan Stern
2009-06-20  2:34                             ` Alan Stern
2009-06-20 14:30                             ` Alan Stern
2009-06-20 14:30                             ` [linux-pm] " Alan Stern
2009-06-20 23:48                               ` Rafael J. Wysocki
2009-06-20 23:48                               ` [linux-pm] " Rafael J. Wysocki
2009-06-21  2:30                                 ` Alan Stern
2009-06-21  2:30                                 ` [linux-pm] " Alan Stern
2009-06-21 11:32                                   ` Rafael J. Wysocki
2009-06-21 11:32                                   ` [linux-pm] " Rafael J. Wysocki
2009-06-22 14:16                                     ` Alan Stern
2009-06-22 15:27                                       ` Rafael J. Wysocki
2009-06-22 15:27                                       ` [linux-pm] " Rafael J. Wysocki
2009-06-22 15:39                                         ` Alan Stern
2009-06-22 15:53                                           ` Rafael J. Wysocki
2009-06-22 15:53                                           ` [linux-pm] " Rafael J. Wysocki
2009-06-22 15:39                                         ` Alan Stern
2009-06-22 14:16                                     ` Alan Stern
2009-06-22  6:20                               ` [linux-pm] " Magnus Damm
2009-06-22  6:20                                 ` Magnus Damm
2009-06-22  6:43                                 ` Arjan van de Ven
2009-06-22  6:43                                   ` Arjan van de Ven
2009-06-22  7:27                                   ` Magnus Damm
2009-06-22  7:27                                     ` [linux-pm] " Magnus Damm
2009-06-22 13:49                                     ` Arjan van de Ven
2009-06-22 13:49                                     ` [linux-pm] " Arjan van de Ven
2009-06-22 13:49                                       ` Arjan van de Ven
2009-06-22 15:39                                       ` Rafael J. Wysocki
2009-06-22 15:39                                       ` [linux-pm] " Rafael J. Wysocki
2009-06-22 15:33                                   ` Rafael J. Wysocki
2009-06-22 15:33                                   ` Rafael J. Wysocki
2009-06-22  6:43                                 ` Arjan van de Ven
2009-06-22  8:15                                 ` [linux-pm] " Oliver Neukum
2009-06-22  8:15                                 ` Oliver Neukum
2009-06-22  6:20                               ` Magnus Damm
2009-06-20 23:38                             ` [patch update 3] " Rafael J. Wysocki
2009-06-21  2:23                               ` Alan Stern
2009-06-21  2:23                               ` Alan Stern
2009-06-21  2:23                                 ` Alan Stern
2009-06-21 12:46                                 ` Rafael J. Wysocki
2009-06-21 12:46                                 ` Rafael J. Wysocki
2009-06-22 15:01                                   ` Alan Stern
2009-06-22 15:01                                     ` Alan Stern
2009-06-22 15:49                                     ` Rafael J. Wysocki
2009-06-22 15:49                                     ` Rafael J. Wysocki
2009-06-22 16:28                                       ` Alan Stern
2009-06-22 16:28                                       ` Alan Stern
2009-06-22 16:28                                         ` Alan Stern
2009-06-22 23:02                                         ` Rafael J. Wysocki
2009-06-22 23:02                                         ` Rafael J. Wysocki
2009-06-23 17:02                                       ` Alan Stern
2009-06-23 17:02                                       ` Alan Stern
2009-06-23 17:02                                         ` Alan Stern
2009-06-23 17:45                                         ` Rafael J. Wysocki
2009-06-23 18:26                                           ` Alan Stern
2009-06-23 18:26                                           ` Alan Stern
2009-06-23 18:26                                             ` Alan Stern
2009-06-24  0:17                                             ` Rafael J. Wysocki
2009-06-24  0:17                                             ` Rafael J. Wysocki
2009-06-24 14:51                                               ` Alan Stern
2009-06-24 14:51                                               ` Alan Stern
2009-06-24 19:14                                                 ` Rafael J. Wysocki
2009-06-24 19:14                                                 ` Rafael J. Wysocki
2009-06-24 20:19                                                   ` Alan Stern
2009-06-24 20:19                                                   ` Alan Stern
2009-06-24 21:23                                                     ` Rafael J. Wysocki [this message]
2009-06-24 21:23                                                     ` Rafael J. Wysocki
2009-06-23 17:45                                         ` Rafael J. Wysocki
2009-06-20 23:38                             ` Rafael J. Wysocki
2009-06-19 22:42                         ` [patch update 2 fix] " Rafael J. Wysocki
2009-06-17 23:07                 ` Rafael J. Wysocki
2009-06-17 20:08               ` Alan Stern
2009-06-16 22:33             ` Rafael J. Wysocki
2009-06-15 23:21       ` [patch update] " Rafael J. Wysocki
2009-06-24 15:04     ` Pavel Machek
2009-06-27 21:52       ` Rafael J. Wysocki
2009-07-06  8:28         ` Pavel Machek
2009-07-06  8:28         ` Pavel Machek
2009-06-27 21:52       ` Rafael J. Wysocki
2009-06-24 15:04     ` Pavel Machek
2009-06-14 22:57   ` Rafael J. Wysocki
2009-06-14  9:58 ` [PATCH] " 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=200906242323.15409.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=gregkh@suse.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=magnus.damm@gmail.com \
    --cc=mingo@elte.hu \
    --cc=oliver@neukum.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.