diff options
author | Logan Gunthorpe <[email protected]> | 2020-09-22 14:08:44 -0600 |
---|---|---|
committer | Vinod Koul <[email protected]> | 2020-10-05 10:16:41 +0530 |
commit | 028926e4ac8f21af343c25794117fd13c08b1712 (patch) | |
tree | a2006992c9040d85042243be74c22ed5e3025f5a | |
parent | ea275007c9473a7be66a47e0823482f6bd8aacd0 (diff) |
dmaengine: ioat: Allocate correct size for descriptor chunk
dma_alloc_coherent() is called with a fixed SZ_2M size, but frees happen
with IOAT_CHUNK_SIZE. Recently, IOAT_CHUNK_SIZE was reduced to 512M but
the allocation did not change. To fix, change to using the
IOAT_CHUNK_SIZE define.
This was caught with the upcoming patchset for converting Intel platforms to the
dma-iommu implementation. It has a warning when the unmapped size differs from
the mapped size.
Fixes: a02254f8a676 ("dmaengine: ioat: Decreasing allocation chunk size 2M->512K")
Suggested-by: Robin Murphy <[email protected]>
Signed-off-by: Logan Gunthorpe <[email protected]>
Acked-by: Dave Jiang <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: Dave Jiang <[email protected]>
Cc: Dan Williams <[email protected]>
Link: https://lore.kernel.org/intel-gfx/[email protected]/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
-rw-r--r-- | drivers/dma/ioat/dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c index 736b2658245f..37ff4ec7db76 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c @@ -389,7 +389,7 @@ ioat_alloc_ring(struct dma_chan *c, int order, gfp_t flags) struct ioat_descs *descs = &ioat_chan->descs[i]; descs->virt = dma_alloc_coherent(to_dev(ioat_chan), - SZ_2M, &descs->hw, flags); + IOAT_CHUNK_SIZE, &descs->hw, flags); if (!descs->virt) { int idx; |