dmaengine: ioat: Allocate correct size for descriptor chunk
authorLogan Gunthorpe <logang@deltatee.com>
Tue, 22 Sep 2020 20:08:44 +0000 (14:08 -0600)
committerVinod Koul <vkoul@kernel.org>
Mon, 5 Oct 2020 04:46:41 +0000 (10:16 +0530)
commit028926e4ac8f21af343c25794117fd13c08b1712
treea2006992c9040d85042243be74c22ed5e3025f5a
parentea275007c9473a7be66a47e0823482f6bd8aacd0
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 <robin.murphy@arm.com>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/intel-gfx/776771a2-247a-d1be-d882-bee02d919ae0@deltatee.com/
Link: https://lore.kernel.org/r/20200922200844.2982-1-logang@deltatee.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ioat/dma.c