From: James Bottomley <James.Bottomley@SteelEye.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linux Arch list <linux-arch@vger.kernel.org>
Subject: Re: More DMA API junk
Date: 15 Mar 2004 22:48:48 -0500 [thread overview]
Message-ID: <1079408930.2158.408.camel@mulgrave> (raw)
In-Reply-To: <1079407959.2348.226.camel@gaston>
On Mon, 2004-03-15 at 22:32, Benjamin Herrenschmidt wrote:
> So dma_cache_sync() is specifically for use on space returned
> by dma_alloc_noncoherent (and not dma_map_*).
Yes.
> So on a platform
> like mine where we use non-cacheable memory for allocating coherent
> space, we can indeed nop this one out. But then, is this also the
> case for dma_sync_single_range() which seem to be documented as
> beeing part of the "non-coherent" extension to the DMA API ? In
> which case, where is the difference between
> dma_sync_single_range() and dma_cache_sync()
dma_sync_single_range is an extension of dma_sync_single that allows you
only to do a partial sync (because on platforms like PA, syncs grow in
expense linearly with size). So, if you're snooping data in a ten page
mapping, and you're only interested in sixteen bytes, you only need sync
those sixteen bytes.
On your platform, dma_sync_single_range() has a defined meaning for
streaming mappings. dma_cache_sync will be a nop, so they're not
interchangeable.
> That is confusing then. We should remove this dma_addr_t argument,
> as there is no simple way for me to tell from a physical address if
> that was mapped in kernel space as cacheable or non-cacheable.
You're confused about what it's used for. It's designed only to be
called on memory allocated by dma_alloc_noncoherent() and tells you if
that API actually returned coherent memory or not. This was designed
for ARM which has a limited range of allocateable coherent memory and
then would need to fail dma_alloc_coherent() or, in the case of
dma_alloc_noncoherent() begin handing out ordinary kmalloc'd memory.
James
next prev parent reply other threads:[~2004-03-16 3:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-16 0:53 More DMA API junk Benjamin Herrenschmidt
2004-03-16 1:12 ` James Bottomley
2004-03-16 1:32 ` Benjamin Herrenschmidt
2004-03-16 3:24 ` James Bottomley
2004-03-16 3:32 ` Benjamin Herrenschmidt
2004-03-16 3:48 ` James Bottomley [this message]
2004-03-16 3:53 ` Benjamin Herrenschmidt
2004-03-16 11:17 ` Ralf Baechle
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=1079408930.2158.408.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=benh@kernel.crashing.org \
--cc=linux-arch@vger.kernel.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