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.
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.
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?
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
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?
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...