From: Angela Stegmaier Date: Fri, 13 Sep 2019 19:47:09 +0000 (-0500) Subject: TEMP: remoteproc: call the non-zeroing allocation function X-Git-Url: https://git.ti.com/gitweb?p=rpmsg%2Frpmsg.git;a=commitdiff_plain;h=ad2d6e0114687f7a94af4f25b6657b09c5475528 TEMP: remoteproc: call the non-zeroing allocation function For DMA pool scenario the plugged in allocation ops are not used for carveout allocation. It is necessary to call a differnt function that does not zero the DMA pool memory gotten from the call to dma_alloc_coherent. Call the dma_malloc_coherent (non-zeroing) api in the case of late attach to guarantee that the memory is not zero-ed for either a CMA or DMA pool. The memory for virtio rings is not used in U-Boot, so need not use the non-zeroing function. Signed-off-by: Angela Stegmaier Signed-off-by: Shravan Karthik Signed-off-by: Suman Anna --- diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index aba45c21ea47..128e7d6ace0c 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -796,7 +796,13 @@ static int rproc_handle_carveout(struct rproc *rproc, if (!carveout) return -ENOMEM; - va = dma_alloc_coherent(dev->parent, rsc->len, &dma, GFP_KERNEL); + if (rproc->late_attach) { + va = dma_malloc_coherent(dev->parent, rsc->len, &dma, + GFP_KERNEL); + } else { + va = dma_alloc_coherent(dev->parent, rsc->len, &dma, + GFP_KERNEL); + } if (!va) { dev_err(dev->parent, "failed to allocate dma memory: len 0x%x\n", rsc->len);