02-06-2020, 08:49 PM
(02-06-2020, 08:06 PM)Jeremiah Cornelius Wrote: This is probably related to the same nvme issues I solved for Linux on the Macbook Pro, recently. The drive would "sleep" but then resume as read-only - with unpredictable effects!
The Macs don't support APST, and many nvme units also seem to be "idiosyncratic" about implementations. The fix is to "turn-off" the ability of the kernel to impose sleep states on hardware that does not conform.
After researching a bit about this, my solution was:
echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed
This is now featured on the authoritative Dunedan /mbp-2016-linux github: https://github.com/Dunedan/mbp-2016-linux
This needs to be done in a root shell, sudo user won't cut it. You can elevate by runing 'sudo su -' and have a root shell, without additional login process.
I'd seriously give this a shot, AFTER you determine with lspci the actual device number for your nvme.
If this solves your problem, I supplied scripts and a systemd service wrapper, so you may automate at boot:
https://github.com/cb22/macbook12-spi-dr...-540208177
Create this file:
Quote:/etc/systemd/system/fix_sleep.service
# systemd oneshot service to set sleep boolean on Apple Macbook Pro disks
# Original by Pier Lim. Posted at https://kerpanic.wordpress.com/2018/03/1...in-ubuntu/
[Unit]
Description=Job that disables sleep from stopping nvme hardware on MBP
[Service]
ExecStart=/sbin/fixsleep
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
And the actual script:
Quote:/sbin/fixsleep
#!/bin/bash
/bin/echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed
If you try this out, I'd love to hear how it goes.
My output from lspci:
Code:
00:00.0 PCI bridge: Device 1d87:0100
01:00.0 Non-Volatile memory controller: Intel Corporation Device f1a8 (rev 03)
Do I have to modify that command with this information somehow?