It's the demo for hibernation for Android. Restore Android and UI can operate about 6 sec.
I‘m interesting on this topic, are you trying the hibernation on i.mx6 saresd board? As far as i know, FSL has not provided such patches, isn't it?
thanks for your response
The hibernation solution is not public. The demo is to show i.MX6 able to work for hibernation. It needs software service to share the patches in current stage.
Recently I want to hibernate on I.MX6Q ,the environment is linux 3.0.35 and android4.3,but I have some problem,I hope you can help me.
（1）I use " tuxonice patch + TI's patch" to hibernate ,I can resume from linux system,everything looks like nice,but when I resume from Android system,I find that the display is abnormal，I can recover display when switchover the other APP a few time and then come back to home screen.then I add the suspend code in mxc_ipu3_fb.c like this：mxcfb_set_par/mxcfb_blank/fb_set_var/fb_blank,but It all don't work.Could you give me some idea to solve this problem?
（2）We want to fastboot the Android system like your video(I think you must boot image from uboot directly),and I use the patch which come from TI‘s snapshot，but the image fomat is different，and it is difficult to understand the image format of tuxonice,Could you tell me how you fastboot in 5s ? Is "snapshot + tuxonice" or "snapshot + swsusp" or "kernel+tuxonice" or "kernel+swsusp" or something others?
I really hope you can help me，If for confidentiality reasons，I still will very happy you just give me a direction.
1. Screen is abnormal is because texture used in GPU is not restored. I also didn't want restore it since it is temporary data. By making Android to repaint, GPU got new data to compose and screen is back to normal.
2. Simply speaking, we used the pure kernel suspend, let the time consuming driver initialization delayed to do after Android is restored, .., etc. We don't have one solution to boot quickly but combining several ways.
Thanks,I will according to your reply to solve the problem.
Recently,I have two more question about fastboot in imx6.I think you maybe encounter the same problem in fastboot.
the first question is about the ext2 filesystem,My system is "uboot+kernel+ext2(android)",when I boot the system normally,
I find the error log in my console and the log is "EXT2-fs (mmcblk0p4): error: ext2_lookup: deleted inode referenced: 243948",
I hibernate and resume the system and then set up the system font from the Settings App of android system,the log is as follows:
<4>[ 1104.187293] ------------[ cut here ]------------
<4>[ 1104.187308] WARNING: at fs/inode.c:901 unlock_new_inode+0x2c/0x54()
<4>[ 1104.187315] Modules linked in:
<4>[ 1104.187334] [<c005429c>] (unwind_backtrace+0x0/0x11c) from [<c008a508>] (warn_slowpath_common+0x4c/0x64)
<4>[ 1104.187351] [<c008a508>] (warn_slowpath_common+0x4c/0x64) from [<c008a538>] (warn_slowpath_null+0x18/0x1c)
<4>[ 1104.187367] [<c008a538>] (warn_slowpath_null+0x18/0x1c) from [<c014caa4>] (unlock_new_inode+0x2c/0x54)
<4>[ 1104.187385] [<c014caa4>] (unlock_new_inode+0x2c/0x54) from [<c01c2c5c>] (ext2_new_inode+0x8ec/0x938)
<4>[ 1104.187401] [<c01c2c5c>] (ext2_new_inode+0x8ec/0x938) from [<c01c4fc0>] (ext2_create+0x14/0xc8)
<4>[ 1104.187418] [<c01c4fc0>] (ext2_create+0x14/0xc8) from [<c01428fc>] (vfs_create+0x74/0xa0)
<4>[ 1104.187434] [<c01428fc>] (vfs_create+0x74/0xa0) from [<c01443b4>] (do_last.isra.32+0x30c/0x67c)
<4>[ 1104.187451] [<c01443b4>] (do_last.isra.32+0x30c/0x67c) from [<c01448e8>] (path_openat+0xb4/0x35c)
<4>[ 1104.187466] [<c01448e8>] (path_openat+0xb4/0x35c) from [<c0144c64>] (do_filp_open+0x2c/0x78)
<4>[ 1104.187484] [<c0144c64>] (do_filp_open+0x2c/0x78) from [<c0137914>] (do_sys_open+0xd8/0x170)
<4>[ 1104.187502] [<c0137914>] (do_sys_open+0xd8/0x170) from [<c004d100>] (ret_fast_syscall+0x0/0x30)
<4>[ 1104.187512] ---[ end trace 2bec2812a8117875 ]---
<3>[ 1104.187537] init: Unable to write persistent property to temp file /data/property/.temp.fNuoK1 errno: 22
This means that I fail to set the system font,I don't know how to solve this problem.
the second question is about the inconsistency problem,I resume the system and configure the system(write param to sd),then I poweroff and resume the system again, I find that configure is invaild,I don't know how to refresh the system,could you give me a hand?
Hibernation requires user create the hibernation image each time. The hibernation image stores memory information and can restore system then. File system has the inode and the related information also in the memory so it will be stored with hibernation images. This is good for most of PC, NB. But it is not practical for most embedded system. We would like to create hibernation image once and always restore system from the image. It's so call Single Image mode. On my approach, I tried to use ram disk as Android System partition. The ram disk will be part of hibernation and then we can restore from system using the same image every time.
The idea behind also applied to your second question.
If we use ramdisk for our system,how can we save the configuration file?Whether you unmount the ex2（the configuration file partition）when hibernate and then mount the ext2 when resume.
Hard to have the general solution for these two situation. If you want single image mode, save your configuration to other partition and restored it after system is recovered.
I am working on hibernation for kitkat android on imx6q sabre sd board. Whenever I am using normal hibernation mode, I can resume and the system runs smoothly. But as you mentioned, I am using it for embedded application. So I want to use Single Image Mode. As you mentioned that, you got the single image mode of hibernation working on iMX6. You mentioned to use RamDisk as Android System partition. Can you please help me with how to do this? How can I make Android System partition to use Ramdisk?
Any help in this matter is highly appreciated.
How do you use the normal hibernation mode? What partition do you use for storing the image? When I add 'resume=....' parameter to the kernel cmd line I get filesystem errors...
Can you, please, explain how to use Single image mode? How can I configure the system to use ram disk as Android System partition?
can you tell me the link about" tuxonice patch + TI's patch" that you used.
Thanks for your help.Your answer is very helpful to me.Recetly I've been testing the stability of the Android fastboot.
I have test about 140 times.There are 2 times of failure when resume the system.The error log tell us that the system has an error return value when reading the image.
Then,I have test about 140 times again，I got 2 times of failure again,the system boot from normal partition.
Have you ever test the stability of your system? Do you have a fastboot failure problem?
Can you check why you got the fail? Hibernation image corrupted or reading it from storage failed at some blocks?
I have 4 times of failure,the first error log is：
[ 4.574402] Post atomic.
[ 4.577031] Reading caches...
[ 4.586679] mmc0: Starting deferred resume
[ 4.715160] mmc0: Deferred resume completed
[ 5.361662] ...20%
[ 5.524033] Kernel panic - not syncing: Read chunk returned (-22)
【panic，sucess to resume the system after reboot,not erase the swap parttion(fastboot partition)】
the second error log is：
[ 3.361234] Freezing remaining freezable tasks ... (elapsed 0.02 seconds) done.
[ 3.398002] Reading kernel & process data...
[ 3.637218] ...20%...40%
[ 3.907248] Breaking out of I/O loop because of result code -22.
[ 3.914276] ...60%...80%
[ 4.045383] Waited for i/o due to readahead not ready 61 times.
[ 4.051422] Waited for i/o due to synchronous I/O 3 times.
[ 4.056994] Waited for i/o due to throughput_throttle 19 times.
[ 4.063031] Failed to read pageset 1.
[ 4.066766] Restarting all filesystems .
【boot from normal partition(the real android system,not fastboot)，erase the swap partition(fastboot partition)，boot from normal partion again】
Both of the error log is occurred in reading the image file
Are you trying Single image mode or normal hibernation? This looks like mmc has some problems.
I am trying single image mode,have you test your system like that?
yes,I think the mmc has some problems too.when I print some message in corresponding function,the error log seemed to disappear.but the mmc reading speed is from 90MB/s to 35MB/s
No, I haven’t done stress test that time.
Hello Jay Tu,
Need your help on hibernation support on imx6 solo custom board running android JB.
Am trying to implement hibernation on IMX6.
But device is rebooting after this msg "PM: Saving image data pages (100869 pages) ... 45%"
It is not saving 100 % , any help or direction is appreciable.
Thanks & Regards,
Hard to know from the few information. Did you disable watchdog?
Thanks for your reply.
Now it is stop rebooting, but now it is just stuck on swap_pages function & here is the log:
[ 88.008761] PM: Syncing filesystems ...
[ 88.017586] done.
[ 88.025536] PM: Preallocating image memory...
[ 88.415870] done (allocated 122464 pages)
[ 88.420083] PM: Allocated 489856 kbytes in 0.38 seconds (1289.09 MB/s)
[ 88.426633] pm_restrict_gfp_mask 125
[ 88.430300] PM: dpm_suspend start...
[ 88.456311] PM:done
[ 88.480808] PM: Creating hibernation image:
[ 88.694169] PM: Need to copy 121577 pages
[ 91.184024] PM: Hibernation image created (121577 pages copied)
[ 91.221788] PM: writing image.
[ 91.225413] PM: Free swap pages: 524286
The last call chain is like swap_write_page()->write_page()->hib_bio_write_page->submit()->wait_on_page_locked.
The suspecting function is write_page(...) which is call from swap_write_page(...).
There are 3 parameters buf, offset, bio_chain pass to write_page(...) function.
If you provide some info on the same that will be help.
I need some help on hibernation support on i.mx6 custom board.
I applied Suspend-Resume patches but it has kernel panic at swsusp_arch_suspend function.
When PC, LR reassigned to .Lsaved_context_r14_svc, it becomes to NULL address.
Because of my less understanding, I cannot solve this situation. So I need your help.
Can you help me?
If kernel panic, kernel would have core dump. You can get more information there. (What is Suspend-Resume patches?)
I think that the problem is there:
in arm/kernel/hibernation.c write these variables in this mode:
/* Used in hibernate_asm.S */
#define USER_CONTEXT_SIZE (15 * sizeof(u32))
unsigned long saved_spsr_svc;
unsigned long saved_context_r14_svc;
unsigned long saved_context_r13_svc;
unsigned long saved_cpsr;
unsigned long saved_context_r0[USER_CONTEXT_SIZE];
the sequence is VERY IMPORTANT.
I Have a problems before, can you send me your patch?
I am trying to implement the hibernation with static image concept,able to create the hibernation image.
On first resume the boards come up properly, on subsequent boot the emmc partition gets corrupted.
Please find the logs below:
Freezing user space processes ... (elapsed 0.000 seconds) done.
PM: Using 1 thread(s) for decompression.
PM: Loading and decompressing image data (57248 pages) ... 0% 100%
PM: Image loading done.
PM: Read 228992 kbytes in 4.86 seconds (47.11 MB/s)
PM: quiesce of devices complete after 73.305 msecs
PM: late quiesce of devices complete after 0.641 msecs
PM: noirq quiesce of devices complete after 0.733 msecs
Disabling non-boot CPUs ...
Suspended for 0.000 seconds
Enabling non-boot CPUs ...
CPU1 is up
PM: noirq restore of devices complete after 0.435 msecs
PM: early restore of devices complete after 0.599 msecs
PM: restore of devices complete after 209.372 msecs
Restarting tasks ... done.
binder: 390:390 transaction failed 29189, size 100-0
init: cannot find '/system/bin/install-recovery.sh', disabling 'flash_recovery'
root@amit:/ # EXT4-fs error (device mmcblk2p4): ext4_mb_generate_buddy:755: group 18, 31155 clusters in bitmap, 31150 in gd
Aborting journal on device mmcblk2p4-8.
Kernel panic - not syncing: EXT4-fs (device mmcblk2p4): panic forced after error
CPU: 0 PID: 741 Comm: drmserver Not tainted 3.10.53 #27
[<c0013ee8>] (unwind_backtrace+0x0/0xf8) from [<c00118c8>] (show_stack+0x10/0x14)
[<c00118c8>] (show_stack+0x10/0x14) from [<c0013134>] (handle_IPI+0x178/0x1a4)
[<c0013134>] (handle_IPI+0x178/0x1a4) from [<c0008564>] (gic_handle_irq+0x54/0x5c)
[<c0008564>] (gic_handle_irq+0x54/0x5c) from [<c000de7c>] (__irq_usr+0x3c/0x60)
Exception stack(0xdcbc3fb0 to 0xdcbc3ff8)
3fa0: b6ef4455 b68a4371 00000031 00000000
3fc0: b6fc1784 0000003a b6ef04e8 b68a4371 09732af9 b6ef0148 b6ef3c38 000000c9
3fe0: b6ef4775 bea3e450 b6fc6111 b6fc98e8 000d0010 ffffffff
Rebooting in 5 seconds..
Please reply if anyone has faced the similar issue.
The issue is from file system inconsistent as I replied above.
Thanks for your reply i tried putting ramdisk as Android system partition , still get same error:
[ 126.264575] Kernel panic - not syncing: EXT4-fs (device mmcblk0p2): panic forced after error
[ 126.274525] CPU1: stopping
[ 126.277262] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.10.53 #33
[ 126.283393] [<c0013ee8>] (unwind_backtrace+0x0/0xf8) from [<c00118c8>] (show_stack+0x10/0x14)
[ 126.291939] [<c00118c8>] (show_stack+0x10/0x14) from [<c0013134>] (handle_IPI+0x178/0x1a4)
[ 126.300221] [<c0013134>] (handle_IPI+0x178/0x1a4) from [<c0008564>] (gic_handle_irq+0x54/0x5c)
[ 126.308855] [<c0008564>] (gic_handle_irq+0x54/0x5c) from [<c000dcc0>] (__irq_svc+0x40/0x70)
[ 126.317216] Exception stack(0xdc097f60 to 0xdc097fa8)
[ 126.322280] 7f60: dc097fa8 00000000 65bdc9bc 0000001d c181e238 00000001 652495ae 0000001d
[ 126.330470] 7f80: 00000000 412fc09a 00000001 00000000 00000000 dc097fa8 c0070244 c0555760
[ 126.338657] 7fa0: 600f0013 ffffffff
[ 126.342179] [<c000dcc0>] (__irq_svc+0x40/0x70) from [<c0555760>] (cpuidle_enter_state+0x50/0xec)
[ 126.350984] [<c0555760>] (cpuidle_enter_state+0x50/0xec) from [<c05558a4>] (cpuidle_idle_call+0xa8/0x160)
[ 126.360573] [<c05558a4>] (cpuidle_idle_call+0xa8/0x160) from [<c000edb0>] (arch_cpu_idle+0x10/0x48)
[ 126.369644] [<c000edb0>] (arch_cpu_idle+0x10/0x48) from [<c006f41c>] (cpu_startup_entry+0x9c/0x138)
[ 126.378707] [<c006f41c>] (cpu_startup_entry+0x9c/0x138) from [<107ffe84>] (0x107ffe84)
[ 126.389136] Rebooting in 5 seconds..
mmcblk0p2 is data partition.
You should try putting ramdisk as data partition.
I tried putting ramdisk as data partition, no success same error.
Hello! I have the same problem... Did you solve it?
The hibernation solution on i.mx6 is not public. Please contact freescale sales for more detail.
Retrieving data ...