Beaglebone suspend/resume

It's been a while since I was playing with the beagleboard, and now i am trying to use the Beaglebone. There used to be a -pm version of the kernel that supported suspend and resume. Now I am wondering if something like this exists for the beaglebone. My application requires running for a few minutes a few times a day. In advance thanks...

I do not believe this is available on the AM335x. I think it may be available in about a month, but I cannot swear to that.

Gerald

Suspend-resume was added to the PSP kernel recently. You can get it from here http://arago-project.org/git/projects/?p=linux-am33x.git;a=commit;h=1b21543aae1844cd2b59bb0f257d6f62c38f39f9

You also need to get your hands on the PM firmware from here http://arago-project.org/git/projects/?p=am33x-cm3.git;a=shortlog;h=refs/heads/master
Take the binary from the master branch and put it in the firmware/ folder before building the kernel.

There’s a user guide over here http://processors.wiki.ti.com/index.php/AM335x_Power_Management_User_guide#Suspend_.26_Resume

Hi,

I’m trying to make hibernate work.
I currently patched tuxonice 3.2 for kernel 3.2.1 successfully (Patches here: http://crow202.org/tuxonice/) on the latest 04.06.00.07. (kernel 3.2.0)
Then the Tuxonice for ARM patch: http://patchwork.ozlabs.org/patch/100518/raw/

However the kernel hangs while trying to suspend to disk. Suspend to ram works fine.

[ 41.202056] TuxOnIce 3.2.1, with support for usm, compression, block i/o, swap storage, file storage, userui.
[ 41.224822] TuxOnIce: No image found.
[ 41.230804] Initiating a hibernation cycle.
[ 41.236602] Failed to launch userspace program ‘/usr/local/sbin/tuxoniceui_text’: Error -2
[ 41.245666] Launch userspace program failed.
[ 41.250213] Starting other threads.
[ 41.254028] Freezing processes & syncing filesystems.
[ 41.259552] Stopping fuse filesystems.
[ 41.263946] Freezing user space processes … (elapsed 0.01 seconds) done.
[ 41.296386] Stopping normal filesystems.
[ 41.310363] Freezing remaining freezable tasks … (elapsed 0.01 seconds) done.
[ 41.374938] Preparing Image. Try 1.
[ 41.428527] Restarting normal filesystems.
[ 41.447662] Stopping fuse filesystems.
[ 41.451629] Freezing user space processes … (elapsed 0.00 seconds) done.
[ 41.459442] Stopping normal filesystems.
[ 41.466735] Freezing remaining freezable tasks … (elapsed 0.01 seconds) done.
[ 41.535278] Starting to save the image…
[ 41.539428] Writing caches…
[ 41.561187] …20%…40%…60%…80%
[ 42.371551] Doing atomic copy/restore.
[ 42.378845] PM: freeze of devices complete after 2.990 msecs
[ 42.385284] PM: late freeze of devices complete after 0.366 msecs
[ 42.392181] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 42.400726] pgd = cfa34000
[ 42.403564] [00000000] *pgd=8fa6d831, *pte=00000000, *ppte=00000000
[ 42.410186] Internal error: Oops: 817 [#1] PREEMPT
[ 42.415222] Modules linked in: vfat fat lzo ipv6 unix
[ 42.420562] CPU: 0 Not tainted (3.2.0 #16)
[ 42.425231] PC is at 0xc0000100
[ 42.428558] LR is at cpu_suspend_abort+0x0/0x24
[ 42.433349] pc : [] lr : [] psr: 60000093
[ 42.433349] sp : cfb27e5c ip : 00000000 fp : 00000000
[ 42.445404] r10: c03ef000 r9 : 00000000 r8 : c0446d60
[ 42.450897] r7 : 00000000 r6 : c03ef4b0 r5 : cfb27e84 r4 : 00000028
[ 42.457763] r3 : c03f45ac r2 : 00000006 r1 : f03fe03a r0 : 00000000
[ 42.464630] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 42.472412] Control: 10c5387d Table: 8fa34019 DAC: 00000015
[ 42.478454] Process sh (pid: 485, stack limit = 0xcfb262f0)
[ 42.484313] Stack: (0xcfb27e5c to 0xcfb28000)
[ 42.488891] 7e40: 8f848000
[ 42.497497] 7e60: cfb27e84 80015f00 00000000 4004c490 00000015 80004019 10c5387d 00000042
[ 42.506103] 7e80: 00f00000 00000000 cf9fcb00 c03ef4b0 00000000 c0446d60 00000000 c03ef000
[ 42.514739] 7ea0: 00000000 c0011c20 c0011ce4 00000000 00000000 c0011d88 00000000 c0062a60
[ 42.523345] 7ec0: 00000000 c006bd64 00000000 c0065414 00000bc4 000001a7 00000000 00000000
[ 42.531951] 7ee0: c04460a4 00000003 00000000 c0446d60 c03ef000 c00659f8 c0410c80 00000002
[ 42.540557] 7f00: 00000002 00000000 cfa2e7d8 c0410ce4 cf9a2200 c0064248 cf9a2200 c0410c80
[ 42.549163] 7f20: cfa1d000 cfb27f80 00000002 cf991400 cfa2e7c0 cfa2e7d8 cf9a2200 c00fff28
[ 42.557769] 7f40: 00000002 cf8417c0 0009b408 cfb27f80 00000002 cfb26000 00000000 c00b2540
[ 42.566375] 7f60: cf8417c0 0009b408 cf8417c0 0009b408 00000000 00000000 00000002 c00b2780
[ 42.574981] 7f80: 00000000 00000000 00000002 00000000 401640e0 00000002 0009b408 00000004
[ 42.583587] 7fa0: c000e184 c000e000 401640e0 00000002 00000001 0009b408 00000002 40132110
[ 42.592193] 7fc0: 401640e0 00000002 0009b408 00000004 00099298 00000000 00000000 00000000
[ 42.600799] 7fe0: 00000002 be9eaa60 40131710 40154eac 60000010 00000001 00010074 00000a19
[ 42.609436] [] (cpu_suspend_abort+0x0/0x24) from [<00000000>] ( (null))
[ 42.617401] Code: 00000000 00000000 00000000 00000000 (000041fd)
[ 42.623809] —[ end trace 4309824994f46312 ]—

I guess it would be rather easy for the dev which has implemented suspend to RAM to finish implementing suspend to disk based on this info.
Could you help?

Thanks.

One last thing :slight_smile:

Suspend doesn’t work with kernels compiled in Thumb2 mode. (THUMB2_KERNEL)
That would be nice if you could fix this, as a Thumb2 kernel is 35% smaller and just as fast.

Thanks.

Suspend works on the boards I have, resume is broken on all, wether it's using t2 or not.

Hi,

Hi,

I’m trying to make hibernate work.

Great

I currently patched tuxonice 3.2 for kernel 3.2.1 successfully (Patches here: http://crow202.org/tuxonice/) on the latest 04.06.00.07. (kernel 3.2.0)
Then the Tuxonice for ARM patch: http://patchwork.ozlabs.org/patch/100518/raw/

However the kernel hangs while trying to suspend to disk. Suspend to ram works fine.

[ 41.202056] TuxOnIce 3.2.1, with support for usm, compression, block i/o, swap storage, file storage, userui.
[ 41.224822] TuxOnIce: No image found.
[ 41.230804] Initiating a hibernation cycle.
[ 41.236602] Failed to launch userspace program ‘/usr/local/sbin/tuxoniceui_text’: Error -2
[ 41.245666] Launch userspace program failed.
[ 41.250213] Starting other threads.
[ 41.254028] Freezing processes & syncing filesystems.
[ 41.259552] Stopping fuse filesystems.
[ 41.263946] Freezing user space processes … (elapsed 0.01 seconds) done.
[ 41.296386] Stopping normal filesystems.
[ 41.310363] Freezing remaining freezable tasks … (elapsed 0.01 seconds) done.
[ 41.374938] Preparing Image. Try 1.
[ 41.428527] Restarting normal filesystems.
[ 41.447662] Stopping fuse filesystems.
[ 41.451629] Freezing user space processes … (elapsed 0.00 seconds) done.
[ 41.459442] Stopping normal filesystems.
[ 41.466735] Freezing remaining freezable tasks … (elapsed 0.01 seconds) done.
[ 41.535278] Starting to save the image…
[ 41.539428] Writing caches…
[ 41.561187] …20%…40%…60%…80%
[ 42.371551] Doing atomic copy/restore.
[ 42.378845] PM: freeze of devices complete after 2.990 msecs
[ 42.385284] PM: late freeze of devices complete after 0.366 msecs
[ 42.392181] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 42.400726] pgd = cfa34000
[ 42.403564] [00000000] *pgd=8fa6d831, *pte=00000000, *ppte=00000000
[ 42.410186] Internal error: Oops: 817 [#1] PREEMPT
[ 42.415222] Modules linked in: vfat fat lzo ipv6 unix
[ 42.420562] CPU: 0 Not tainted (3.2.0 #16)
[ 42.425231] PC is at 0xc0000100
[ 42.428558] LR is at cpu_suspend_abort+0x0/0x24
[ 42.433349] pc : [] lr : [] psr: 60000093
[ 42.433349] sp : cfb27e5c ip : 00000000 fp : 00000000
[ 42.445404] r10: c03ef000 r9 : 00000000 r8 : c0446d60
[ 42.450897] r7 : 00000000 r6 : c03ef4b0 r5 : cfb27e84 r4 : 00000028
[ 42.457763] r3 : c03f45ac r2 : 00000006 r1 : f03fe03a r0 : 00000000
[ 42.464630] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 42.472412] Control: 10c5387d Table: 8fa34019 DAC: 00000015
[ 42.478454] Process sh (pid: 485, stack limit = 0xcfb262f0)
[ 42.484313] Stack: (0xcfb27e5c to 0xcfb28000)
[ 42.488891] 7e40: 8f848000
[ 42.497497] 7e60: cfb27e84 80015f00 00000000 4004c490 00000015 80004019 10c5387d 00000042
[ 42.506103] 7e80: 00f00000 00000000 cf9fcb00 c03ef4b0 00000000 c0446d60 00000000 c03ef000
[ 42.514739] 7ea0: 00000000 c0011c20 c0011ce4 00000000 00000000 c0011d88 00000000 c0062a60
[ 42.523345] 7ec0: 00000000 c006bd64 00000000 c0065414 00000bc4 000001a7 00000000 00000000
[ 42.531951] 7ee0: c04460a4 00000003 00000000 c0446d60 c03ef000 c00659f8 c0410c80 00000002
[ 42.540557] 7f00: 00000002 00000000 cfa2e7d8 c0410ce4 cf9a2200 c0064248 cf9a2200 c0410c80
[ 42.549163] 7f20: cfa1d000 cfb27f80 00000002 cf991400 cfa2e7c0 cfa2e7d8 cf9a2200 c00fff28
[ 42.557769] 7f40: 00000002 cf8417c0 0009b408 cfb27f80 00000002 cfb26000 00000000 c00b2540
[ 42.566375] 7f60: cf8417c0 0009b408 cf8417c0 0009b408 00000000 00000000 00000002 c00b2780
[ 42.574981] 7f80: 00000000 00000000 00000002 00000000 401640e0 00000002 0009b408 00000004
[ 42.583587] 7fa0: c000e184 c000e000 401640e0 00000002 00000001 0009b408 00000002 40132110
[ 42.592193] 7fc0: 401640e0 00000002 0009b408 00000004 00099298 00000000 00000000 00000000
[ 42.600799] 7fe0: 00000002 be9eaa60 40131710 40154eac 60000010 00000001 00010074 00000a19
[ 42.609436] [] (cpu_suspend_abort+0x0/0x24) from [<00000000>] ( (null))
[ 42.617401] Code: 00000000 00000000 00000000 00000000 (000041fd)
[ 42.623809] —[ end trace 4309824994f46312 ]—

I guess it would be rather easy for the dev which has implemented suspend to RAM to finish implementing suspend to disk based on this info.
Could you help?

This is on my radar but so far i haven’t even gotten around to finding out what sort of kernel modifications are needed to get it to work.
How is the patch that you have different from what’s been pointed out here http://lists.tuxonice.net/pipermail/tuxonice-devel/2011-May/006854.html
If it’s too different i would suggest trying the procedure that Frank listed out in the link above.

However, I suspect this is not going to so straightforward. A few things that immediately come to mind…

  1. The generic support for ARM suspend-to-disk has not merged into the kernel so there must have been concerns on the approach and investigating that would probably be the first thing to look at.

  2. Where is the hibernation image going to be stored? Is it NAND/MMC or somewhere else?

  3. I guess for a true suspend-to-disk you should also have some mechanism to get the PMIC to power off the system. With some changes in the way the PMIC is hooked up this is very much possible but still needs to be thought through.

Regards,
Vaibhav

Hey,

  1. To be merged both suspend to ram and suspend to disk need to be implemented. Code needs to be shared between the two as much as possible. I guess the current code is not generic enough.
  2. SWAP on MMC, but it can be a file as well. Anywhere as long as the kernel can reach it.
  3. I leave this to the TI engineers :slight_smile:

Thanks.

This will take its own time then. Don't ask me when :wink:

-Vaibhav

Hi,

Did your HIBERNATION work fine?

Regards,
Sabakawa

On Wed, Apr 25, 2012 at 3:58 PM UTC+9 fabien p.:

Hi,

I’m trying to make hibernate work.
I currently patched tuxonice 3.2 for kernel 3.2.1 successfully (Patches here: http://crow202.org/tuxonice/) on the latest 04.06.00.07. (kernel 3.2.0)
Then the Tuxonice for ARM patch: http://patchwork.ozlabs.org/patch/100518/raw/

However the kernel hangs while trying to suspend to disk. Suspend to ram works fine.

[ 41.202056] TuxOnIce 3.2.1, with support for usm, compression, block i/o, swap storage, file storage, userui.
[ 41.224822] TuxOnIce: No image found.
[ 41.230804] Initiating a hibernation cycle.
[ 41.236602] Failed to launch userspace program ‘/usr/local/sbin/tuxoniceui_text’: Error -2
[ 41.245666] Launch userspace program failed.
[ 41.250213] Starting other threads.
[ 41.254028] Freezing processes & syncing filesystems.
[ 41.259552] Stopping fuse filesystems.
[ 41.263946] Freezing user space processes … (elapsed 0.01 seconds) done.
[ 41.296386] Stopping normal filesystems.
[ 41.310363] Freezing remaining freezable tasks … (elapsed 0.01 seconds) done.
[ 41.374938] Preparing Image. Try 1.
[ 41.428527] Restarting normal filesystems.
[ 41.447662] Stopping fuse filesystems.
[ 41.451629] Freezing user space processes … (elapsed 0.00 seconds) done.
[ 41.459442] Stopping normal filesystems.
[ 41.466735] Freezing remaining freezable tasks … (elapsed 0.01 seconds) done.
[ 41.535278] Starting to save the image…
[ 41.539428] Writing caches…
[ 41.561187] …20%…40%…60%…80%
[ 42.371551] Doing atomic copy/restore.
[ 42.378845] PM: freeze of devices complete after 2.990 msecs
[ 42.385284] PM: late freeze of devices complete after 0.366 msecs
[ 42.392181] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 42.400726] pgd = cfa34000
[ 42.403564] [00000000] *pgd=8fa6d831, *pte=00000000, *ppte=00000000
[ 42.410186] Internal error: Oops: 817 [#1] PREEMPT
[ 42.415222] Modules linked in: vfat fat lzo ipv6 unix
[ 42.420562] CPU: 0 Not tainted (3.2.0 #16)
[ 42.425231] PC is at 0xc0000100
[ 42.428558] LR is at cpu_suspend_abort+0x0/0x24
[ 42.433349] pc : [] lr : [] psr: 60000093
[ 42.433349] sp : cfb27e5c ip : 00000000 fp : 00000000
[ 42.445404] r10: c03ef000 r9 : 00000000 r8 : c0446d60
[ 42.450897] r7 : 00000000 r6 : c03ef4b0 r5 : cfb27e84 r4 : 00000028
[ 42.457763] r3 : c03f45ac r2 : 00000006 r1 : f03fe03a r0 : 00000000
[ 42.464630] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 42.472412] Control: 10c5387d Table: 8fa34019 DAC: 00000015
[ 42.478454] Process sh (pid: 485, stack limit = 0xcfb262f0)
[ 42.484313] Stack: (0xcfb27e5c to 0xcfb28000)
[ 42.488891] 7e40: 8f848000
[ 42.497497] 7e60: cfb27e84 80015f00 00000000 4004c490 00000015 80004019 10c5387d 00000042
[ 42.506103] 7e80: 00f00000 00000000 cf9fcb00 c03ef4b0 00000000 c0446d60 00000000 c03ef000
[ 42.514739] 7ea0: 00000000 c0011c20 c0011ce4 00000000 00000000 c0011d88 00000000 c0062a60
[ 42.523345] 7ec0: 00000000 c006bd64 00000000 c0065414 00000bc4 000001a7 00000000 00000000
[ 42.531951] 7ee0: c04460a4 00000003 00000000 c0446d60 c03ef000 c00659f8 c0410c80 00000002
[ 42.540557] 7f00: 00000002 00000000 cfa2e7d8 c0410ce4 cf9a2200 c0064248 cf9a2200 c0410c80
[ 42.549163] 7f20: cfa1d000 cfb27f80 00000002 cf991400 cfa2e7c0 cfa2e7d8 cf9a2200 c00fff28
[ 42.557769] 7f40: 00000002 cf8417c0 0009b408 cfb27f80 00000002 cfb26000 00000000 c00b2540
[ 42.566375] 7f60: cf8417c0 0009b408 cf8417c0 0009b408 00000000 00000000 00000002 c00b2780
[ 42.574981] 7f80: 00000000 00000000 00000002 00000000 401640e0 00000002 0009b408 00000004
[ 42.583587] 7fa0: c000e184 c000e000 401640e0 00000002 00000001 0009b408 00000002 40132110
[ 42.592193] 7fc0: 401640e0 00000002 0009b408 00000004 00099298 00000000 00000000 00000000
[ 42.600799] 7fe0: 00000002 be9eaa60 40131710 40154eac 60000010 00000001 00010074 00000a19
[ 42.609436] [] (cpu_suspend_abort+0x0/0x24) from [<00000000>] ( (null))
[ 42.617401] Code: 00000000 00000000 00000000 00000000 (000041fd)
[ 42.623809] —[ end trace 4309824994f46312 ]—

I guess it would be rather easy for the dev which has implemented suspend to RAM to finish implementing suspend to disk based on this info.
Could you help?

Thanks.

Suspend-resume was added to the PSP kernel recently. You can get it from here http://arago-project.org/git/projects/?p=linux-am33x.git;a=commit;h=1b21543aae1844cd2b59bb0f257d6f62c38f39f9

You also need to get your hands on the PM firmware from here http://arago-project.org/git/projects/?p=am33x-cm3.git;a=shortlog;h=refs/heads/master
Take the binary from the master branch and put it in the firmware/ folder before building the kernel.

There’s a user guide over here http://processors.wiki.ti.com/index.php/AM335x_Power_Management_User_guide#Suspend_.26_Resume

It’s been a while since I was playing with the beagleboard, and now i am trying to use the Beaglebone. There used to be a -pm version of the kernel that supported suspend and resume. Now I am wondering if something like this exists for the beaglebone. My application requires running for a few minutes a few times a day. In advance thanks…

– To join: http://beagleboard.org/discuss
To unsubscribe from this group, send email to:
beagleboard+unsubscribe@googlegroups.com
Frequently asked questions: http://beagleboard.org/faq


Regards,
Vaibhav

2012年4月25日水曜日 3時58分13秒 UTC+9 fabien p.: