You are not logged in.
Hi all,
I'm trying to fix an issue with my MacBook in which the NVMe will not wake from sleep properly.
I've tried to implement the fix outlined on various other forums for different distros, and also here. I had this working previously on the same device under Kubuntu, using a cronjob that ran @reboot. The specific fix is to run the command echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed as root. Said file's content seems to get changed back to "1" every restart.
Now that the laptop in question has Arch on it, I have attempted to use systemd to solve the same problem. To that end, I created a file named nvmefix.service in /etc/systemd/system with the following contents:
[Unit]
Description=Script to fix NVMe resume/sleep issues
[Service]
ExecStart=/usr/bin/d3cold_allowed
[Install]
WantedBy=multi-user.target
And a file named d3cold_allowed in /usr/bin containing the following:
echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed
This file has had a chmod 755 done to it. And I have run sudo systemctl start nvmefix and sudo systemctl enable nvmefix commands without any apparent errors.
Checking the /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed file after logon, it still shows up as containing a "1". If I run the command manually, then it works fine.
Can anyone see what I'm doing wrong here?
Thanks,
Ben
Last edited by teescdf (2024-06-20 08:41:16)
Offline
Some power management daemon might still write the file?
If it's only relevant for resuming from S3, write it before the S3:
https://wiki.archlinux.org/title/Power_ … stem-sleep
Offline
Thank for the quick response. There's some really informative stuff in the link you shared, so thanks for that, much appreciated!
As it happens, I fixed things...I had simply forgotten to include "#!/bin/sh" at the start of the script file. Added that and all appears to be working properly!
Offline
\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline
Done, thanks for the prompt!
And... given the error I made, and for anyone looking for the (complete and working) solution for this issue, do the following:
Create a file named nvmefix.service in /etc/systemd/system with the following contents:
[Unit]
Description=Script to fix NVMe resume/sleep issues
[Service]
ExecStart=/usr/bin/d3cold_allowed
[Install]
WantedBy=multi-user.target
Now create a file named d3cold_allowed in /usr/bin containing the following
#!/bin/sh
echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed
Now run the following command to make the script executable:
chmod 755 /usr/bin/d3cold_allowed
Finally, run the following 2 commands:
sudo systemctl start nvmefix
sudo systemctl enable nvmefix
After a reboot, you should be able to read the contents of the d3cold_allowed file with the following command, and check that it does, in fact contain a "0":
cat /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed
Last edited by teescdf (2024-06-20 08:48:54)
Offline
Done, thanks for the prompt!
And... given the error I made, and for anyone looking for the (complete and working) solution for this issue, do the following:
Create a file named nvmefix.service in /etc/systemd/system with the following contents:
[Unit] Description=Script to fix NVMe resume/sleep issues [Service] ExecStart=/usr/bin/d3cold_allowed [Install] WantedBy=multi-user.target
Now create a file named d3cold_allowed in /usr/bin containing the following
#!/bin/sh echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed
Now run the following command to make the script executable:
chmod 755 /usr/bin/d3cold_allowed
Finally, run the following 2 commands:
sudo systemctl start nvmefix sudo systemctl enable nvmefix
After a reboot, you should be able to read the contents of the d3cold_allowed file with the following command, and check that it does, in fact contain a "0":
cat /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed
Hi, did you do anything else to make suspend work? I have 0 returned, so it works, but the laptop cannot wake up from suspend -- nothing happens, just black screen.
thanks!
Offline