Fix MacBook Not Waking From Sleep Or Suspend On Fedora Linux


This is for people who use Fedora Linux on their MacBook that doesn’t wake up from sleep or suspend.

This guide also applies for people who have a MacBook with an NVIDIA GPU, but installing the driver hasn’t worked.


CPU Soft Lockup


Fedora Linux does something with the CPU that other distributions don’t, so that’s why for example Ubuntu has suspend working.

Start with suspending your MacBook, so either close the lid or suspend from your desktop, then wait a few seconds and resume it.

I’m assuming the screen is black, but if it actually turns on, suspend it again we want a black screen, afterwards force restart it by holding the power button.

When it turns on, open terminal and run journalctl | grep watchdog look for something like “watchdog: bug: soft lockup – cpu#“.

The “cpu#” will have a number after it, then remember that number.

What We’re Going to Do About CPU Soft Lockup

You’ll write two systemd services.

One will disable the CPU thread that’s locking up before suspend, then the second will enable the thread after resume.

You won’t sacrifice any performance and the laptop will resume properly.

Creating The Service Files


Open terminal and run sudo nano /etc/systemd/system/CPU#OFF.service replace the “#” with the number of the “cpu#” from the log.

Copy and paste what I’ve left below, changing it for your CPU number.

[Unit]
Description=Turns off CPU#(Number) before suspend
Before=sleep.target

[Service]
Type=simple
ExecStart=/usr/bin/bash -c 'echo 0 > /sys/devices/system/cpu/YOUR CPU NUMBER FROM THE LOG WITHOUT THE "#" FOR EXAMPLE; cpu3/online'

[install]
WantedBy=sleep.target

Save and exit.

In the same terminal run sudo nano /etc/systemd/system/CPU#ON.service replace the “#” with the number of the “cpu#” from the log.

Copy and paste what I’ve left below, changing it for your CPU number.

[Unit]
Description=Turns on CPU#(Number) after resuming
After=suspend.target

[Service]
Type=simple
ExecStart=/usr/bin/bash -c 'echo 1 > /sys/devices/system/cpu/YOUR CPU NUMBER FROM THE LOG WITHOUT THE "#" FOR EXAMPLE; cpu3/online'

[install]
WantedBy=suspend.target

Save and exit.

In terminal run, systemctl enable –now CPU#OFF.service && systemctl enable –now CPU#ON.service.

Suspend your MacBook to check if it resumes properly, If it doesn’t work, try rebooting it. Afterwards you have a MacBook properly resuming from suspend.

After you are done with that, why not optimize further? Check out my laptop optimization guide!

Leave a Comment

Your email address will not be published. Required fields are marked *