Hi,
On Wed, Sep 13, 2006 at 10:47:22PM +0200, Rafael J. Wysocki wrote:
> > From: Stefan Seyfried <[EMAIL PROTECTED]>
> >
> > diff --exclude='.*' --exclude='*o' -ruNp
> > /usr/src/linux/kernel/power/power.h linux-2.6.18-rc6-2/kernel/power/power.h
> > --- /usr/src/linux/kernel/power/power.h 2006-09-08 19:02:33.000000000
> > +0200
> > +++ linux-2.6.18-rc6-2/kernel/power/power.h 2006-09-12 17:45:33.000000000
> > +0200
> > @@ -78,7 +78,12 @@ int snapshot_image_loaded(struct snapsho
> > #define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9)
> > #define SNAPSHOT_SET_SWAP_FILE _IOW(SNAPSHOT_IOC_MAGIC, 10,
> > unsigned int)
> > #define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11)
> > -#define SNAPSHOT_IOC_MAXNR 11
> > +#define SNAPSHOT_PMOPS _IOW(SNAPSHOT_IOC_MAGIC, 12,
> > unsigned int)
> > +#define SNAPSHOT_IOC_MAXNR 12
> > +
BTW: this is one of the parts i am most unsure about:
> > +#define PMOPS_PREPARE 1
> > +#define PMOPS_ENTER 2
> > +#define PMOPS_FINISH 3
maybe an enum would be better? I have no idea.
> > + case SNAPSHOT_PMOPS:
> > + switch (arg) {
> > + }
> > + break;
> > +
> > default:
> > error = -ENOTTY;
>
> The kernel part looks pretty clean to me. I think we can try to push it
> upstream, but the interface change needs to be documented and we'll also have
> to prepare some uswsusp documentation for Documentation/ABI/ along with it.
The interface change is also just an addition and backwards compatible,
means: old versions of suspend will still work on newer kernels, and in newer
versions i would put a "power_off()" after the PMOPS_ENTER ioctl anyway as a
safety net, should the pmops call fail.
> I can take care of that, but only after I sort out some more urgent stuff.
Ok. Since i am not really know what i am doing here, i was hesitant to write
documentation that was likely to be wrong.
> > Index: suspend.c
> > ===================================================================
> > RCS file: /cvsroot/suspend/suspend/suspend.c,v
> > retrieving revision 1.48
> > diff -u -p -r1.48 suspend.c
> > --- suspend.c 23 Jul 2006 11:32:52 -0000 1.48
> > +++ suspend.c 12 Sep 2006 16:56:48 -0000
> > @@ -636,9 +636,10 @@ static int reset_signature(int fd)
> > }
> > #endif
> >
> > -static void suspend_shutdown(void)
> > +static void suspend_shutdown(int dev)
> > {
> > - power_off();
> > + // power_off();
> > + ioctl(dev, SNAPSHOT_PMOPS, PMOPS_ENTER);
>
> Can we have a wrapper around this? So that we don't need to repeat
> SNAPSHOT_PMOPS every time?
Of course. This was only a proof of concept. A configuration parameter etc.
will of course be necessary (and probably pretty trivial to add, i will take
a look at this).
It was finally time i started looking not only at s2ram.c and whitelist.c :-)
BTW: with proper "platform" method usage, the "kacpid goes wild after resume"
issue has not reappeared for me.
Thanks for reviewing.
--
Stefan Seyfried \ "I didn't want to write for pay. I
QA / R&D Team Mobile Devices \ wanted to be paid for what I write."
SUSE LINUX Products GmbH, Nürnberg \ -- Leonard Cohen
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Suspend-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/suspend-devel