On Thu, 2004-11-04 at 01:22 +0100, Pavel Machek wrote: > Hi! > > > > We probably want to provide a global function saying something like > > > suspend_in_progress() too, just in case a driver want to WARN/BUG_ON, or > > > actually test if it can do something without having to track the > > > pre-suspend and post-resume events. > > > > yes, better that than defining lots of flags on PM messages > > (which was the previous notion) > > Ugh, no, flags should stay. suspend_in_progress() should be used for > BUG_ON()'s etc, but little else. Drivers should not decide based on > it. Not as flags, though. As events yes, so drivers just don't put them in their switch/case and all is well. Flags is really for ... flags, that is additional low level details that drivers don't normally have to care about at all. I agree with David, abuse of flags is evil, so let's not start doing it already > like if kmalloc is alocating with GFP_KERNEL, it should do > BUG_ON(in_suspend())... No... You may have other parts of the kernel possibly doing it, if they block I don't mind. Remember I'm not intendng on putting processes in the fridge on ppc :) > [Hmm, and in_suspend() is probably better name, consistent with > in_atomic() and in_interrupt().] Yah. Ben.