I'm trying to build an embedded linux system based on an Atmel AT91SAM9G25 SoC (ARM9 @ 400Mhz) CPU. I'm using the AT91Bootstrap bootloader.

As the subject of my post suggests, I have an issue with resume from hibernation functionality. Suspend to disk process seems to work fine, but upon waking up, the system doesn't restore previous session.

The issue I’m facing in detail is as follows:

I have built a linux image for my system using buildroot and I have activated/configured accordingly the following kernel parameters:

Power management options --> Suspend to RAM and standby

Power management options --> Hibernation & Default resume partition /dev/mmcblk0p3

(The kernel version I'm using is 4.0.4 and /dev/mmcblk0p3 is the swap partition of the sdcard.)

When I booted the system for the first time, I noticed that the swap partition didn’t mount automatically. I managed to mount the swap partition manually with mkswap /dev/mmcblk0p3 and swapon -a commands. I also inserted the corresponding line to the fstab file:

/dev/mmcblk0p3  none            swap    sw              0       0

After rebooting, I could not find any swap partition mounted. To address this issue I included the mentioned mkswap and swapon commands to the inittab file. After reboot, swap partition was successfully mounted on startup.

With the swap partition mounted, I’m requesting the system to hibernate (suspend to disk). The suspend process seems to work as expected.

The problem starts when I reconnect the power. Although the system seems to understand that it woke up from a suspend state, it doesn’t restore the previous session. It’s like performing a cold boot.

Suspend to memory is working fine. I can put the system into sleep with rtcwake -s20 -m mem and when it wakes up previous session is restored succesfully. Therefore, I assume that something goes wrong with the swap partition, but I've run out of ideas.

I've tried to hibernate the system using the following commands:

rtcwake -s20 -m disk
echo shutdown > /sys/power/disk
echo disk > /sys/power/state

but all of them fail as described above.

Some useful dmesg and console outputs can be found here

Any suggestions or ideas of what I might be doing wrong?

  • What do you have in /etc/fstab? – jimmij Apr 22 '16 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.