curious4872
Posts: 73
Joined: Sun Nov 29, 2015 3:33 am

pis have no ACPI or PMICs: think hibernate still possible?

Sat May 21, 2016 10:46 pm

All versions of Linux 2.6 Kernel support hibernation (which means saving the contents of memory to disk, then shutting down the PC completely. The next time the PC is physically powered back on, as part of the boot process the old contents of memory are read from disk, restoring the previous session such as open browser windows, applications, and anything else that was being done. - "[Hibernation] is implemented by swsusp which is built into the 2.6 [Linux kernel] series.")

However, the Raspberry Pis have no ACPI support (Advanced Configuration and Power Interface) nor include a PMIC (Power Management IC, which could be part of a SoC but perhaps isn't for the one in Pis).

So, given this state of affairs, do you think it's still possible to get Pis to hibernate anyway? Why or why not?

I realize it would be pretty pointless, as at the end of the hibernation process you would have ... a running, shut-down pi that is ready to be physically powered down. I'm just curious what prevents this?

Obviously it would only make sense if there were some kind of external chip (maybe powered by Arduino) that waited until the Pi was shut down (maybe gave it 2 minutes to do so), and then physically interrupted its power until it needed it again.

The sleepypi seems to be along these lines, but I'm not sure if it hibernates or actually shuts down:

-> https://www.google.com/search?q=does+sl ... +shut+down

Doesn't answer in the first two pages of results.

The faq seems to imply it does a complete Shutdown (not hibernate): http://spellfoundry.com/sleepy-pi/sleep ... spberry_Pi

So it seems the sleepy pi is along these lines - but for some reason actually shuts down the Pi instead of hibernating it.

So is a proper hibernate command even possible? Why or why not? What is physically preventing it, if the kernel supports it? My understanding is that it's just a special shutdown sequence and a special boot sequence.... I don't see why it wouldn't work on a pi, other than having to interrupt the power manually once it has had time to complete....

(Please do correct any mistakes I made above.)

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: pis have no ACPI or PMICs: think hibernate still possibl

Sun May 22, 2016 7:30 am

Nobody has tried it - thats all. Testing such a thing would
certainly involve repeatedly compiling the Kernel and
other parts of Raspbian and original research on
(ARM ? Linux ? Debian ?) powersave modes on Raspberries since
no resources on that topic actually exist. That puts
most people off.

Note when i say original research i mean you could also
fail in finding a solution. Which also puts people off.

I certainly favor a system where an external micro
is involved.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

curious4872
Posts: 73
Joined: Sun Nov 29, 2015 3:33 am

Re: pis have no ACPI or PMICs: think hibernate still possibl

Sun May 22, 2016 9:15 am

ghans wrote:Nobody has tried it - thats all. Testing such a thing would
certainly involve repeatedly compiling the Kernel and
other parts of Raspbian and original research on
(ARM ? Linux ? Debian ?) powersave modes on Raspberries since
no resources on that topic actually exist. That puts
most people off.

Note when i say original research i mean you could also
fail in finding a solution. Which also puts people off.

I certainly favor a system where an external micro
is involved.


ghans

an external micro has to be involved as there is no way to interrupt the power - the raspberry pis are always-on when powered. This is a separate question from whether it is only possible to shutdown (still requires an external micro to physically cut power) or whether it is possible to hibernate (still requires an external micro to physically cut power.)

To explain in simple terms. If you run a normal shut down, you have to then unplug it. After plugging it back in you get a reboot.

If hibernation is possible, then after hibernating you have to then unplug it. After plugging it back in you would get a reboot. (But with the effect of waking from a hibernation.)

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: pis have no ACPI or PMICs: think hibernate still possibl

Sun May 22, 2016 9:43 am

The WittyPi has power down / power up capabilities, so it is not exactly want you want but may be an alternative with limitations:

http://www.uugear.com/witty-pi-realtime ... spberry-pi


It would seem your subject was brooched 4 years ago without resolution: viewtopic.php?f=27&t=7808
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: pis have no ACPI or PMICs: think hibernate still possibl

Sun May 22, 2016 9:52 am

AFAIK to suspend/hibernate devices have to be able to respond to freeze/thaw commands from the kernel, and the CPU (and RAM) have to accept switching to a specific state too.
Linux took a loooong time until it handled low power states gracefully, so if hardware support is there, adding software support could be quite a project.
I didn't know of the sleepypi hardware. I suppose the guy who designed it knows the ins and outs of the Pi's power management capabilities. Perhaps you could drop him a line, too?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: pis have no ACPI or PMICs: think hibernate still possibl

Sun May 22, 2016 9:59 am

epoch1970 wrote:AFAIK to suspend/hibernate devices have to be able to respond to freeze/thaw commands from the kernel, and the CPU (and RAM) have to accept switching to a specific state too.
Linux took a loooong time until it handled low power states gracefully, so if hardware support is there, adding software support could be quite a project.
I didn't know of the sleepypi hardware. I suppose the guy who designed it knows the ins and outs of the Pi's power management capabilities. Perhaps you could drop him a line, too?
I believe Linux uses rtcwake for machines with BIOS / ACPI etc...

http://linux.die.net/man/8/rtcwake
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: pis have no ACPI or PMICs: think hibernate still possibl

Sun May 22, 2016 10:18 am

I don't think rtcwake is the big guy, drivers have to implement some calls sent by the kernel.
Some PC systems can't currently exit sleep states such as mem using only the kernel code accessed by this driver.
I admit I am totally out of my league.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

curious4872
Posts: 73
Joined: Sun Nov 29, 2015 3:33 am

Re: pis have no ACPI or PMICs: think hibernate still possibl

Sun May 22, 2016 12:44 pm

This page (admittedly from 2011) says GRUB can read hibernated swap file to reload from it:

http://chriseiffel.com/everything-linux ... 4-mint-11/

But is there any way to get GRUB to work? The link (4 years old) says grub doesn't work with an rpi - is this the latest? viewtopic.php?f=24&t=10814

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: pis have no ACPI or PMICs: think hibernate still possibl

Sun May 22, 2016 1:05 pm

curious4872 wrote:This page (admittedly from 2011) says GRUB can read hibernated swap file to reload from it:

http://chriseiffel.com/everything-linux ... 4-mint-11/

But is there any way to get GRUB to work? The link (4 years old) says grub doesn't work with an rpi - is this the latest? viewtopic.php?f=24&t=10814
All RPi and CM boot from the VC4** so no change:

http://wiki.beyondlogic.org/index.php?t ... ot_Process

http://wiki.beyondlogic.org/index.php?t ... aspberryPi


**the RPi 3B is slightly different as also supports USB Boot / PXE as mentioned at end of this podcast, but not yet implemented:

http://thepipodcast.com/the-pi-podcast-22-eben-upton
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

curious4872
Posts: 73
Joined: Sun Nov 29, 2015 3:33 am

Re: pis have no ACPI or PMICs: think hibernate still possibl

Sun May 22, 2016 2:26 pm

fruitoftheloom wrote:
curious4872 wrote:This page (admittedly from 2011) says GRUB can read hibernated swap file to reload from it:

http://chriseiffel.com/everything-linux ... 4-mint-11/

But is there any way to get GRUB to work? The link (4 years old) says grub doesn't work with an rpi - is this the latest? viewtopic.php?f=24&t=10814
All RPi and CM boot from the VC4** so no change:

http://wiki.beyondlogic.org/index.php?t ... ot_Process

http://wiki.beyondlogic.org/index.php?t ... aspberryPi


**the RPi 3B is slightly different as also supports USB Boot / PXE as mentioned at end of this podcast, but not yet implemented:

http://thepipodcast.com/the-pi-podcast-22-eben-upton

Thanks. These are fantastic links. Do you know what beyondlogic.org is? The about page on bottom-right is blank.

Return to “Advanced users”