Skip to content

Commit 028926e

Browse files
lsgunthvinodkoul
authored andcommitted
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: a02254f ("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]>
1 parent ea27500 commit 028926e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/ioat/dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ ioat_alloc_ring(struct dma_chan *c, int order, gfp_t flags)
389389
struct ioat_descs *descs = &ioat_chan->descs[i];
390390

391391
descs->virt = dma_alloc_coherent(to_dev(ioat_chan),
392-
SZ_2M, &descs->hw, flags);
392+
IOAT_CHUNK_SIZE, &descs->hw, flags);
393393
if (!descs->virt) {
394394
int idx;
395395

0 commit comments

Comments
 (0)