PureOS wakes up after a few seconds of suspend


I have had the issue recently that when I suspend the Librem 15v3 (either by pressing the suspend button in the taskbar or by closing the lid), it will automatically wake up after 2 to 5 seconds without any keyboard or mouse click. Worse, sometimes it would freeze and I would have to reboot to be able to use the laptop again.

After some research on the internet, the root cause seems to be some components waking up the laptop.
cat /proc/acpi/wakeup
showed that XHCI device was enabled.
Disabling it with
echo XHCI | sudo tee /proc/acpi/wakeup
solved the automatic wake up and potential freezing issues.

Where I am stuck is that after rebooting the laptop, the XHCI device is enabled again. So I have to disable it manually through the command line above after every reboot.

Can someone explain the steps to disable a device permanently?

Thanks in advance


I found the solution in these 2 posts:



I created a file disable-USB-wakeup.service in /etc/systemd/system containing

Description=Disable USB wakeup triggers in /proc/acpi/wakeup

ExecStart=/bin/sh -c “echo XHCI > /proc/acpi/wakeup”


Then I did

sudo systemctl daemon-reload


sudo systemctl start disable-USB-wakeup.service

Checked on it with

systemctl status disable-USB-wakeup.service

Then enabled it so it starts after boot with

sudo systemctl enable disable-USB-wakeup.service


Just check on power optimisation quite a few people had trouble with it.