hibernate, suspend and s2both support

Johannes Berg johannes at sipsolutions.net
Mon Mar 19 01:37:50 EST 2007


On Sun, 2007-03-18 at 14:41 +0100, Tim Dijkstra wrote:

> So if I build a binary on ppc that first tries /dev/pmu (if it exists) and then
> /sys/power/state, that would be safe?

Yeah, my current patchset will print a message that the /dev/pmu ioctl
will be removed but that may well not be present.

> I guess that the powerpcs that do not
> support suspend-to-ram will report that via the PMU_IOC_CAN_SLEEP ioctl

They either have no /dev/pmu device or return an error on the ioctl.

>  and
> they will lack 'mem' in /sys/power/state?

That's tricky. Up until I posted a patch *very* recently (unreleased as
of yet I think) the contents of /sys/power/state didn't reflect what was
supported, in fact if *nothing* was supported then "mem" and "standby"
would be shown. Also, up until that patch I cited in my previous mail,
mem and standby would, on powermac, kill the machine. On other machines,
mem and standby exist but return an error.

> > Yup; I've played with s2both a bit but it hangs the machine, I'm not
> > really sure why yet. It may be related to another slight bug I just
> > found yesterday though.
> 
> Hmm, so 'echo disk > /s/p/state' and s2ram suspend OK, but s2both doesn't?

No, echo disk ... and s2ram both suspend ok, and I haven't tested your
s2both tool because I don't know what it does, it seemed to be a
userland suspend to disk for which I'd need special initramfs support. I
have tested the 'platform' powerdown method for suspend to disk support
in the kernel and that killed the machine due to a yet unidentified
problem.

> Oops, Yes that was the wrong way around... That's what you get if you
> don't have a Mac;) Did you try it with the obvious fix?

Yeah, it works and uses the pmu ioctl.

> Yes you need an initramfs, but I don't see any reason why if
> suspend-to-disk and suspend-to-ram work, s2both wouldn't. 

I think I wasn't really clear on what I said, see above.

> If we get
> suspend-to-ram working I'll put up proper source package which you can
> dpkg-buildpackage. That will include hooks for initramfs-tools and will
> build an initramfs for you.

Do you really think that I let debian build my initramfs? :P
Have you documented somewhere in text form what pm-utils needs in the
initramfs?

johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070318/3e2033f5/attachment.pgp>


More information about the Linuxppc-dev mailing list