diff options
Diffstat (limited to 'drivers/dma/txx9dmac.c')
-rw-r--r-- | drivers/dma/txx9dmac.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c index 9aa9ea9822c8..88dab52926f4 100644 --- a/drivers/dma/txx9dmac.c +++ b/drivers/dma/txx9dmac.c | |||
@@ -432,23 +432,27 @@ txx9dmac_descriptor_complete(struct txx9dmac_chan *dc, | |||
432 | list_splice_init(&txd->tx_list, &dc->free_list); | 432 | list_splice_init(&txd->tx_list, &dc->free_list); |
433 | list_move(&desc->desc_node, &dc->free_list); | 433 | list_move(&desc->desc_node, &dc->free_list); |
434 | 434 | ||
435 | /* | ||
436 | * We use dma_unmap_page() regardless of how the buffers were | ||
437 | * mapped before they were submitted... | ||
438 | */ | ||
439 | if (!ds) { | 435 | if (!ds) { |
440 | dma_addr_t dmaaddr; | 436 | dma_addr_t dmaaddr; |
441 | if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) { | 437 | if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) { |
442 | dmaaddr = is_dmac64(dc) ? | 438 | dmaaddr = is_dmac64(dc) ? |
443 | desc->hwdesc.DAR : desc->hwdesc32.DAR; | 439 | desc->hwdesc.DAR : desc->hwdesc32.DAR; |
444 | dma_unmap_page(chan2parent(&dc->chan), dmaaddr, | 440 | if (txd->flags & DMA_COMPL_DEST_UNMAP_SINGLE) |
445 | desc->len, DMA_FROM_DEVICE); | 441 | dma_unmap_single(chan2parent(&dc->chan), |
442 | dmaaddr, desc->len, DMA_FROM_DEVICE); | ||
443 | else | ||
444 | dma_unmap_page(chan2parent(&dc->chan), | ||
445 | dmaaddr, desc->len, DMA_FROM_DEVICE); | ||
446 | } | 446 | } |
447 | if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) { | 447 | if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) { |
448 | dmaaddr = is_dmac64(dc) ? | 448 | dmaaddr = is_dmac64(dc) ? |
449 | desc->hwdesc.SAR : desc->hwdesc32.SAR; | 449 | desc->hwdesc.SAR : desc->hwdesc32.SAR; |
450 | dma_unmap_page(chan2parent(&dc->chan), dmaaddr, | 450 | if (txd->flags & DMA_COMPL_SRC_UNMAP_SINGLE) |
451 | desc->len, DMA_TO_DEVICE); | 451 | dma_unmap_single(chan2parent(&dc->chan), |
452 | dmaaddr, desc->len, DMA_TO_DEVICE); | ||
453 | else | ||
454 | dma_unmap_page(chan2parent(&dc->chan), | ||
455 | dmaaddr, desc->len, DMA_TO_DEVICE); | ||
452 | } | 456 | } |
453 | } | 457 | } |
454 | 458 | ||