public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Linux-pm mailing list <linux-pm@lists.osdl.org>
Subject: Re: Toward runtime power management in Linux
Date: Fri, 26 Aug 2005 07:42:34 +1000	[thread overview]
Message-ID: <1125006155.12538.21.camel@gaston> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0508251107280.4918-100000@iolanthe.rowland.org>

[-- Attachment #1: Type: text/plain, Size: 1322 bytes --]

On Thu, 2005-08-25 at 11:27 -0400, Alan Stern wrote:

> But it complicates the structure of drivers by forcing them to use a
> state-machine approach with a bunch of tedious intermediate states ("link
> change request issued, waiting for notification").  

Not necessarily. The driver could do synchronous blocking wait if it's
not running inside the context of the iterator thread which won't be the
case most of the time.

> It also introduces
> complications from the possible arrival of several change requests or
> notifications at once, since there's no locking to guarantee mutual
> exclusion among them.

Who else but the driver is allowed to request a link state change on the
device ? That specific race can be dealt with or considered as a
programming error.

> 	Device removal racing with power state changes.  During device
> 	removal the PM lock should be held; this will prevent the two
> 	operations from overlapping.  You might end up trying to carry
> 	out a power-state change on an already-removed device; that's
> 	not a problem -- it will simply fail.

Those locks are a wonderful deadlock scenario as soon as the driver end
up triggering add/remove events while they are held and that does
happen. I'm really not fan of those global and/or cascaded locks, I find
the approach very deadlock prone.



[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2005-08-25 21:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-31  2:36 Toward runtime power management in Linux Alan Stern
2005-08-01  2:10 ` Leo L. Schwab
2005-08-01 11:44   ` Amit Kucheria
2005-08-01 14:16     ` Alan Stern
     [not found]     ` <20050802024415.C3518DB57B@adsl-69-107-32-110.dsl.pltn13.pacbell.net>
2005-08-04  8:06       ` Tony Lindgren
2005-08-04 16:02         ` david-b
2005-08-14 19:53         ` Pavel Machek
2005-08-01 14:07   ` Alan Stern
2005-08-01 15:10     ` Jordan Crouse
2005-08-01 15:23       ` Alan Stern
2005-08-04 17:24     ` Igor Stoppa
     [not found] ` <Pine.LNX.4.50.0508011712220.2764-100000@monsoon.he.net>
2005-08-02 17:45   ` Geoff Levand
2005-08-25  3:12 ` Benjamin Herrenschmidt
2005-08-25 15:27   ` Alan Stern
2005-08-25 21:42     ` Benjamin Herrenschmidt [this message]
2005-08-26  2:25       ` Alan Stern
     [not found] <Pine.LNX.4.50.0508012316380.2764-100000@monsoon.he.net>
2005-08-02 14:35 ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2005-08-25 13:59 Brown, Len

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=1125006155.12538.21.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=linux-pm@lists.osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox