This adds a new pm_message_t event type to use when preparing to switch into a swsusp snapshot. Devices that have been initialized by Linux after resume (rather than left in power-up-reset state) may need to be reset; this new event type gives drivers the chance to do that. The drivers that will care about this are those which understand more hardware states than just "on" and "reset", and read the hardware state during resume(). Hardware state during resume() should be either the state left by the preceding suspend(), or a power-lost reset. When the swsusp freeze/thaw mechanism kicks in, a troublesome third state could exist: one state set up by a different kernel instance, before a snapshot image is resumed. This mechanism helps eliminate that state. (In particular, without the mechanism provided by this patch series, USB host controller drivers which are statically linked will misbehave badly during swsusp resume, since swsusp now forces those controllers into that bogus third state.) --- include/linux/pm.h | 64 +++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 48 insertions(+), 16 deletions(-)