Re: Suspend 2 merge: 7/51: Reboot handler hook.

Nigel Cunningham
2004-11-24T22:14:25Z

Hi.

On Thu, 2004-11-25 at 00:07, Christoph Hellwig wrote:
> > -#ifdef CONFIG_SOFTWARE_SUSPEND
> > +#ifdef CONFIG_SOFTWARE_SUSPEND2
> > case LINUX_REBOOT_CMD_SW_SUSPEND:
> > {
> > - int ret = software_suspend();
> > + int ret = -EINVAL;
> > + if (!(test_suspend_state(SUSPEND_DISABLED))) {
> > + suspend_try_suspend();
> > + ret = 0;
> > + }
> > unlock_kernel();
>
> total crap. Thbis patch breaks the existing swsusp and turns a clean
> interface into a horrible one. Just implement am

It doesn't break the existing suspend; rather it overrides the action. I
will however tidy it up. Sorry about that; I reversed the test a while
ago and didn't notice that it could be tidier. I note though that your
solution fails to unlock_kernel().

Regards,

Nigel

> int software_suspend(void)
> {
> if (test_suspend_state(SUSPEND_DISABLED))
> return -EINVAL;
> suspend_try_suspend();
> return 0;
> }
>
> in your code.
--
Nigel Cunningham
Pastoral Worker
Christian Reformed Church of Tuggeranong
PO Box 1004, Tuggeranong, ACT 2901

You see, at just the right time, when we were still powerless, Christ
died for the ungodly. -- Romans 5:6