From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] dma: mv_xor: do not sync the DMA buffer after being deallocated
Date: Fri, 4 Jan 2013 17:10:33 +0100 [thread overview]
Message-ID: <20130104171033.4a244c3d@skate> (raw)
In-Reply-To: <1356636228-23096-2-git-send-email-lkundrak@v3.sk>
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
next prev parent reply other threads:[~2013-01-04 16:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-27 19:23 [PATCH 1/2] dma: mv_xor: use proper dma memory management functions Lubomir Rintel
2012-12-27 19:23 ` [PATCH 2/2] dma: mv_xor: do not sync the DMA buffer after being deallocated Lubomir Rintel
2013-01-04 16:10 ` Thomas Petazzoni [this message]
2013-01-13 13:18 ` Lubomir Rintel
2013-01-18 7:45 ` Lubomir Rintel
2013-01-18 7:46 ` [PATCH 1/3] " Lubomir Rintel
2013-01-18 7:46 ` [PATCH 2/3] dma: mv_xor: fix DMA-API error handling sanity check Lubomir Rintel
2013-01-18 7:46 ` [PATCH 3/3] dma: mv_xor: get rid of a DMA-API sanity check warning Lubomir Rintel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130104171033.4a244c3d@skate \
--to=thomas.petazzoni@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).