Standby - Suspend to RAM (MNT Reform)

Hello everyone,

I wanted to ask if Standby was possible on the Reform? I know on the Librem 5 standby (suspend to RAM) has not been achieved just yet.

I’m eagerly awaiting my Reform, and look forward to going through the threads here and interacting with all of you.

It is NOT supported on the Librem 5 yet. Not really fair to use that as a direct rational for assuming it here, because it is dealing with cellular radios and needs to be able to resume from interrupter originating there, but I do think it warrants at least asking.

Would anyone here WITH a Reform be able to comment?

It is supported in theory, but in practice I find the wireless card has trouble coming back up and this results in the system becoming somewhat unresponsive. Haven’t tried to investigate the problem yet, personally. If you don’t have a wifi card, it should work fine as-is.

I got one. Is there a strategy to getting it come back up or is rebooting the system really the only recourse?

Welcome :slight_smile: You can try to use systemd units pre/post sleep to do module shuffling and maybe pci reset. I was doing it on my old laptop with bluetooth as it wasn’t properly waking up. This is just in theory as I’m also waiting for the reform.

1 Like

Haven’t figured out a strategy yet, but I’ve also not put much time toward it. Not being able to suspend hasn’t really caused me much trouble yet. Maybe I’ll work on it a bit today, though, and see what I can figure out.

I’m looking at trying to use the Reform as my actual laptop at least part of the time, and a reliable suspend is crucial to that. So I appreciate any thing you might be able to uncover. Thanks!

Well, that didn’t take long. Popped open the suspend script, saw the “WIFI” variable was pointing to “wlp1s0” while, thanks to my own network reconfiguration shenanigans, my wireless card is under “wlan0” instead. Changed that, went into standby for maybe a minute, and brought it back just fine after with “Circle+space.” (Caveat: “Circle+1” seems to always run the boot sequence, even if you’re suspended. At least, it does on the previous firmware version. Haven’t upgraded yet.)

If I have any more trouble after this I’ll report back, but it seems like the Reform should support suspend just fine so long as things are named as the script expects. :stuck_out_tongue:

2 Likes

Thanks lykso! That is what I was hoping!

I really don’t know what you mean. I reread what I wrote, and I don’t think I’m taking any tone, I’m only trying to better explain why I felt it necessary to verify the Reform can enter standby without issue. Sorry if you felt offended, none was intended.

I thought that that was the issue with mine after updating my kernel, but that’s not the main suspend issue. I did run into that and fixed it a few weeks ago on mine. I thought that the issue was fixed, but after testing suspend over and over again I did manage to get it to fail to come back up again even with the correct script.

The wrong wifi identifier in the suspend script will cause it not to enter suspend in the first place, the script will just kinda lock up there or possibly on resume. But the bug with suspend it’ll suspend correctly, but on bring up the wifi card will be spamming log messages about being reset constantly and the system will be laggy and unusable till a restart because of that.

Ah, that’s a shame. About how often would you say it fails to come back up properly?

I’ve not extensively tested it, maybe 1 in 10 or something like that. Just enough to make it feel like it’s working but occasionally fail. So I don’t really use or trust it, just leaving it plugged in when it’s not in use and using swaylock to blank the screen after a few minutes. I do want to try and track it down, but haven’t had the time.

Hopefully you have the time and inclination to tackle it in the future. I know I would especially be grateful is suspend was working.

User “Kooda” in the IRC channel reported that suspend/wake via the reform-standby script works reliably for them, but that surprised me, because it is unreliable for me personally. We found a Librem 5 issue about this topic, but it was about dwc3 USB controller driver hanging in suspend–but apparently only in “gadget mode” which we don’t use.

1 Like

FWIW, it’s been working reliably for me as well since I changed my script. I also suspend maybe once a day, though, so there’s less opportunity for me to encounter a problem.

I’ve also messed with my networking settings a bit, so those are no longer stock. Can’t recall exactly what I did, but the end result is that I’m using NetworkManager now instead of connman. Maybe this also plays a role.

2 Likes

If you could share your modified script here that would be excellent for when I receive my reform. I know one thing I want to look into is improving the standby situation where possible. I’ve been looking to contribute somewhere on Linux and I think a mouse driver improvement and standby on this platform are the two things I have my sites on.

Edit: mouse improvement in general for desktop Linux. Basicly a quality of life for mouse use on a trackpad. I suppose it could be applied to a reform with a touchpad.

Sure. I think I only changed the WIFI variable to match the new network device name, but here it is in its entirety:

#!/bin/bash

if [ "$EUID" -ne 0 ]
  then echo "reform-standby has to be run as root / using sudo."
  exit
fi

#WIFI=wlp1s0
WIFI=wlan0

# configure UARTs as wakeup sources
echo enabled > /sys/devices/platform/soc@0/30800000.bus/30860000.serial/tty/ttymxc0/power/wakeup
echo enabled > /sys/devices/platform/soc@0/30800000.bus/30890000.serial/tty/ttymxc1/power/wakeup
echo enabled > /sys/devices/platform/soc@0/30800000.bus/30880000.serial/tty/ttymxc2/power/wakeup

if [ -e /sys/class/net/$WIFI ]
then
  echo "Disconnecting Wi-Fi ($WIFI)..."
  ifconfig $WIFI down
fi

echo Entering standby in 3...
sleep 1
echo 2...
sleep 1
echo 1...
sleep 1

sync
echo mem >/sys/power/state

# reset wifi
if [ -e /sys/class/net/$WIFI ]
then
  echo "Resetting Wi-Fi ($WIFI)..."
  sleep 1
  echo 1 > /sys/devices/platform/soc@0/33800000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/reset
  sleep 1
  ifconfig $WIFI up
  echo Done.
fi

Edit: Okay, I’ve just had my Reform fail to come back up. Keyboard lights were on, but the display stayed black and, after reboot, there was nothing in journalctl to indicate that it even tried to come back up.

3 Likes

Hi everybody :slight_smile:
Does anyone have a solution? Maybe some modifications for lykso’s script?

For clarification, I’ve done a diff since writing that post and “my” script really is nothing more than the original standby script that ships with the Reform with the “WIFI” variable changed to match the name NetworkManager assigns the interface (a change required by having switched from connman).

I’ve also had some instances, since writing that post, where my machine did not come back up from standby, so it really was just a matter of having gotten lucky.

1 Like

Actually, not that I personally possess a mnt reform at the moment, but I wondered if anyone plans to make a script that could potentially be used with nothing but laptop-mode-tools, or tlp, or even auto-cpufreq.

Just a thought in case people want to use the script with OpenBSD, or something like KissLinux, etc…

:wink:

I am sure someone out there would appreciate it, its not pressing at the moment for me personally, but yeah, in the future it would be awesome.