This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to wake up after suspend to disk

Other Parts Discussed in Thread: TPS65910

I follow the instructions in  http://elinux.org/Suspend_To_Disk_For_ARM

download source and remodify kernel

(https://github.com/russdill/linux/commit/49d80fe10f549f83c2b8225e4571b490e506c515)

Here is my step .


1. create a swap partition /dev/mmcblk0p3       

(p1 is u-boot, p2 is filesystem)
/dev/mmcblk0p1   *          63      144584       72261    c  W95 FAT32 (LBA)    
/dev/mmcblk0p2          144585     1269134      562275   83  Linux              
/dev/mmcblk0p3         1269135    15523839     7127352+  82  Linux swap / Solars

2. swap

root@am335x-evm:/media/card# mkswap /dev/mmcblk0p3                             
Setting up swapspace version 1, size = 7298404864 bytes                        
root@am335x-evm:/media/card# swapon /dev/mmcblk0p3                             
[ 2638.347900] Adding 7127348k swap on /dev/mmcblk0p3.  Priority:-1 extents:1 aS
root@am335x-evm:/media/card#

3.set resume in uEnv.txt

root@am335x-evm:/media# cat uEnv.txt                                           
resume=/dev/mmcblk0p3                                                          
root@am335x-evm:/media#

4. suspend to disk

root@am335x-evm:/media# echo disk > /sys/power/state                           
[ 2797.956970] PM: Syncing filesystems ... done.                               
[ 2797.962249] Freezing user space processes ... (elapsed 0.01 seconds) done.  
[ 2797.985748] PM: Preallocating image memory... done (allocated 7286 pages)   
[ 2798.103729] PM: Allocated 29144 kbytes in 0.11 seconds (264.94 MB/s)        
[ 2798.110382] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) do.
[ 2798.136047] Suspending console(s) (use no_console_suspend to debug)         
[ 2798.145355] PM: freeze of devices complete after 2.716 msecs                
[ 2798.145721] PM: late freeze of devices complete after 0.335 msecs           
[ 2798.147216] PM: Creating hibernation image:                                 
[ 2798.248565] PM: Need to copy 7227 pages                                     
[ 2798.498382] PM: Hibernation image created (7227 pages copied)               
[ 2798.500366] PM: early thaw of devices complete after 0.274 msecs            
[ 2798.516387] PM: thaw of devices complete after 15.930 msecs                 
[ 2798.558715] PM: Using 1 thread(s) for compression.                          
[ 2798.558746] PM: Compressing and saving image data (7235 pages) ...   0%     
[ 2798.5893  1%                                                                
[ 2798.6116  2%                                                                
[ 2798.6337  3%                                                                
[ 2798.6659  4%                                                                
[ 2798.6880  5%                                                                
[ 2798.7102  6%                                                                
[................                                               
[ 2800.2537 93%                                                                
[ 2800.2727100%                                                                
[ 2801.4912done                                                                
[ 2801.493560] PM: Wrote 28940 kbytes in 2.92 seconds (9.91 MB/s)              
[ 2802.159545] PM: S                                                           
[ 2802.164916] |                                                               
[ 2802.195098] Suspending console(s) (use no_console_suspend to debug)   

5. after that , the system is suspended, I unplug an plug power.....

but it not work.  it boot normal without resume the suspending system.

U-Boot SPL 2013.04-dirty (Jul 10 2013 - 14:02:53)                               
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)  
musb-hdrc: MHDRC RTL version 2.0                                                
musb-hdrc: setup fifo_mode 4                                                    
musb-hdrc: 28/31 max ep, 16384/16384 memory                                     
USB Peripheral mode controller at 47401000 using PIO, IRQ 0                     
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)  
musb-hdrc: MHDRC RTL version 2.0                                                
musb-hdrc: setup fifo_mode 4                                                    
musb-hdrc: 28/31 max ep, 16384/16384 memory                                     
USB Host mode controller at 47401800 using PIO, IRQ 0                           
OMAP SD/MMC: 0                                                                  
mmc_send_cmd : timeout: No status update                                        
reading u-boot.img                                                              
reading u-boot.img                                                              
                                                                                
                                                                                
U-Boot 2013.04-dirty (Jul 10 2013 - 14:02:53)                                   
                                                                                
I2C:   ready                                                                    
DRAM:  512 MiB                                                                  
WARNING: Caches not enabled                                                     
NAND:  No NAND device found!!!                                                  
0 MiB                                                                           
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1                                           
*** Warning - readenv() failed, using default environment                       
                                                                                
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)  
musb-hdrc: MHDRC RTL version 2.0                                                
musb-hdrc: setup fifo_mode 4                                                    
musb-hdrc: 28/31 max ep, 16384/16384 memory                                     
USB Peripheral mode controller at 47401000 using PIO, IRQ 0                     
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)  
musb-hdrc: MHDRC RTL version 2.0                                                
musb-hdrc: setup fifo_mode 4                                                    
musb-hdrc: 28/31 max ep, 16384/16384 memory                                     
USB Host mode controller at 47401800 using PIO, IRQ 0                           
Net:   <ethaddr> not set. Validating first E-fuse MAC                           
cpsw, usb_ether                                                                 
Hit any key to stop autoboot:  0                                                
gpio: pin 53 (gpio 53) value is 1                                               
mmc0 is current device                                                          
micro SD card found                                                             
mmc0 is current device                                                          
gpio: pin 54 (gpio 54) value is 1                                               
SD/MMC found on device 0                                                        
reading uEnv.txt                                                                
22 bytes read in 10 ms (2 KiB/s)                                                
Loaded environment from uEnv.txt                                                
Importing environment from mmc ...                                              
gpio: pin 55 (gpio 55) value is 1                                               
3152520 bytes read in 377 ms (8 MiB/s)                                          
gpio: pin 56 (gpio 56) value is 1                                               
** File not found /boot/am335x-boneblack.dtb **                                 
Booting from mmc ...                                                            
## Booting kernel from Legacy Image at 80007fc0 ...                             
   Image Name:   Linux-3.2.0-12581-g8ed7d75-dirty                               
   Image Type:   ARM Linux Kernel Image (uncompressed)                          
   Data Size:    3152456 Bytes = 3 MiB                                          
   Load Address: 80008000                                                       
   Entry Point:  80008000                                                       
   Verifying Checksum ... OK                                                    
ERROR: Did not find a cmdline Flattened Device Tree                             
Could not find a valid device tree                                              
U-Boot#                                                                        
U-Boot SPL 2013.01.01 (Jun 25 2013 - 16:42:52)                                  
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO)
musb-hdrc: MHDRC RTL version 2.0                                                
musb-hdrc: setup fifo_mode 4                                                    
musb-hdrc: 28/31 max ep, 16384/16384 memory                                     
USB Peripheral mode controller at 47401000 using PIO, IRQ 0                     
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO)
musb-hdrc: MHDRC RTL version 2.0                                                
musb-hdrc: setup fifo_mode 4                                                    
musb-hdrc: 28/31 max ep, 16384/16384 memory                                     
USB Host mode controller at 47401800 using PIO, IRQ 0                           
OMAP SD/MMC: 0                                                                  
reading u-boot.img                                                              
reading u-boot.img                                                              
                                                                                
                                                                                
U-Boot 2013.01.01 (Jun 25 2013 - 16:42:52)                                      
                                                                                
I2C:   ready                                                                    
DRAM:  512 MiB                                                                  
WARNING: Caches not enabled                                                     
NAND:  No NAND device found!!!                                                  
0 MiB                                                                           
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1                                           
*** Warning - readenv() failed, using default environment                       
                                                                                
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO)
musb-hdrc: MHDRC RTL version 2.0                                                
musb-hdrc: setup fifo_mode 4                                                    
musb-hdrc: 28/31 max ep, 16384/16384 memory                                     
USB Peripheral mode controller at 47401000 using PIO, IRQ 0                     
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO)
musb-hdrc: MHDRC RTL version 2.0                                                
musb-hdrc: setup fifo_mode 4                                                    
musb-hdrc: 28/31 max ep, 16384/16384 memory                                     
USB Host mode controller at 47401800 using PIO, IRQ 0                           
Net:   <ethaddr> not set. Validating first E-fuse MAC                           
cpsw, usb_ether                                                                 
Hit any key to stop autoboot:  0                                                
mmc0 is current device                                                          
SD/MMC found on device 0                                                        
reading uEnv.txt                                                                
22 bytes read in 10 ms (2 KiB/s)                                                
Loaded environment from uEnv.txt                                                
Importing environment from mmc ...                                              
reading uImage                                                                  
3152520 bytes read in 311 ms (9.7 MiB/s)                                        
Booting from mmc ...                                                            
## Booting kernel from Legacy Image at 80007fc0 ...                             
   Image Name:   Linux-3.2.0-12581-g8ed7d75-dirty                               
   Image Type:   ARM Linux Kernel Image (uncompressed)                          
   Data Size:    3152456 Bytes = 3 MiB                                          
   Load Address: 80008000                                                       
   Entry Point:  80008000                                                       
   Verifying Checksum ... OK                                                    
   XIP Kernel Image ... OK                                                      
OK                                                                              
                                                                                
Starting kernel ...                                                             
                                                                                
Uncompressing Linux... done, booting the kernel.                                
[    0.000000] Linux version 3.2.0-12581-g8ed7d75-dirty (kuso@veda) (gcc versio4
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d  
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instructie
[    0.000000] Machine: am335xevm                                               
[    0.000000] Memory policy: ECC disabled, Data cache writeback                
[    0.000000] AM335X ES2.0 (sgx neon )                                         
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pa8
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p2 e
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)              
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)  
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)   
[    0.000000] Memory: 512MB = 512MB total                                      
[    0.000000] Memory: 513240k/513240k available, 11048k reserved, 0K highmem   
[    0.000000] Virtual kernel memory layout:                                    
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)                
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)                
[    0.000000]     vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)                
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)                
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)                
[    0.000000]       .text : 0xc0008000 - 0xc0591000   (5668 kB)                
[    0.000000]       .init : 0xc0591000 - 0xc05ce000   ( 244 kB)                
[    0.000000]       .data : 0xc05ce000 - 0xc062e6e8   ( 386 kB)                
[    0.000000]        .bss : 0xc062e70c - 0xc065b824   ( 181 kB)                
[    0.000000] NR_IRQS:399                                                      
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrus
[    0.000000] Total of 128 interrupts on 1 active controller                   
[    0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz                  
[    0.000000] OMAP clocksource: GPTIMER1 at 32768 Hz                           
[    0.000000] sched_clock: 32 bits at 32kHz, resolution 30517ns, wraps every 1s
[    0.000000] Console: colour dummy device 80x30                               
[    0.000122] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)          
[    0.089263] pid_max: default: 32768 minimum: 301                             
[    0.089355] Security Framework initialized                                   
[    0.089416] Mount-cache hash table entries: 512                              
[    0.089721] CPU: Testing write buffer coherency: ok                          
[    0.089935] Setting up static identity map for 0x8041ea60 - 0x8041eaa8       
[    0.108947] omap_hwmod: pruss: failed to hardreset                           
[    0.109893] print_constraints: dummy:                                        
[    0.110168] NET: Registered protocol family 16                               
[    0.111785] OMAP GPIO hardware version 0.1                                   
[    0.113769] omap_mux_init: Add partition: #1: wkup, flags: 0                 
[    0.113952] omap_mux_init: Add partition: #2: per, flags: 0                  
[    0.115264]  omap_i2c.1: alias fck already exists                            
[    0.115936]  omap2_mcspi.1: alias fck already exists                         
[    0.116088]  omap2_mcspi.2: alias fck already exists                         
[    0.116271]  edma.0: alias fck already exists                                
[    0.116302]  edma.0: alias fck already exists                                
[    0.116302]  edma.0: alias fck already exists                                
[    0.135559] bio: create slab <bio-0> at 0                                    
[    0.137268] SCSI subsystem initialized                                       
[    0.138519] usbcore: registered new interface driver usbfs                   
[    0.138732] usbcore: registered new interface driver hub                     
[    0.138885] usbcore: registered new device driver usb                        
[    0.139129] registerd cppi-dma Intr @ IRQ 17                                 
[    0.139129] Cppi41 Init Done Qmgr-base(e087a000) dma-base(e0878000)          
[    0.139129] Cppi41 Init Done                                                 
[    0.139160] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3   
[    0.139434] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1   
[    0.159271] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz                   
[    0.160369] tps65910 1-002d: could not be detected                           
[    0.161224] Advanced Linux Sound Architecture Driver Version 1.0.24.         
[    0.162078] Switching to clocksource gp timer                                
[    0.173553] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)             
[    0.173706] musb-hdrc musb-hdrc.0: dma type: dma-cppi41     ......

              

What's wrong with my process? or miss some step..   


Thanks.