Hi, On Sunday, 22 April 2007 15:00, Pavel Machek wrote: > Hi! > > > > Index: linux-2.6.21-rc6-mm1/Documentation/power/suspend-notifiers.txt > > =================================================================== > > --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > > +++ linux-2.6.21-rc6-mm1/Documentation/power/suspend-notifiers.txt 2007-04-21 23:24:50.000000000 +0200 > > @@ -0,0 +1,41 @@ > > +Suspend notifiers > > + (C) 2007 Rafael J. Wysocki <rjw@xxxxxxx>, GPL > > + > > +There are some operations that device drivers may want to carry out in their > > +.suspend() routines, but shouldn't, because they can cause a suspend to fail. > > +For example, a driver may want to allocate a substantial amount of memory > > +(like 50 MB) in .suspend(), but that shouldn't be done after the swsusp's memory > > +shrinker has run. Also, there may be some operations, that subsystems may want > > +to carry out before a suspend or after a resume, requiring the system to be > > +fully functional, so the drivers' .suspend() and .resume() routines are not > > +suitable for this purpose. > > + > > +The subsystems that have such needs can register suspend notifiers that will be > > +notified of the following events by the suspend core: > > + > > +SUSPEND_PREPARE the system is going to suspend, tasks will be frozen > > + immediately > > + > > +SUSPEND_ENTER_PREPARE tasks have been frozen, memory is going to be freed > > + and devices are going to be suspended > > + > > +SUSPEND_THAW_PREPARE devices have been resumed, tasks will be thawed > > + immediately > > + > > +SUSPEND_FINISHED the resume is complete, the system is fully functional > > + This hook is called even if suspend fails, so that we do not > + leak memory. > > > ? Yes, I'll add something like this. _______________________________________________ linux-pm mailing list linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/linux-pm