Skip to content

Commit

Permalink
nds32: implement the unmap_sg DMA operation
Browse files Browse the repository at this point in the history
This matches the implementation of the more commonly used unmap_single
routines and the sync_sg_for_cpu method which should provide equivalent
cache maintainance.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Greentime Hu <greentime@andestech.com>
Tested-by: Greentime Hu <greentime@andestech.com>
  • Loading branch information
Christoph Hellwig committed May 29, 2018
1 parent 4ac1c68 commit f860122
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/nds32/kernel/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,12 @@ static void nds32_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
int nhwentries, enum dma_data_direction dir,
unsigned long attrs)
{
int i;

for (i = 0; i < nhwentries; i++, sg++) {
nds32_dma_sync_single_for_cpu(dev, sg_dma_address(sg),
sg->length, dir);
}
}

struct dma_map_ops nds32_dma_ops = {
Expand Down

0 comments on commit f860122

Please sign in to comment.