linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* swsusp broken
@ 2003-08-30 12:50 Mika Penttilä
  2003-08-31 21:02 ` Pavel Machek
  2003-09-02 17:00 ` Patrick Mochel
  0 siblings, 2 replies; 3+ messages in thread
From: Mika Penttilä @ 2003-08-30 12:50 UTC (permalink / raw)
  To: linux-kernel

2.6.0-test4 software suspend seems to be badly broken...looking at it 
(relevant code included below), no wonder. pm_suspend_disk() calls 
swsusp_save(), which is is essentially a nop. The intention was clearly 
that after resume control would return from swsusp_save(), which isn't 
the case, instead we return from swsusp_write(), and power down again!!!

--Mika

--------------------------------------------------------------------------
static int pm_suspend_disk(void)
{
    int error;

    pr_debug("PM: Attempting to suspend to disk.\n");
    if (pm_disk_mode == PM_DISK_FIRMWARE)
        return pm_ops->enter(PM_SUSPEND_DISK);

    if (!have_swsusp)
        return -EPERM;

    pr_debug("PM: snapshotting memory.\n");
    in_suspend = 1;
    if ((error = swsusp_save()))
        goto Done;

    if (in_suspend) {
        pr_debug("PM: writing image.\n");
        error = swsusp_write();
        if (!error)
            error = power_down(pm_disk_mode);
        pr_debug("PM: Power down failed.\n");
    } else
        pr_debug("PM: Image restored successfully.\n");
    swsusp_free();
 Done:
    return error;
}
----------------------------------------------------------------------------

/**
 *    swsusp_save - Snapshot memory
 */

int swsusp_save(void)
{
#if defined (CONFIG_HIGHMEM) || defined (COFNIG_DISCONTIGMEM)
    printk("swsusp is not supported with high- or discontig-mem.\n");
    return -EPERM;
#endif
    return 0;
}



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: swsusp broken
  2003-08-30 12:50 swsusp broken Mika Penttilä
@ 2003-08-31 21:02 ` Pavel Machek
  2003-09-02 17:00 ` Patrick Mochel
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2003-08-31 21:02 UTC (permalink / raw)
  To: Mika Penttilä; +Cc: linux-kernel

Hi!

> 2.6.0-test4 software suspend seems to be badly broken...looking at it 
> (relevant code included below), no wonder. pm_suspend_disk() calls 
> swsusp_save(), which is is essentially a nop. The intention was clearly 
> that after resume control would return from swsusp_save(), which isn't 
> the case, instead we return from swsusp_write(), and power down
> again!!!

If you want working swsusp/S3, go for -test3. This is known and
Patrick is working on that... I hope we can just rollback
powermanagment to -test3 state.

> --------------------------------------------------------------------------
> static int pm_suspend_disk(void)
> {
>    int error;
> 
>    pr_debug("PM: Attempting to suspend to disk.\n");
>    if (pm_disk_mode == PM_DISK_FIRMWARE)
>        return pm_ops->enter(PM_SUSPEND_DISK);
> 
>    if (!have_swsusp)
>        return -EPERM;
> 
>    pr_debug("PM: snapshotting memory.\n");
>    in_suspend = 1;
>    if ((error = swsusp_save()))
>        goto Done;
> 
>    if (in_suspend) {
>        pr_debug("PM: writing image.\n");
>        error = swsusp_write();
>        if (!error)
>            error = power_down(pm_disk_mode);
>        pr_debug("PM: Power down failed.\n");
>    } else
>        pr_debug("PM: Image restored successfully.\n");
>    swsusp_free();
> Done:
>    return error;
> }
> ----------------------------------------------------------------------------
> 
> /**
> *    swsusp_save - Snapshot memory
> */
> 
> int swsusp_save(void)
> {
> #if defined (CONFIG_HIGHMEM) || defined (COFNIG_DISCONTIGMEM)
>    printk("swsusp is not supported with high- or discontig-mem.\n");
>    return -EPERM;
> #endif
>    return 0;
> }

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: swsusp broken
  2003-08-30 12:50 swsusp broken Mika Penttilä
  2003-08-31 21:02 ` Pavel Machek
@ 2003-09-02 17:00 ` Patrick Mochel
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick Mochel @ 2003-09-02 17:00 UTC (permalink / raw)
  To: Mika Penttilä; +Cc: linux-kernel


> 2.6.0-test4 software suspend seems to be badly broken...looking at it 
> (relevant code included below), no wonder. pm_suspend_disk() calls 
> swsusp_save(), which is is essentially a nop. The intention was clearly 
> that after resume control would return from swsusp_save(), which isn't 
> the case, instead we return from swsusp_write(), and power down again!!!

Could you please try -test4-mm4? This problem should be fixed in there.

Thanks,


	Pat


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

> 2.6.0-test4 software suspend seems to be badly broken...looking at it 
> (relevant code included below), no wonder. pm_suspend_disk() calls 
> swsusp_save(), which is is essentially a nop. The intention was clearly 
> that after resume control would return from swsusp_save(), which isn't 
> the case, instead we return from swsusp_write(), and power down again!!!

Could you please try -test4-mm4? This problem should be fixed in there.

Thanks,


	Pat



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-09-02 17:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-30 12:50 swsusp broken Mika Penttilä
2003-08-31 21:02 ` Pavel Machek
2003-09-02 17:00 ` Patrick Mochel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).