[Pm-utils] [RFC] Writing "${HIBERNATE_MODE}" unconditionally to /sys/power/disk

Victor Lowther victor.lowther at gmail.com
Tue Mar 18 05:24:41 PDT 2008


On Tue, 2008-03-18 at 07:04 +0100, Michael Biebl wrote:
> Hi,
> 
> please see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=450515
> for the background.
> 
> Apparently, writing "platform" unconditionally to /sys/power/disk can
> lead to suspend failures, if this method is not supported.
> 
> If I read the kernel documentation correctly [1], "firmware" or
> "platform" can be not supported on certain platforms. The way to
> detect that, is probably to grep for it in /sys/power/disk. The
> documentation is not clear about that.
> 
> 
> So the question: Should we generally check for HIBERNATE_MODE first:
> --- a/pm/module.d/kernel
> +++ b/pm/module.d/kernel
> @@ -22,6 +22,7 @@ check_hibernate()
> 
>  do_hibernate()
>  {
> +       grep -q "${HIBERNATE_MODE}" /sys/power/disk && \
>         echo -n "${HIBERNATE_MODE}" > /sys/power/disk
>         echo -n "disk" > /sys/power/state
>  }
> 
> 
> Or only, if HIBERNATE_MODE is firmware or platform? And is this the
> correct way to determine if firmware or platform is supported.

How about just defaulting to "shutdown"?  True, we might disable the
suspend LED, and wake-on-lid probably will not work, but shutdown should
work everywhere with no problems.  If a user or distro wants "firmware"
or "platform" they can modify the defaults accordingly.

> Cheers,
> Michael
> 
> [1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/ABI/testing/sysfs-power
-- 
Victor Lowther
Ubuntu Certified Professional



More information about the Pm-utils mailing list