Re: [PATCH] swsusp: allow drivers to determine between write-resume and actual wakeup

Pavel Machek
2006-06-05T09:24:46Z

On Po 05-06-06 18:11:31, Tejun Heo wrote:
> Currently, there is no way to tell whether a device is resuming to
> write swsusp image or waking up from actual software suspend. FREEZE
> and SUSPEND are different operations for some devices (e.g. disks
> don't spin down for FREEZE) and the resume operation for each is also
> different.
>
> This patch makes swsusp change device power state from PMSG_FREEZE to
> PMSG_SUSPEND on resume from software suspend. A driver can determine
> whether it's getting thawed or resuming by looking at device power
> state - if FREEZE, it's getting thawed to write image; if SUSPEND,
> resuming from software suspend. This patch doesn't affect drivers
> which don't update device power state. Only drivers which set power
> state to FREEZE after freezing are affected.

No, sorry.

If driver is interested if previous operation was FREEZE or
SUSPEND... just store that information locally.

If you want to know if you RESUME was after normal FREEZE or if it is
after reboot, there's better patch floating around to do that.