Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd3c69bd authored by Dave Jiang's avatar Dave Jiang Committed by Vinod Koul
Browse files

dmaengine: xgene-dma: move unmap to before callback



Completion callback should happen after dma_descriptor_unmap() has
happened. This allow the cache invalidate to happen and ensure that
the data accessed by the upper layer is in memory that was from DMA
rather than stale data. On some architecture this is done by the
hardware, however we should make the code consistent to not cause
confusion.

Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
Cc: Rameshwar Prasad Sahu <rsahu@apm.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent ed9f2c58
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -606,12 +606,11 @@ static void xgene_dma_run_tx_complete_actions(struct xgene_dma_chan *chan,
		return;
		return;


	dma_cookie_complete(tx);
	dma_cookie_complete(tx);
	dma_descriptor_unmap(tx);


	/* Run the link descriptor callback function */
	/* Run the link descriptor callback function */
	dmaengine_desc_get_callback_invoke(tx, NULL);
	dmaengine_desc_get_callback_invoke(tx, NULL);


	dma_descriptor_unmap(tx);

	/* Run any dependencies */
	/* Run any dependencies */
	dma_run_dependencies(tx);
	dma_run_dependencies(tx);
}
}