Skip to content

Commit

Permalink
dmaengine: fsl_raid: move unmap to before callback
Browse files Browse the repository at this point in the history
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: Dave Jiang <[email protected]>
Cc: Xuelin Shi <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
davejiang authored and Vinod Koul committed Aug 8, 2016
1 parent 9b33597 commit a941106
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma/fsl_raid.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ static void fsl_re_issue_pending(struct dma_chan *chan)
static void fsl_re_desc_done(struct fsl_re_desc *desc)
{
dma_cookie_complete(&desc->async_tx);
dmaengine_desc_get_callback_invoke(&desc->async_tx, NULL);
dma_descriptor_unmap(&desc->async_tx);
dmaengine_desc_get_callback_invoke(&desc->async_tx, NULL);
}

static void fsl_re_cleanup_descs(struct fsl_re_chan *re_chan)
Expand Down

0 comments on commit a941106

Please sign in to comment.