summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJianxiong Gao <jxgao@google.com>2021-04-29 17:33:15 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-07 11:11:24 +0200
commit035d408d136852ef6faeb7c17ade5b6b7d8115a4 (patch)
treefbc5da9dffee72b105d7775b08ea1bd29883e538
parentfd1feb280dfa47f9d141cbe32af5d3d9e99dcf5a (diff)
downloadlinux-stable-035d408d136852ef6faeb7c17ade5b6b7d8115a4.tar.gz
linux-stable-035d408d136852ef6faeb7c17ade5b6b7d8115a4.tar.bz2
linux-stable-035d408d136852ef6faeb7c17ade5b6b7d8115a4.zip
nvme-pci: set min_align_mask
commit: 3d2d861eb03e8ee96dc430a54361c900cbe28afd 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 <jxgao@google.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Jianxiong Gao <jxgao@google.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/nvme/host/pci.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 514dfd630035..999378fb4d76 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2629,6 +2629,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);