[PATCH] nvme-pci: use simple suspend for the Apple T2 ANS2 controller
willy at willyv3.com
willy at willyv3.com
Sat Sep 5 20:14:49 PDT 2026
From: Willy VanSickle <vansicklewilly at gmail.com>
Subject: [PATCH] nvme-pci: use simple suspend for the Apple T2 ANS2 controller
On T2 Macs the ANS2 NVMe controller (106b:2005) is owned by the T2
coprocessor. With suspend-to-idle the driver keeps the controller in an
NVMe power state across sleep instead of shutting it down, because
pm_suspend_via_firmware() is false. The T2 does not preserve that state:
after the first resume the controller stops completing I/O, and the next
suspend hangs in ksys_sync_helper() before it can even freeze processes
(MacBookPro15,3, 7.2.2 + t2linux patches; the machine then drains its
battery while hung).
Give the ANS2 NVME_QUIRK_SIMPLE_SUSPEND so suspend always goes through
nvme_disable_prepare_reset() and resume brings the controller back with a
full reset, which is what the T2 expects.
Signed-off-by: Willy VanSickle <vansicklewilly at gmail.com>
---
Tested on a MacBookPro15,3 (ANS2 106b:2005) running 7.2.2 with the t2linux
patch set. Without the quirk the second suspend hangs in ksys_sync_helper();
with it suspend/resume completes and the controller keeps serving I/O.
drivers/nvme/host/pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -4283,6 +4283,7 @@
.driver_data = NVME_QUIRK_SINGLE_VECTOR |
NVME_QUIRK_128_BYTES_SQES |
NVME_QUIRK_SHARED_TAGS |
+ NVME_QUIRK_SIMPLE_SUSPEND |
NVME_QUIRK_SKIP_CID_GEN |
NVME_QUIRK_IDENTIFY_CNS },
{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
More information about the Linux-nvme
mailing list