]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nvme-pci: don't limit DMA segement size
authorChristoph Hellwig <hch@lst.de>
Wed, 5 Jun 2019 19:08:24 +0000 (21:08 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 5 Jun 2019 19:18:39 +0000 (13:18 -0600)
NVMe uses PRPs (or optionally unlimited SGLs) for data transfers and
has no specific limit for a single DMA segement.  Limiting the size
will cause problems because the block layer assumes PRP-ish devices
using a virt boundary mask don't have a segment limit.  And while this
is true, we also really need to tell the DMA mapping layer about it,
otherwise dma-debug will trip over it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Sebastian Ott <sebott@linux.ibm.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/pci.c

index f562154551ce71ee0eb222617de5f2411a99ee29..524d6bd6d0952eeaf78fa613f3542806a1d8b5de 100644 (file)
@@ -2513,6 +2513,12 @@ static void nvme_reset_work(struct work_struct *work)
         */
        dev->ctrl.max_hw_sectors = NVME_MAX_KB_SZ << 1;
        dev->ctrl.max_segments = NVME_MAX_SEGS;
+
+       /*
+        * Don't limit the IOMMU merged segment size.
+        */
+       dma_set_max_seg_size(dev->dev, 0xffffffff);
+
        mutex_unlock(&dev->shutdown_lock);
 
        /*