public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Patrick Mochel <mochel@digitalimplant.org>
Cc: linux-pm@lists.osdl.org
Subject: Re: Runtime device power management in userspace
Date: Mon, 26 Dec 2005 23:33:25 +0100	[thread overview]
Message-ID: <20051226223325.GE1974@elf.ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.50.0512261234350.12383-100000@monsoon.he.net>

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

On Po 26-12-05 12:43:43, Patrick Mochel wrote:
> > Is there enough locking in driver core to make this safe?
> 
> The issue I stated is actually orthogonal to locking the device; but the
> answer to your question is: probably not. We should probably be taking the
> per-device semaphore to prevent against competing events that are trying
> to add/remove a device or driver.

Ok, thanks. That means that some races are still there, but they
probably don't matter for non-hotpluggable stuff like PCI, right?

> > Ouch and BTW *right* value is _2_, today... because state_store() uses
> > value from user as a pm_message_t.event. We should at least supply
> > some hint that it is runtime suspend in pm_message_t.flags --
> > unfortunately we do not have pm_message_t.flags yet.
> 
> And I don't think that we want it. I think that we want a completely
> different API for doing runtime PM. Using the same API will make the
> drivers more complicated by having to have a repeated control sequence for
> determing what state (and under what conditions) the device is entering.
> 
> Also, recall that the actual states the device and driver support could be
> different than any other device or driver (even when the device or driver
> are the same). What we need is a way for a driver to easily export the
> states that it supports and a way to enter those exported states (e.g. an
> array or linked list of state names and callbacks, like has been mentioned
> a few times before).
> 
> To that effect, the per-device power file and its semantics should go away
> completely and replaced with something that supports this new API.

Noone uses .../power API just now (except Holger :-), so I think we
can still change it. Currently it is horribly broken -- taking 0/2 and
passing it directly to pm_message_t.event. I don't think we can solve
worlds hunger today... but what about at least changing interface so
that it lists two states ("on" and "suspend") that are more or less
common to all drivers?
								Pavel

-- 
Thanks, Sharp!

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



  reply	other threads:[~2005-12-26 22:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-23 14:30 Runtime device power management in userspace Holger Macht
2005-12-23 15:12 ` Patrick Mochel
2005-12-24  0:40   ` Pavel Machek
2005-12-26 20:43     ` Patrick Mochel
2005-12-26 22:33       ` Pavel Machek [this message]
2005-12-27 18:59         ` Patrick Mochel
2005-12-27 19:22           ` Pavel Machek
2005-12-27 19:29             ` Patrick Mochel
2005-12-27 19:41               ` Pavel Machek
2005-12-27 20:40                 ` Patrick Mochel
2005-12-27 21:06                   ` Pavel Machek
2005-12-26 22:47       ` Alan Stern
2005-12-27 17:29         ` Pavel Machek
2005-12-27 17:36           ` Randy.Dunlap
2005-12-24 15:31   ` Holger Macht
2005-12-26 20:58     ` Patrick Mochel
2005-12-27 20:04       ` Pavel Machek
2005-12-27 20:54         ` Patrick Mochel
2005-12-23 15:17 ` Alan Stern
2005-12-24  0:41   ` Pavel Machek
2005-12-24  0:43   ` Pavel Machek

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=20051226223325.GE1974@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=linux-pm@lists.osdl.org \
    --cc=mochel@digitalimplant.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