lkml.org 
[lkml]   [2013]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] dma: mv_xor: do not sync the DMA buffer after being deallocated
Dear Lubomir Rintel,

On Thu, 27 Dec 2012 20:23:48 +0100, Lubomir Rintel wrote:

> dma_sync_single_for_cpu(dma_chan->device->dev, dest_dma,
> MV_XOR_TEST_SIZE, DMA_FROM_DEVICE);
> + dma_unmap_single(dma_chan->device->dev, dest_dma, MV_XOR_TEST_SIZE,
> + DMA_FROM_DEVICE);

I would assume that dma_unmap_single() implies a
dma_sync_single_for_cpu() since you're unmapping the DMA buffer. So if
you use dma_unmap_single(), I think you can remove the call to
dma_sync_single_for_cpu().


> dma_sync_single_for_cpu(dma_chan->device->dev, dest_dma,
> PAGE_SIZE, DMA_FROM_DEVICE);
> + dma_unmap_page(dma_chan->device->dev, dest_dma, PAGE_SIZE,
> + DMA_FROM_DEVICE);

Ditto.

Also, the mv_xor_memcpy_self_test() function not only dma_map_single()
the destination buffer, but also the source buffer. So presumably, the
source buffer should also be dma_unmap_single()'d.

And for the mv_xor_xor_self_test() function, multiple source buffers
are dma_map_page()'d, so they should all be dma_unmap_page()'d I guess,
not only the destination buffer.

Does that make sense?

Thanks,

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com


\
 
 \ /
  Last update: 2013-01-04 18:01    [W:0.079 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site