Suspend with NVME not working - Default Debian
#6
(07-12-2020, 01:47 AM)johnny89 Wrote:
(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.

****

Hi Jeremiah,

Your suggestion works on imac models that have unofficial nvme setup running Debian. Do you have knowledge as to implementing same mechanism in macos since the issue is ongoing there as well. setpci maybe?  Any clues?

Thanks,
I'm afraid I'm way more familiar with being able to tinker with kernel internals of Linux, than MacOS.
— Jeremiah Cornelius
"Be the first person not to do some­thing, that no one has thought of not doing before’’
— Brian Eno, "Oblique Strategies"


Messages In This Thread
RE: Suspend with NVME not working - Default Debian - by Jeremiah Cornelius - 07-14-2020, 01:53 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Selling my Pinebook Pro with a bootable NVMe WD SSD drive pinemouth 0 1,068 09-27-2023, 08:53 PM
Last Post: pinemouth
  Boot into NVME drive, no wifi, sound, buttons... PaulQ 0 1,084 07-13-2023, 01:50 PM
Last Post: PaulQ
  Games compilation howto on the Pinebook-pro (Manjaro Linux and Debian native) astr0baby 201 354,815 05-12-2023, 06:09 AM
Last Post: korreckj328
  I'm booting from NVME but I want to switch back to eMMC acruhl 4 2,199 04-23-2023, 06:58 AM
Last Post: acruhl
  bliuetooth not working in Armbian 22.11.1 Pinebook Pro River 0 984 12-09-2022, 04:48 PM
Last Post: River
  Installing Debian using files only from debian.org and encrypted root filesystem omarcomputing 0 1,005 10-08-2022, 11:03 AM
Last Post: omarcomputing
  U-Boot with direct NVMe boot support for eMMC/SPI Flash pcm720 125 238,551 09-27-2022, 07:41 AM
Last Post: olyavi
  Use SD to install new OS over pinebook debian Rudy558 9 12,596 09-25-2022, 01:19 AM
Last Post: jackwilson
  Mid 2022: what is in your humble opinion the best working OS for the PinePro? walterbe 3 3,165 06-29-2022, 02:00 PM
Last Post: Chief
  Selling Pinebook Pro (ISO) + nvme from Sweden DavidL 5 4,064 06-20-2022, 03:20 PM
Last Post: DavidL

Forum Jump:


Users browsing this thread: 1 Guest(s)