Hibernation and resume on ARM

326 Views Asked by At

Problem: Linux can successfully hibernate to swap partition (/dev/mmcblk0p11) by echo disk > /sys/power/state, but can not resume from this partition.

  • Linux version: 4.9.110
  • storage: EMMC
  • Kernel CMD line: console=ttyS0 root=/dev/mmcblk0p10 rw rootfstype=ext4 rootwait init=/linuxrc resume=/dev/mmcblk0p11 no_console_suspend

/dev/mmcblk0p9: UUID="b744d4f3-df1c-4b90-a0da-919f4396d529" TYPE="ext4" /dev/mmcblk0p10: UUID="cf79a362-220f-42fc-8078-01d7777fda99" TYPE="ext4" /dev/mmcblk0p11: UUID="5686ee03-1120-4454-9c52-fa603adfeee5" TYPE="swap" /dev/mmcblk0p12: UUID="a435d0a3-7ec3-4b83-b4c1-6468399eda6d" TYPE="ext4" /dev/mmcblk0p13: UUID="52d53a11-af79-49c3-a2bf-1161f242f858" TYPE="ext4" /dev/mmcblk0p14: UUID="00a957a1-4463-4723-98a8-9e075611c670" TYPE="ext4"

The reason seems like PM can not found the /dev/mmcblk0p11 when system booting. The booting logs:

  1. [ 0.899349] ==>PM: software_resume
  2. [ 0.902921] ==>PM: Checking hibernation image partition /dev/mmcblk0p11
  3. [ 0.909827] ==>DM: /home/tekdev/tsdk- s5l/s5l_linux_sdk/ambarella/kernel/linux-4.9/init/do_mounts.c 217, /dev/mmcblk0p11
  4. [ 0.921074] ==>DM: fail to found mmcblk0p11
  5. [ 0.925472] ==>PM: software_resume 853, /dev/mmcblk0p11
  6. [ 0.930939] ==>DM: kernel/linux-4.9/init/do_mounts.c 217, /dev/mmcblk0p11
  7. [ 0.942177] ==>DM: fail to found mmcblk0p11
  8. [ 0.946558] ==>PM: software_resume 869
  9. [ 0.950487] PM: Hibernation image not present or could not be loaded.
  10. [ 0.957535] ==>DM: kernel/linux-4.9/init/do_mounts.c 217, /dev/mmcblk0p10
  11. [ 0.968795] ==>DM: fail to found mmcblk0p10
  12. [ 0.973188] --> kernel/linux-4.9/init/do_mounts_initrd.c initrd_load 121
  13. [ 0.984341] --> kernel/linux-4.9/init/do_mounts_initrd.c initrd_load 123
  14. [ 0.995556] Waiting for root device /dev/mmcblk0p10...
  15. [ 1.000971] ==>DM: kernel/linux-4.9/init/do_mounts.c 217, /dev/mmcblk0p10
  16. [ 1.012220] ==>DM: fail to found mmcblk0p10
  17. [ 1.016610] ==>wait root dev...
  18. [ 1.033183] random: fast init done
  19. [ 1.125418] ==>DM: kernel/linux-4.9/init/do_mounts.c 217, /dev/mmcblk0p10
  20. [ 1.136657] ==>DM: fail to found mmcblk0p10
  21. [ 1.141038] ==>wait root dev...
  22. [ 1.195807] mmc0: new HS200 MMC card at address 0001
  23. [ 1.202359] mmcblk0: mmc0:0001 H8G1e 7.28 GiB
  24. [ 1.208214] mmcblk0boot0: mmc0:0001 H8G1e partition 1 4.00 MiB
  25. [ 1.215503] mmcblk0boot1: mmc0:0001 H8G1e partition 2 4.00 MiB
  26. [ 1.222778] mmcblk0rpmb: mmc0:0001 H8G1e partition 3 4.00 MiB
  27. [ 1.231753] mmcblk0: bst bld ptb atf pba pri sec bak rom lnx swp add adc raw
  28. [ 1.245428] ==>DM: kernel/linux-4.9/init/do_mounts.c 217, /dev/mmcblk0p10
  29. [ 1.256644] ==>DM: sucess found mmcblk0p10

What I found is that the mmc has not ready when PM try to resume. PM try to resume at line 2, but mmc start init at line 22.

What I did for trying to fix it.
1. add resumewait to Kernel CMD line, the result is kernel will endless wait mmcblk0p11 ready.

0

There are 0 best solutions below