On Wed, Mar 28, 2007 at 03:22:51PM +0200, Cédric Boutillier wrote:
> Hi !
> 
> Here are some news.  Thanks to Tim's patch, I got to the next step :
> 
> I got a screen, saying that tasks are being stopped, and memory is
> being written to disk. Everything seems to go fine, but then, the
> system does not suspend ! Instead, the screen becomes white/red, and
> gets darker and darker. The system is still responsive : if network is
> up, I can still ssh to the system.

It did not suspend/power off, but wake up immediately, but somehow
the graphics card got fscked up in that process.

looking at the kernel code in user.c:
------------------------------------------------------
        case SNAPSHOT_PMOPS:
                error = -EINVAL;

                switch (arg) {

                case PMOPS_PREPARE:
                        if (pm_ops && pm_ops->enter) {
                                data->platform_suspend = 1;
                                error = 0;
                        } else {
                                error = -ENOSYS;
                        }
                        break;

                case PMOPS_ENTER:
                        if (data->platform_suspend) {
                                disable_nonboot_cpus();
                                kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
                                error = pm_ops->enter(PM_SUSPEND_DISK);
                                enable_nonboot_cpus();
                        }
                        break;

                case PMOPS_FINISH:
                        if (data->platform_suspend)
                                error = 0;

                        break;

                default:
                        printk(KERN_ERR "SNAPSHOT_PMOPS: invalid argument 
%ld\n", arg);

                }
                break;
------------------------------------------------------

I _think_ that (pm_ops && pm_ops->enter) is just not true on ppc, and
so data->platform_suspend is also not true.
So the PMOPS_ENTER case just returns.
However, this code in (uswsusp) suspend.c:

static void suspend_shutdown(int snapshot_fd)
{
        if (!strcmp(shutdown_method, "reboot")) {
                reboot();
        } else if (use_platform_suspend) {
                int ret = platform_enter(snapshot_fd);
                if (ret < 0)
                        fprintf(stderr, "suspend: pm_ops->enter returned"
                                " error %d, calling power_off\n", errno);
        }
        power_off();
        /* Signature is on disk, it is very dangerous to continue now.
         * We'd do resume with stale caches on next boot. */
        fprintf(stderr,"Powerdown failed. That's impossible.\n");
        while(1);
}

should either call power_off() or loop endlessly, instead of resuming in this
case, so i don't really know what happens.

Warning: if it really wrote the image to disk, make sure that you invalidate
that image before the next reboot (do "mkswap $swapdevice"), otherwise you
might get into trouble.

Also, i would check if your backups of your data are readable before
continuing those experiments ;-)
-- 
Stefan Seyfried

"Any ideas, John?"
"Well, surrounding them's out." 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to