Re: ACPI code in platform mode hibernation code paths (was: Re: [PATCH] swsusp: do not use pm_ops)

2007-05-04 Thread Rafael J. Wysocki
Hi, On Friday, 4 May 2007 14:08, Pavel Machek wrote: > Hi! > > > > Crazy idea... could we kill hibernate_ops-like struct, and just create > > > a device for ACPI, using its suspend()/resume()/whatever callbacks to > > > do the ACPI magic? > > > > Doesn't that have the ordering problem again? You

Re: ACPI code in platform mode hibernation code paths (was: Re: [PATCH] swsusp: do not use pm_ops)

2007-05-04 Thread Pavel Machek
Hi! > > Crazy idea... could we kill hibernate_ops-like struct, and just create > > a device for ACPI, using its suspend()/resume()/whatever callbacks to > > do the ACPI magic? > > Doesn't that have the ordering problem again? You must ensure that this > sysdev is suspended as the last one, and th

Re: ACPI code in platform mode hibernation code paths (was: Re: [PATCH] swsusp: do not use pm_ops)

2007-05-04 Thread Johannes Berg
On Fri, 2007-05-04 at 00:48 +0200, Pavel Machek wrote: > Crazy idea... could we kill hibernate_ops-like struct, and just create > a device for ACPI, using its suspend()/resume()/whatever callbacks to > do the ACPI magic? Doesn't that have the ordering problem again? You must ensure that this sysd

Re: ACPI code in platform mode hibernation code paths (was: Re: [PATCH] swsusp: do not use pm_ops)

2007-05-03 Thread Rafael J. Wysocki
Hi, On Friday, 4 May 2007 00:48, Pavel Machek wrote: > Hi! > > Crazy idea... could we kill hibernate_ops-like struct, and just create > a device for ACPI, using its suspend()/resume()/whatever callbacks to > do the ACPI magic? Hmm, I didn't think about that. It seems to be viable at first sight

Re: ACPI code in platform mode hibernation code paths (was: Re: [PATCH] swsusp: do not use pm_ops)

2007-05-03 Thread Pavel Machek
Hi! Crazy idea... could we kill hibernate_ops-like struct, and just create a device for ACPI, using its suspend()/resume()/whatever callbacks to do the ACPI magic? > Okay. Since we're trying to separate the hibernation code from the > suspend code anyway, we can use the opportunity to introduce

Re: [PATCH] swsusp: Do not use pm_ops

2007-05-03 Thread Rafael J. Wysocki
On Thursday, 3 May 2007 14:13, Johannes Berg wrote: > On Wed, 2007-05-02 at 22:13 +0200, Rafael J. Wysocki wrote: > > > +extern inline int hibernate(void) { return -ENOSYS; } > > and I don't think that will compile :) It will, but this is a mistake. It should be 'static', not 'extern'. Will f

Re: [PATCH] swsusp: Do not use pm_ops

2007-05-03 Thread Rafael J. Wysocki
On Thursday, 3 May 2007 14:12, Johannes Berg wrote: > On Wed, 2007-05-02 at 22:13 +0200, Rafael J. Wysocki wrote: > > > extern void swsusp_unset_page_free(struct page *); > > extern unsigned long get_safe_page(gfp_t gfp_mask); > > > +void hibernation_set_ops(struct hibernation_ops *ops); > > >

Re: [PATCH] swsusp: Do not use pm_ops

2007-05-03 Thread Johannes Berg
On Wed, 2007-05-02 at 22:13 +0200, Rafael J. Wysocki wrote: > +extern inline int hibernate(void) { return -ENOSYS; } and I don't think that will compile :) (the extern doesn't seem to be consistent right now anyway. maybe just kill them all?) johannes signature.asc Description: This is a digi

Re: [PATCH] swsusp: Do not use pm_ops

2007-05-03 Thread Johannes Berg
On Wed, 2007-05-02 at 22:13 +0200, Rafael J. Wysocki wrote: > extern void swsusp_unset_page_free(struct page *); > extern unsigned long get_safe_page(gfp_t gfp_mask); > +void hibernation_set_ops(struct hibernation_ops *ops); > +extern int hibernate(void); You could add an extern to hibernatio

