From: Michael Trimarchi <trimarchi@gandalf.sssup.it>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-pm@lists.linux-foundation.org
Subject: Re: [RFC Disable suspend on a specific device] This is a little change in linux power scheme
Date: Wed, 08 Apr 2009 23:25:57 +0200 [thread overview]
Message-ID: <49DD1665.5020205@gandalf.sssup.it> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0904081607580.3138-100000@iolanthe.rowland.org>
Alan Stern wrote:
> On Tue, 7 Apr 2009, Rafael J. Wysocki wrote:
>
>
>> Well, in fact I wanted to know your opinion about this patch. :-)
>>
>
> Clearly this patch isn't appropriate for regular desktop or laptop
> systems. I'm not so sure it's the best approach for embedded systems
> either.
>
> Part of the problem is the set of devices which would remain
> unsuspended: the device for which the flag is set plus everything below
> it in the device tree. This goes against the way the kernel has
> behaved up to now, which is that a device may not be suspended before
> all its children are suspended.
>
> In addition, the patch appears to ignore issues involving clock and
> voltage domains. These things often are not reflected directly in the
> structure of the device tree.
>
> At a more fundamental level, this change points out a real weakness in
> the way suspend is currently implemented. From the PM core's point of
> view, system suspend involves two main activities:
>
> Telling drivers to stop using their devices, and
>
> Turning off (or reducing) power to the devices.
>
> The PM framework does not treat these separately; a single suspend
> method call is used for both purposes. But more and more we are seeing
> that they should be, especially on non-ACPI systems. This patch is, in
> a roundabout way, an attempt to do so.
>
> Part of the problem is that people tend to think of "suspend" as
> meaning "suspend the system". However a much more flexible -- dare I
> say more valid? -- point of view is "suspend the CPUs and at the same
> time remove (or reduce) power for devices that will no longer need it".
> In other words, system suspend really is just a kind of runtime
> suspend, in which the devices being suspended are the CPUs and the
> sysdevs.
>
> Obviously this is an oversimplification, but I think it's a useful
> approach.
>
> Just think about it. Suppose every driver supported autosuspend.
> When a driver received a notification that the CPU was going to be
> suspended, it would know that its device wasn't going to need power
> (since the device can't do anything useful without the driver telling
> it what to do) and so it would automatically power the device down,
> while also arranging not to access the device any more. Thus the
> suspend method calls would really exist only to let drivers know that
> their code was going to stop running (since the CPU was about to stop
> all activity); the device-power management part would merely be a side
> effect.
>
> And then, of course, drivers on embedded systems would be smart enough
> to know that some of the devices _should_ remain powered up, because
> they could still be useful even when the CPU wasn't running. The only
> obstacle is letting the drivers know when their devices actually _are_
> in use -- sometimes this is apparent only at the application level.
>
> So the patch should be rewritten. Change the name of the new attribute
> to something like "autonomous" or "in_use", and don't make the PM core
> skip devices when the attribute is set. Instead, change the relevant
> drivers. Their suspend methods should arrange for the driver to stop
> using the device, but if the attribute is set then the device should
> not be powered down.
>
> Alan Stern
>
>
>
Ok I will provide a new patch with this approch.
Regards Michael
next prev parent reply other threads:[~2009-04-08 21:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-07 10:29 [RFC Disable suspend on a specific device] This is a little change in linux power scheme Michael Trimarchi
2009-04-07 13:45 ` Rafael J. Wysocki
2009-04-07 15:39 ` Michael Trimarchi
2009-04-07 18:55 ` Rafael J. Wysocki
2009-04-07 19:01 ` Michael Trimarchi
2009-04-07 20:40 ` Pavel Machek
2009-04-07 20:57 ` Rafael J. Wysocki
2009-04-07 21:31 ` Alan Stern
2009-04-07 21:38 ` Pavel Machek
2009-04-07 22:25 ` Nigel Cunningham
2009-04-08 5:59 ` Michael Trimarchi
2009-04-08 8:13 ` Rafael J. Wysocki
2009-04-08 8:24 ` Michael Trimarchi
2009-04-08 8:34 ` Rafael J. Wysocki
2009-04-08 8:45 ` Michael Trimarchi
2009-04-07 8:06 ` Pavel Machek
2009-04-20 12:46 ` Mark Brown
2009-04-20 12:55 ` Michael Trimarchi
2009-04-08 11:42 ` Mark Brown
2009-04-08 16:44 ` Igor Stoppa
2009-04-08 18:23 ` Mark Brown
2009-04-08 19:53 ` Igor Stoppa
2009-04-09 14:33 ` Mark Brown
2009-04-07 21:40 ` Rafael J. Wysocki
2009-04-08 11:53 ` Mark Brown
2009-04-08 16:45 ` Igor Stoppa
2009-04-10 11:17 ` Pavel Machek
2009-04-08 20:37 ` Alan Stern
2009-04-08 21:25 ` Michael Trimarchi [this message]
2009-04-08 21:56 ` Rafael J. Wysocki
2009-04-09 18:27 ` Alan Stern
2009-04-09 22:33 ` 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=49DD1665.5020205@gandalf.sssup.it \
--to=trimarchi@gandalf.sssup.it \
--cc=linux-pm@lists.linux-foundation.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