Hibenate/Sleep
Suspend to Disk(STD) - Hibernate
Suspend to RAM(STR) - Sleep
Standby is a special case of Sleep, it is in simple sleep.
Wakeup is restore system, no matter from Hibernate/Sleep/Standby.
Hibernate will shutdown all the power of system, so must reset Power button to wakeup system.
Sleep will keep RAM in power at least, others something like Mouse/Keyboard, so touch those device can trigger the wakeup procedure.
The device we used for wakeup is called Wakeup Source.
There are 3 layer: API Layer/PM core/PM Driver
/sys/power/state: freeze/mem/disk
freeze: freeze all processes in system include user process and kernel thread, it does not change any Hardware.
standby: simple sleep state
mem: STR(sleep)
disk: STD(hibernate)
/sys/power/pm_trace: CONFIG_PM_TRACE
/sys/power/pm_test: none/core/processors/platform/devices/freezer
its use controlled by CONFIG_PM_DEBUG and the function is suspend_test.
enter_state: suspend_test(TEST_FREEZER);
suspend_devices_and_enter: suspend_test(TEST_DEVICES);
suspend_enter: suspend_test(TEST_PLATFORM);
suspend_test(TEST_CPUS);
suspend_test(TEST_CORE);
/sys/power/wakeup_count:
when system in sleep state, produce a wakeup event then should wake up system.
when system entering into sleep state, produce a wakeup event then should stop the sleep procedure.
/sys/power/disk: shutdown/reboot/suspend
shutdown: through shutdown system to implement the STD, and kernel will call kernel_power_off interface.
reboot: through reboot system to implement the STD, and kernel will call kernel_restart interface.
suspend: through STR function to implement the STD function.
/sys/power/image_size: special for STD. this interface is used for setting or getting how many space needed in memory, which used for buffer data into disk, in byte unit.
/sys/power/reserved_size: special for STD. reserved space in memory.
/sys/power/resume: special for STD. in normal case, when restart the kernel will load the image in disk and restore the system. but the interface supply a method for loading image and restoring system in user space.
/sys/snapshot: special for STD. by character device form supply STD operation in userspace.
Suspend to Disk(STD) - Hibernate
Suspend to RAM(STR) - Sleep
Standby is a special case of Sleep, it is in simple sleep.
Wakeup is restore system, no matter from Hibernate/Sleep/Standby.
Hibernate will shutdown all the power of system, so must reset Power button to wakeup system.
Sleep will keep RAM in power at least, others something like Mouse/Keyboard, so touch those device can trigger the wakeup procedure.
The device we used for wakeup is called Wakeup Source.
There are 3 layer: API Layer/PM core/PM Driver
/sys/power/state: freeze/mem/disk
freeze: freeze all processes in system include user process and kernel thread, it does not change any Hardware.
standby: simple sleep state
mem: STR(sleep)
disk: STD(hibernate)
/sys/power/pm_trace: CONFIG_PM_TRACE
/sys/power/pm_test: none/core/processors/platform/devices/freezer
its use controlled by CONFIG_PM_DEBUG and the function is suspend_test.
enter_state: suspend_test(TEST_FREEZER);
suspend_devices_and_enter: suspend_test(TEST_DEVICES);
suspend_enter: suspend_test(TEST_PLATFORM);
suspend_test(TEST_CPUS);
suspend_test(TEST_CORE);
/sys/power/wakeup_count:
when system in sleep state, produce a wakeup event then should wake up system.
when system entering into sleep state, produce a wakeup event then should stop the sleep procedure.
/sys/power/disk: shutdown/reboot/suspend
shutdown: through shutdown system to implement the STD, and kernel will call kernel_power_off interface.
reboot: through reboot system to implement the STD, and kernel will call kernel_restart interface.
suspend: through STR function to implement the STD function.
/sys/power/image_size: special for STD. this interface is used for setting or getting how many space needed in memory, which used for buffer data into disk, in byte unit.
/sys/power/reserved_size: special for STD. reserved space in memory.
/sys/power/resume: special for STD. in normal case, when restart the kernel will load the image in disk and restore the system. but the interface supply a method for loading image and restoring system in user space.
/sys/snapshot: special for STD. by character device form supply STD operation in userspace.