From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: About dma_sync_single_for_{cpu,device}
Date: Tue, 31 Jul 2012 21:08:55 +0100 [thread overview]
Message-ID: <20120731200855.GC10335@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CACYmx9MnEn_XOosBn2-YJ=ny9FiLPADMNa6okwG08xrSpCUSpA@mail.gmail.com>
On Tue, Jul 31, 2012 at 09:31:13PM +0200, Karl Beldan wrote:
> On 7/31/12, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> > On Tue, Jul 31, 2012 at 08:45:57AM +0200, Karl Beldan wrote:
> >> I was expecting the following to work:
> >> addr = dma_map_single(dev, buffer, size, DMA_TO_DEVICE);
> >> dma_sync_single_for_device(dev, buffer, pattern_size, DMA_FROM_DEVICE);
> >> dev_send(buffer);
> >> // wait for irq (don't peek in the buffer) ... got irq
> >> dma_sync_single_for_cpu(dev, buffer, pattern_size, DMA_FROM_DEVICE);
> >> if (!xfer_done(buffer)) // not RAM value
> >> dma_sync_single_for_device(dev, buffer, pattern_size, DMA_FROM_DEVICE);
> >> [...]
> >
>
> Hi Russell,
>
>
> > First point is that you clearly do not understand the DMA API at all. The
> > DMA API has the idea of buffer ownership. Only the owner may access the
> > buffer:
> >
> Are you saying that this scenario does not work ?
> We are taking some liberties with the DMA API, we're more using some
> of its funcs rather than _using_ it ;).
> The question was not whether this was a proper usage of the API, but
> why that scenario would not lead to the expected results .. and now
> I've found the culprit peek I am happy.
If you abuse the API don't expect your stuff to work in future kernel
versions.
It seems that the overall tone of your reply is "what we have now works,
we don't care if it's correct, sod you."
Fine, I won't spend any more time on this. Just don't ever think about
merging it into mainline, thanks.
next prev parent reply other threads:[~2012-07-31 20:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120730202401.GA4947@gobelin>
2012-07-31 6:45 ` About dma_sync_single_for_{cpu,device} Karl Beldan
2012-07-31 6:59 ` Clemens Ladisch
2012-07-31 7:27 ` Karl Beldan
2012-07-31 7:34 ` Clemens Ladisch
2012-07-31 8:30 ` Karl Beldan
2012-07-31 9:09 ` Russell King - ARM Linux
2012-07-31 19:31 ` Karl Beldan
2012-07-31 20:08 ` Russell King - ARM Linux [this message]
2012-08-01 6:50 ` Karl Beldan
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=20120731200855.GC10335@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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).