[x86-64] Resuming from S3 (Sleep/Suspend)

  • I have upgraded my LibreELEC system to an AMD one (CPU/motherboard/video card). After the upgrade LibreELEC was consistently freezing on resuming from sleep state S3. However, this did not happen when I booted other Linux distros in the same system. After spending a lot of time troubleshooting this issue (including playing with firmware settings and kernel parameters) I finally found out the culprit:

    LibreELEC kernel is built with this patch that disables async suspend/resume by default. This can be verified at runtime via /sys/power/pm_async.

    Code
    # cat /sys/power/pm_async
    0

    It is possible to re-enable it:

    Code
    # echo 1 > /sys/power/pm_async
    # cat /sys/power/pm_async
    1

    After this change, my system consistently resumes from suspend. I have not experienced a single freeze with it enabled.

    To make this change persistent, I created this file:

    Code: .config/tmpfiles.d/pm_async.conf
    w /sys/power/pm_async - - - - 1

    Posting here hoping that this recipe will prove useful to others here.

  • Code
    echo "echo 1 > /sys/power/pm_async" > /storage/.config/autostart.sh

    Run that command ^ and reboot and it should be applied to the OS on each boot. There's probably a modprobe method which will be lessy hacky, but if it works..