Skip to contentSkip to conversation

dmaengine: ioat: Allocate correct size for descriptor chunk

PATCH Applied Logan Gunthorpe 3 participants 3 messages Sep 22, 2020 – Oct 5, 2020 dmaengine

lore
Share & tools
lore
Acked-by on v1 1/1
#1 lore raw
In reply to Logan Gunthorpe
Quoted 9 lines · Logan Gunthorpe

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.

Quoted 7 lines
Fixes a02254f8a676 ("dmaengine: ioat: Decreasing allocation chunk size 2M->512K")
Cc Vinod Koul <[email protected]>
Cc Dave Jiang <[email protected]>
Cc Dan Williams <[email protected]>

Thanks Logan.

Quoted 20 lines
---
  drivers/dma/ioat/dma.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/ioat/dma.c +1 -1
index a814b200299b..07296171e2bb 100644
@@ -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;
 

base-commit: ba4f184e126b751d1bffad5897f263108befc780

#0 lore raw

PATCH 1/1 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")
Cc Vinod Koul <[email protected]>
Cc Dave Jiang <[email protected]>
Cc Dan Williams <[email protected]>
---
 drivers/dma/ioat/dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/ioat/dma.c +1 -1
index a814b200299b..07296171e2bb 100644
@@ -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;
 

base-commit: ba4f184e126b751d1bffad5897f263108befc780

Signature · 1 line
2.20.1
maintainer Applied
#2 lore raw
Quoted 8 lines · Logan Gunthorpe

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.

Applied, thanks

Signature · 1 line
~Vinod