From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linux-pm mailing list <linux-pm@lists.osdl.org>,
Pavel Machek <pavel@ucw.cz>
Subject: swsusp issues
Date: Fri, 03 Jun 2005 12:01:51 +1000 [thread overview]
Message-ID: <1117764111.31082.119.camel@gaston> (raw)
[-- Attachment #1: Type: text/plain, Size: 2387 bytes --]
Hi Pavel !
So one problem I was having with my new code is that swsusp "hooks" of
enter_state() early and doesn't go through the "normal" callback
mecanism, thus wasn't calling any of my new callbacks.
In addition, it has its own save/restore_processor_state that do not go
through pm_ops, but instead are arch inlines (and besides, I never found
any use of those for saving/restoring processor state, though I do use
them for other means, the semantics are quite crappy here).
This is all fairly inconsistent.
What about (note: I'm proposing here to do the job, not asking you to do
it) merging at least disk.c into main.c, that is, having swsusp just use
the "normal" infrastructure ?
suspend_prepare() and suspend_finish() are pretty much equivalent to
what disk.c does in (un)prepare_processes(), prepare_devices() and
finish() with the exception of free_some_memory() which is not used in
suspend to ram, and swsusp does this totally bogus SMP tricks (they
really can't work properly, you'll deadlock trying to use them,
really !)
It would be very easy to consolidate all of that in suspend_prepare() an
suspend_finish() (adding the free_some_memory if state is
PM_SUSPEND_DISK), and those have nice error handling.
Then, the "main" implementation does ops->enter(). On swsusp, this enter
sort-of depdends of the "type" of suspend to disk required. Either
"enter" does all the job (PM_DISK_FIRMWARE) which is then totally
equivalent to the core code needs, or it's replaced by a blurb that does
swsusp_suspend, swsusp_write, etc...
Here, we could do two things... Either add some conditionals to the main
code to reproduce that logic (or rather that illogic), or we could
simply unconditionally call ops->enter() and provide a helper function
that the arch can call that does the swsusp_suspend, swsusp_write,
etc... if that is the arch choice to do.
Finally, the whole pm_disk_mode is just disgustingly ugly. Especially
the fact that the user can go muck around and change it. I do not
support any mode but "PM_DISK_PLATFORM" on ppc and I really think that
should be the only implementation. That is, it's up to the platform
provided pm_ops to decide what to do. Either doing all the work, or
using swsusp_suspend/swsusp_disk and then restart or shutdown or
whatever. This is all platform specific. Here, basically, the genric
code is exposing some x86 crappola.
Ben.
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next reply other threads:[~2005-06-03 2:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-03 2:01 Benjamin Herrenschmidt [this message]
2005-06-03 11:15 ` swsusp issues Pavel Machek
2005-06-03 22:50 ` Benjamin Herrenschmidt
2005-06-03 23:21 ` Pavel Machek
2005-06-03 23:29 ` Benjamin Herrenschmidt
2005-06-04 6:13 ` Pavel Machek
2005-06-04 6:23 ` Benjamin Herrenschmidt
2005-06-03 23:25 ` Nigel Cunningham
2005-06-03 23:32 ` Benjamin Herrenschmidt
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=1117764111.31082.119.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=linux-pm@lists.osdl.org \
--cc=pavel@ucw.cz \
/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