Thread (17 messages) 17 messages, 3 authors, 2021-05-20
STALE1866d REVIEWED: 1 (0M)
Revisions (2)
  1. v2 [diff vs current]
  2. v2 current

[PATCH 5.4 v2 9/9] nvme-pci: set min_align_mask

From: Jianxiong Gao <hidden>
Date: 2021-05-18 22:19:45
Subsystem: nvm express driver, the rest · Maintainers: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg, Linus Torvalds

The PRP addressing scheme requires all PRP entries except for the
first one to have a zero offset into the NVMe controller pages (which
can be different from the Linux PAGE_SIZE).  Use the min_align_mask
device parameter to ensure that swiotlb does not change the address
of the buffer modulo the device page size to ensure that the PRPs
won't be malformed.

Signed-off-by: Jianxiong Gao <redacted>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Jianxiong Gao <redacted>
Signed-off-by: Konrad Rzeszutek Wilk <redacted>

Upstream: 3d2d861eb03e8ee96dc430a54361c900cbe28afd
Signed-off-by: Jianxiong Gao <redacted>
---
 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
index 3bee3724e9fa..0fe86858f39c 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2628,6 +2628,7 @@ static void nvme_reset_work(struct work_struct *work)
 	 * Don't limit the IOMMU merged segment size.
 	 */
 	dma_set_max_seg_size(dev->dev, 0xffffffff);
+	dma_set_min_align_mask(dev->dev, NVME_CTRL_PAGE_SIZE - 1);
 
 	mutex_unlock(&dev->shutdown_lock);
 
-- 
2.31.1.751.gd2f1c929bd-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help