as I knew it before, at some point a CONFIG_PM was finally enabled and both Hibernation and Suspend features are available. I’m more interested in Hibernation rather than Suspend (store to RAM and maintain), because that’s what my working pattern with personal general purpose computers I own.
I tried to hibernate an SSH only controlled board by issuing command from serial. For some unknown reason, I was asked to put MAJOR:MINOR numbers of swap partition instead of it’s name at boot up otherwise it will spit Invalid argument from initrd.xz and betray saved image by booting as usual. Debugging sleeps inserted between mdev -s and writing devname I have swsusp image on to /sys/power/resume did not work. But MAJ:MIN device numbers did! Bruh.
Anyway, everything worked fine but my Ethernet gone. It does not see link anymore, lights are off, and in brought up logs from dmesg I see something like:
starfive-eth-plat 16030000.ethernet: Failed to reset the dma
starfive-eth-plat 16030000.ethernet eth0: stmmac_hw_setup: DMA engine initialization fa
Board ends up without connectivity, but possible change of ports can temporary solve the issue till next hibernation.
This is minimal, server like computer and I don’t much care about graphics output for now. I just want to “save” it building a large package and then “restore” it to continue interrupted work. With connectivity only by ttyS0 it will be quite a boring adventure.
it’s need to build a swap partition 5 (at least 8G), and modify the configuration file of /boot/extlinux/extlinux.conf. After the word of ‘append’ in the configuration file, add ‘‘no_console_suspend resume=/dev/mmcblk1p5’’ and save.
Use the following command to enter hibernation：
~# echo disk > sudo tee /sys/power/state
Hi, thank you for reply,
I have 16G swap partition on my 8G RAM VF2. I added no_console_suspend and still no luck, ethernet led is ON when pre-hibernated kernel runs but goes OFF and does not react at all when I do ip link set eth0 down and ip link set eth0 up. I guess my next attempt will be to rebuild kernel with stmmac driver as module and try rmmod / modprobe to see if that works.
My current suspend sequence is:
echo shutdown >/sys/power/disk
echo disk >/sys/power/state
Which served me well for nearly 10yrs on three desktops in my life.
At least other critical for operation devices like NVMe seem to be working after resume. USB also works, so does microSD slot. Probably just stmmac is misbehaving.
just an idea for something to try: unload the eth driver module before suspend und load it again after resume - if it is not a module yet, then it would have to be built as such … this strategy usually works ok for not well behaved wifi drivers in some situations - here is an example for how to handle this automatically via systemd (other system and other driver in this case): imagebuilder/mrvl-reload at main · hexdump0815/imagebuilder · GitHub
Nah, it didn’t work out lol. I get kernel BUG and no-go system condition when trying to unload dwmac_starfive_plat with all NICs are brought deaf down…
So no swsusp for now. Without networking its not fun.