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: Magnus Damm <magnus.damm@gmail.com>, Greg KH <gregkh@suse.de>,
	LKML <linux-kernel@vger.kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Linux-pm mailing list <linux-pm@lists.linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [linux-pm] [patch update 2 fix] PM: Introduce core framework for run-time PM of I/O devices
Date: Mon, 22 Jun 2009 17:53:01 +0200	[thread overview]
Message-ID: <200906221753.01970.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0906221135360.14561-100000@iolanthe.rowland.org>

On Monday 22 June 2009, Alan Stern wrote:
> On Mon, 22 Jun 2009, Rafael J. Wysocki wrote:
> 
> > On Monday 22 June 2009, Alan Stern wrote:
> > > On Sun, 21 Jun 2009, Rafael J. Wysocki wrote:
> > > 
> > > > > Seriously, there _are_ places where drivers get bound to device before
> > > > > those devices are registered.  This happens for example in USB when a
> > > > > bunch of related interfaces are present in the same physical device.  
> > > > > When the first interface is registered, its driver binds itself to all
> > > > > the others even though they haven't been registered yet.
> > > > 
> > > > Well, the suspend functions could be protected against that under the
> > > > assumption that no suspend is possible for resume_counter = 0 (then, the "good
> > > > to go" value would be -1).
> > > > 
> > > > Still, the resume functions start from acquring a spinlock, which is not going
> > > > to work if that spinlock is uninitialized.
> > > 
> > > The initialization needs to be improved.  Most of the code in
> > > pm_runtime_init() should be called from device_pm_init(), and the rest
> > > should be moved into a separate pm_runtime_add() routine to be called
> > > from device_pm_add().
> > 
> > OK
> > 
> > In that case, I think, the initialization of the spinlock and resume_counter
> > can be put into the thing called by device_pm_init().
> 
> Right.
> 
> > > One of the things pm_runtime_add() could do is change the status from 
> > > RPM_UNREGISTERED to RPM_ACTIVE.
> > 
> > If the status is initially (ie. at the device_pm_init() point) RPM_ACTIVE and
> > resume_couter is initially 1, what are we going to need RPM_UNREGISTERED for?
> 
> Okay, we don't need it then.  I forgot to mention in the previous
> message that there also has to be a pm_runtime_del() routine, which
> should cancel pending workqueue items and set the counter to some high
> value so that no new items are added.

Should that be called by device_pm_remove()?  I think so.

Rafael

  parent reply	other threads:[~2009-06-22 15:52 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                                           ` Rafael J. Wysocki [this message]
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
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=200906221753.01970.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=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.