Sleep/Turn off doesn't work properly on iMac

Dear Fedoricans,

I am currently using Linux Fedora 37 on my iMac 2015 A1418. Unfortunately sleep mode and turning off computer doesn’t work properly - after clicking the buttons, computer restarts and that’s all.

Please tell me what I need to provide so that the problem can be detected. I am new to Linux!

Best regards,
Jakub

Apparently 2015 MacBook Pros had a similar problem.

Excerpt from lwn.net: Linux on the Mac — state of the union:

MacBook Pros introduced in 2015 suffer from a similarly annoying issue caused by an unused PCIe root port that Apple forgot to disable in the firmware. The root port is invisible to macOS because it is not enumerated in the ACPI tables, but Linux discovers and initializes it, thereby breaking suspend and power off on these machines. Chen Yu has posted a workaround patch which is not yet in mainline but already included in distributions such as Ubuntu.

Does adding reboot=pci or reboot=acpi to the kernel command line help?

Hello and thank you for your replay,

I performed the test with Wi-Fi and Bluetooth turned off. Please correct me if I did something wrong:

  1. I wrote it down in the terminal, then shut down the computer and unplugged the mouse and keyboard.

grubby --update-kernel /boot/vmlinuz-6.0.12-300.fc37.x86_64 --args=“reboot=acpi”

The computer turned on after about 10 seconds (in the case of a reboot, it does it immediately). I then deleted the entry:

grubby --update-kernel /boot/vmlinuz-6.0.12-300.fc37.x86_64 --remove-args=“reboot=acpi”

  1. Then I followed the same procedure with pci.

grubby --update-kernel /boot/vmlinuz-6.0.12-300.fc37.x86_64 --args=“reboot=pci”

The result was the same.

grubby --update-kernel /boot/vmlinuz-6.0.12-300.fc37.x86_64 --remove-args=“reboot=pci”

What can I do now?

Best regards,
Jakub

What you tried looks right to me. Sorry, if that didn’t work, then I’m out of ideas. It sounds like the 2015 era macs had buggy hardware.