Re: [PATCH] swsusp: Do not use pm_ops

2007-05-03 Thread Nigel Cunningham
Hi. Sorry for my quietness. Looks pretty straightforward to me :) Nigel signature.asc Description: This is a digitally signed message part

Re: [PATCH] swsusp: Do not use pm_ops

2007-05-03 Thread Rafael J. Wysocki
On Thursday, 3 May 2007 12:11, Pavel Machek wrote: > On Thu 2007-05-03 11:46:02, Rafael J. Wysocki wrote: > > On Thursday, 3 May 2007 10:41, Johannes Berg wrote: > > > On Wed, 2007-05-02 at 22:13 +0200, Rafael J. Wysocki wrote: > > > > > > > +void hibernation_set_ops(struct hibernation_ops *ops) >

Re: [PATCH] swsusp: Do not use pm_ops

2007-05-03 Thread Pavel Machek
On Thu 2007-05-03 11:46:02, Rafael J. Wysocki wrote: > On Thursday, 3 May 2007 10:41, Johannes Berg wrote: > > On Wed, 2007-05-02 at 22:13 +0200, Rafael J. Wysocki wrote: > > > > > +void hibernation_set_ops(struct hibernation_ops *ops) > > > +{ > > > + if (ops && !(ops->prepare && ops->enter && op

Re: [PATCH] swsusp: Do not use pm_ops

2007-05-03 Thread Rafael J. Wysocki
On Thursday, 3 May 2007 11:45, Johannes Berg wrote: > On Thu, 2007-05-03 at 11:46 +0200, Rafael J. Wysocki wrote: > > > Well, BUG_ON() is extremely user-unfriendly, and it'd trigger even if the > > user > > actually didn't intend to suspend at all. > > Well, hibernation_set_ops is invoked whenev

Re: [PATCH] swsusp: Do not use pm_ops

2007-05-03 Thread Johannes Berg
On Thu, 2007-05-03 at 11:46 +0200, Rafael J. Wysocki wrote: > Well, BUG_ON() is extremely user-unfriendly, and it'd trigger even if the user > actually didn't intend to suspend at all. Well, hibernation_set_ops is invoked whenever the user loads his ACPI module with S4 possible, and typically hav

Re: [PATCH] swsusp: Do not use pm_ops

2007-05-03 Thread Rafael J. Wysocki
On Thursday, 3 May 2007 10:41, Johannes Berg wrote: > On Wed, 2007-05-02 at 22:13 +0200, Rafael J. Wysocki wrote: > > > +void hibernation_set_ops(struct hibernation_ops *ops) > > +{ > > + if (ops && !(ops->prepare && ops->enter && ops->finish)) { > > + printk(KERN_ERR "Wrong definition

Re: [PATCH] swsusp: Do not use pm_ops

2007-05-03 Thread Johannes Berg
On Wed, 2007-05-02 at 22:13 +0200, Rafael J. Wysocki wrote: > +void hibernation_set_ops(struct hibernation_ops *ops) > +{ > + if (ops && !(ops->prepare && ops->enter && ops->finish)) { > + printk(KERN_ERR "Wrong definition of hibernation operations! " > + "Using

[PATCH] swsusp: Do not use pm_ops

2007-05-02 Thread Rafael J. Wysocki
From: Rafael J. Wysocki <[EMAIL PROTECTED]>, Johannes Berg <[EMAIL PROTECTED]> Separate the hibernation (aka suspend to disk code) from the other suspend code. In particular: * remove the definition related to hibernation (aka suspend to disk) from include/linux/pm.h * introduce struct hibern

ACPI code in platform mode hibernation code paths (was: Re: [PATCH] swsusp: do not use pm_ops)

2007-05-02 Thread Rafael J. Wysocki
Hi, [Added linux-acpi to the CC list, should be there from the start] On Wednesday, 2 May 2007 16:11, Alexey Starikovskiy wrote: > Rafael, > > > Concluding, it seems to me that the "restore" code path is correct, but the > > "hibernate" code path is not and should be reworked. Also, it seems th