On Thursday, 30 November 2006 13:53, Stefan Seyfried wrote:
> On Thu, Nov 30, 2006 at 10:53:56AM +0100, Tim Dijkstra wrote:
>  
> > So by checking errno we can distinguish 'to old
> > kernel' from 'real error'?
> 
> Yes, i think so. I have not checked all the possible cases where the
> error return value is set, but i think it cannot return -ENOTTY other
> than for this case:
> 
>       if (_IOC_TYPE(cmd) != SNAPSHOT_IOC_MAGIC)
>               return -ENOTTY;
>       if (_IOC_NR(cmd) > SNAPSHOT_IOC_MAXNR)
>               return -ENOTTY;
> 
> so if we check for ENOTTY, we should be safe.
> 
> > If that is the case I would suggest
> > silently falling back to shutdown for 'to old kernel'.
> 
> I still would print
> 
> suspend: falling back to shutdown mode.
> 
> so if you get a bugreport you can see that it did that, but the message
> is not really scary.
> 
> > BTW, what is the first kernel with the correct code? It's not in
> > 2.16.18, is it? Ah, I see they just released 2.6.19, is it in there?
> 
> I think it is (i pushed it through Andrew), but i have not checked it.
> "grep SNAPSHOT_PMOPS kernel/power/power.h" should tell you :-)

I'm afraid it's still an -mm-only thing.

Moreover, this approach may turn out to be incorrect, because it seems
we should call platform_finish() before the resuming of devices (but still
after enable_nonboot_cpus()).  In which case we should call platform_finish()
as a part of atomic snapshot/atomic restore.

I'm now thinking we'll need something like a "platform_start" ioctl that will
tell the kernel the platform mode is to be used and a "finish_suspend" ioctl
that will make it either enter the S4 or power off the system (depending
on whether "platform_start" has been used before).

Greetings,
Rafael


-- 
You never change things by fighting the existing reality.
                R. Buckminster Fuller


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