nvme-pci: Add NVME_QUIRK_IDENTIFY_CNS quirk to Apple T2 controllers

Message ID 20230104101641.12215-1-marcan@marcan.st
State New
Headers
Series nvme-pci: Add NVME_QUIRK_IDENTIFY_CNS quirk to Apple T2 controllers |

Commit Message

Hector Martin Jan. 4, 2023, 10:16 a.m. UTC
  This mirrors the quirk added to Apple Silicon controllers in apple.c.
These controllers do not support the Active NS ID List command and
behave identically to the SoC version judging by existing user
reports/syslogs, so will need the same fix. This quirk reverts
back to NVMe 1.0 behavior and disables the broken commands.

Fixes: 811f4de0344d ("nvme: avoid fallback to sequential scan due to transient issues")
Signed-off-by: Hector Martin <marcan@marcan.st>
---
 drivers/nvme/host/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Note: this is untested (since probably nobody with a T2 is running
6.2 RCs yet), but given that these controllers share the same firmware
codebase and some other quirks, it is almost certain they regressed
just like the M1/M2 controllers did. Existing syslogs from T2 machines
show the same errors we were getting on M1/M2 prior to the regression,
which points to them having the same issue of treating CNS as a binary
flag as in NVMe 1.0 all along.

Sven has asked some of the T2 folks if they can test a 6.2 RC to verify
the same regression happened, so hopefully we can get confirmation that
this needs fixing (and the fix works), but if we end up getting no
feedback I'd lean towards just getting this applied as a fix since it's
unlikely to break anything and highly likely to fix a regression.

--
2.35.1
  

Comments

Orlando Chamberlain Jan. 4, 2023, 12:03 p.m. UTC | #1
> This mirrors the quirk added to Apple Silicon controllers in apple.c.
> These controllers do not support the Active NS ID List command and
> behave identically to the SoC version judging by existing user
> reports/syslogs, so will need the same fix. This quirk reverts
> back to NVMe 1.0 behavior and disables the broken commands.
>
> Fixes: 811f4de0344d ("nvme: avoid fallback to sequential scan due to transient issues")
> Signed-off-by: Hector Martin <marcan@marcan.st>

On T2 macbookpro16,1 with 6.2.0-rc3-00010-g69b41ac87e4a I had this in
dmesg:

nvme nvme0: 1/0/0 default/read/poll queues
nvme nvme0: Identify NS List failed (status=0xb)

And in /dev only nvme0 existed (no nvme0n1*).

This patch fixed that and /dev/nvme0n1p* existed.

Tested-by: Orlando Chamberlain <orlandoch.dev@gmail.com>
  

Patch

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index b13baccedb4a..91f8adcf6056 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3495,7 +3495,8 @@  static const struct pci_device_id nvme_id_table[] = {
 		.driver_data = NVME_QUIRK_SINGLE_VECTOR |
 				NVME_QUIRK_128_BYTES_SQES |
 				NVME_QUIRK_SHARED_TAGS |
-				NVME_QUIRK_SKIP_CID_GEN },
+				NVME_QUIRK_SKIP_CID_GEN |
+				NVME_QUIRK_IDENTIFY_CNS },
 	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
 	{ 0, }
 };