lkml.org 
[lkml]   [2004]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH/RFC] Add support to resume swsusp from initrd
On Sun, 2004-12-05 at 22:12 +0100, Pavel Machek wrote:

> > echo -n "set 03:02" >/sys/power/resume
>
> I'd prefer not to have this one. Is it actually usefull? Then resume
> could be triggered by echo -n "03:02" > /sys/power/resume...

resume_device is set by swsusp_read, which requires name_to_dev_t to be
working. At the point where that's called, the device driver hasn't been
loaded and we don't have the information to get the dev_t. Once the
driver has been loaded, name_to_dev_t has already been discarded (it's
marked __init). So we need to set resume_device somehow.

> > will set /dev/hda2 as the resume device.
> >
> > echo -n "resume 03:02" >/sys/power/resume
> >
> > will attempt a resume from /dev/hda2. Patches are against
> > 2.6.10-rc3.
>
> Nice way to loose your data :-). [Note note note -- I'm not going to
> merge it before my bigdiff goes to mainline, so expect to rediff it
> when 2.6.10 is out. I can generate the big diff if you want to test it
> now.]

Heh. Yes, that's no problem. A new bigdiff for -rc3 would be helpful.

> You really need to make sure that userland processes are stopped
> before swsusp-resume is started. You should do freeze_process(). Then
> resume process depends on having enough memory available, so you
> probably want to free_some_memory() and warn in documentation about
> the fact.

Ok. I'll look into that. The main reason I want code like this is that
Debian use modular IDE drivers that are stored in the initrd. The disks
won't be touched until the root file system is mounted, and we'll
trigger the resume before then, so there shouldn't be any risk of data
loss. At this point, there shouldn't be any userspace running other than
a single shell script - do you think it's still a problem?

> Ugh, and you really should document "list of bad ideas with resume
> from userspace". It is extremely easy to shoot yourself into the foot
> with this one.

Will do.

Thanks,
--
Matthew Garrett | mjg59@srcf.ucam.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:1.469 / U:1.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site