Re: [PATCH] swsusp: Disable nonboot CPUs before entering platform suspend

From: Pavel Machek
Date: Fri Mar 09 2007 - 03:54:45 EST


Hi!

> > > Index: linux-2.6.21-rc2-mm2/kernel/power/disk.c
> > > ===================================================================
> > > --- linux-2.6.21-rc2-mm2.orig/kernel/power/disk.c
> > > +++ linux-2.6.21-rc2-mm2/kernel/power/disk.c
> > > @@ -61,6 +61,7 @@ static void power_down(suspend_disk_meth
> > > switch(mode) {
> > > case PM_DISK_PLATFORM:
> > > if (pm_ops && pm_ops->enter) {
> > > + disable_nonboot_cpus();
> > > kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
> > > pm_ops->enter(PM_SUSPEND_DISK);
> > > break;
> >
> > ...so, if pm_ops is non-null, power_down does nonboot cpu disabling,
> > otherwise we proceed with cpus enabled?
> >
> > That looks ugly.
> >
> > Is the warning bogus?
>
> Well, maybe. I'm not sure.
>
> > Or maybe we should *always* disable nonboot cpus in powerdown path?
>
> I think we should do that.

That would be acceptable.

> > > Index: linux-2.6.21-rc2-mm2/kernel/power/user.c
> > > ===================================================================
> > > --- linux-2.6.21-rc2-mm2.orig/kernel/power/user.c
> > > +++ linux-2.6.21-rc2-mm2/kernel/power/user.c
> > > @@ -398,9 +398,9 @@ static int snapshot_ioctl(struct inode *
> > >
> > > case PMOPS_ENTER:
> > > if (data->platform_suspend) {
> > > + disable_nonboot_cpus();
> > > kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
> > > error = pm_ops->enter(PM_SUSPEND_DISK);
> > > - error = 0;
> > > }
> > > break;
> >
> > Foe an userland application, disabling cpus during pmops_enter is at
> > least surprising.......
>
> Yes, but this is not a usual ioctl(). OTOH, we can call enable_nonboot_cpus()
> if pm_ops->enter(PM_SUSPEND_DISK) returns an error (otherwise it souldn't
> return at all, no?).

Ok.
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/