Skip to contentSkip to conversation

nvme-pci: add NVME_QUIRK_DMAPOOL_ALIGN_512 for Micron 4100AT

PATCH Applied Bean Huo 2 participants 4 messages Sep 4 – Sep 11

Subsystems (2)
lore
Share & tools
lore

Bean Huo

author
#0 lore raw

PATCH 1/1 nvme-pci: add NVME_QUIRK_DMAPOOL_ALIGN_512 for Micron 4100AT

From: Bean Huo <[email protected]>

The Micron 4100AT fetches PRP Lists in 512 byte strides, but the driver allocates small PRP List descriptors in 256 byte strides. A descriptor in the last 256 bytes of a dmapool page makes the controller read past the page: the access lands on an adjacent IOVA, the IOMMU faults the command. That last block only became reachable with commit da9619a30e73 ("dmapool: link blocks across pages"), so this affects v6.4 and later.

Align the small descriptor pool to 512 bytes, as commit ebefac564796 ("nvme-pci: 512 byte aligned dma pool segment quirk") already does for another controller with the same erratum. The last block then starts at offset 0xE00 and the fetch stays inside the page.

Cc <[email protected]> # 6.4.x: ebefac564796: nvme-pci: 512 byte aligned dma pool segment quirk
Cc <[email protected]> # 6.4.x

---
Notes for reviewers (not part of the commit message):

* Why the two Cc: stable lines: this device needs the quirk from v6.4 on, but the quirk itself only exists from v6.13. Older trees, such as the 6.12 LTS where we found this, need ebefac564796 first. The first line asks stable to pick that commit before this one, and the second gives 6.4 as the starting version.

* Why no Fixes: tag: the only candidate is da9619a30e73, and that commit is not wrong. It fixed an off-by-one that had been hiding this device erratum. Blaming it did not seem fair, so we left the tag out. Happy to add one if the maintainers prefer.

drivers/nvme/host/pci.c +2 -0
index db5fc9bf6627..d6dec3ba41f4 100644
@@ -4141,6 +4141,8 @@ static const struct pci_device_id nvme_id_table[] = {
 		.driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN },
 	 { PCI_DEVICE(0x1344, 0x6001),   /* Micron Nitro NVMe */
 		 .driver_data = NVME_QUIRK_BOGUS_NID, },
+	{ PCI_DEVICE(0x1344, 0x6004),	/* Micron 4100AT */
+		.driver_data = NVME_QUIRK_DMAPOOL_ALIGN_512, },
 	{ PCI_DEVICE(0x1c5c, 0x1504),   /* SK Hynix PC400 */
 		.driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
 	{ PCI_DEVICE(0x1c5c, 0x174a),   /* SK Hynix P31 SSD */
Signature · 1 line
2.43.0
author
#1 lore raw

Hi,

A gentle ping on this one. It is a single id table entry for the Micron 4100AT, reusing the existing NVME_QUIRK_DMAPOOL_ALIGN_512.

Happy to respin if you would prefer a Fixes: tag, or a different form for the stable prerequisite lines.

Thanks,
Bean