On Tue, 27 Dec 2005, Dmitry Torokhov wrote: > Hmm, I am confused. What should ->resume() method do when it fails to > resume a device? I would say kill it, espacially if it is bus-generic > method. How else would we clean up after removed devices? And here we > have a problem because swsuspend likes to resume all devices before > writing the image and drivers don't rellay know if they are woken up > for real or just to complete suspend transition. If resume fails to resume a device, it should return a negative error code. It should not try to unregister the device; that action belongs to a different pathway. Cleaning up after removed devices should be handled the same way as we already do it -- that is, totally separate from suspend/resume. As for swsuspend resuming devices in order to write the image... I don't know how it currently handles a resume failure. Offhand it's not clear what could be done about a failure anyway. Probably resume failures at this point should simply be ignored. Alan Stern