All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linux-pm mailing list <linux-pm@lists.osdl.org>
Subject: Re: swsusp issues
Date: Fri, 3 Jun 2005 13:15:41 +0200	[thread overview]
Message-ID: <20050603111541.GC3867@elf.ucw.cz> (raw)
In-Reply-To: <1117764111.31082.119.camel@gaston>

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

Hi!

> 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).

Well, i386 definitely uses them for saving some 'less important' cpu
registers.

> 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 ?

Merging disk.c and main.c is certainly good idea, I never know which
one to look in, anyway.

> 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 !)

Those smp tricks... see my development tree at
www.kernel.org/...git/pavel/work.git. We actually use cpu hotplug
infrastructure and it should work ok.

> 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...

PM_DISK_FIRMWARE can be safely removed. See feature-removal*,
DISK_FIRMWARE is S4BIOS.

> 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.

PM_DISK_REBOOT is very usefull for testing (and I believe generic; you
could do that on ppc too). PM_DISK_SHUTDOWN is usefull for using
normal powerdown paths in case something is wrong with disk-specific
powerdown. We should move away from it, but please try not to kill it.

								Pavel

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



  reply	other threads:[~2005-06-03 11:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-03  2:01 swsusp issues Benjamin Herrenschmidt
2005-06-03 11:15 ` Pavel Machek [this message]
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=20050603111541.GC3867@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=benh@kernel.crashing.org \
    --cc=linux-pm@lists.osdl.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 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.