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

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

dmaengine: ppc4xx/adma: 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>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 8058e258
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1482,11 +1482,11 @@ static dma_cookie_t ppc440spe_adma_run_tx_complete_actions(
		cookie = desc->async_tx.cookie;
		cookie = desc->async_tx.cookie;
		desc->async_tx.cookie = 0;
		desc->async_tx.cookie = 0;


		dma_descriptor_unmap(&desc->async_tx);
		/* call the callback (must not sleep or submit new
		/* call the callback (must not sleep or submit new
		 * operations to this channel)
		 * operations to this channel)
		 */
		 */
		dmaengine_desc_get_callback_invoke(&desc->async_tx, NULL);
		dmaengine_desc_get_callback_invoke(&desc->async_tx, NULL);
		dma_descriptor_unmap(&desc->async_tx);
	}
	}


	/* run dependent operations */
	/* run dependent operations */