diff options
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/dmatest.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 6be893baadd9..64b048d7fba7 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c | |||
@@ -367,15 +367,35 @@ static int dmatest_func(void *data) | |||
367 | 367 | ||
368 | dma_srcs[i] = dma_map_single(dev->dev, buf, len, | 368 | dma_srcs[i] = dma_map_single(dev->dev, buf, len, |
369 | DMA_TO_DEVICE); | 369 | DMA_TO_DEVICE); |
370 | ret = dma_mapping_error(dev->dev, dma_srcs[i]); | ||
371 | if (ret) { | ||
372 | unmap_src(dev->dev, dma_srcs, len, i); | ||
373 | pr_warn("%s: #%u: mapping error %d with " | ||
374 | "src_off=0x%x len=0x%x\n", | ||
375 | thread_name, total_tests - 1, ret, | ||
376 | src_off, len); | ||
377 | failed_tests++; | ||
378 | continue; | ||
379 | } | ||
370 | } | 380 | } |
371 | /* map with DMA_BIDIRECTIONAL to force writeback/invalidate */ | 381 | /* map with DMA_BIDIRECTIONAL to force writeback/invalidate */ |
372 | for (i = 0; i < dst_cnt; i++) { | 382 | for (i = 0; i < dst_cnt; i++) { |
373 | dma_dsts[i] = dma_map_single(dev->dev, thread->dsts[i], | 383 | dma_dsts[i] = dma_map_single(dev->dev, thread->dsts[i], |
374 | test_buf_size, | 384 | test_buf_size, |
375 | DMA_BIDIRECTIONAL); | 385 | DMA_BIDIRECTIONAL); |
386 | ret = dma_mapping_error(dev->dev, dma_dsts[i]); | ||
387 | if (ret) { | ||
388 | unmap_src(dev->dev, dma_srcs, len, src_cnt); | ||
389 | unmap_dst(dev->dev, dma_dsts, test_buf_size, i); | ||
390 | pr_warn("%s: #%u: mapping error %d with " | ||
391 | "dst_off=0x%x len=0x%x\n", | ||
392 | thread_name, total_tests - 1, ret, | ||
393 | dst_off, test_buf_size); | ||
394 | failed_tests++; | ||
395 | continue; | ||
396 | } | ||
376 | } | 397 | } |
377 | 398 | ||
378 | |||
379 | if (thread->type == DMA_MEMCPY) | 399 | if (thread->type == DMA_MEMCPY) |
380 | tx = dev->device_prep_dma_memcpy(chan, | 400 | tx = dev->device_prep_dma_memcpy(chan, |
381 | dma_dsts[0] + dst_off, | 401 | dma_dsts[0] + dst_off, |