From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: James Bottomley <James.Bottomley@steeleye.com>
Cc: Linux Arch list <linux-arch@vger.kernel.org>
Subject: Re: More DMA API junk
Date: Tue, 16 Mar 2004 12:32:23 +1100 [thread overview]
Message-ID: <1079400742.1968.209.camel@gaston> (raw)
In-Reply-To: <1079399555.1804.232.camel@mulgrave>
On Tue, 2004-03-16 at 12:12, James Bottomley wrote:
> On Mon, 2004-03-15 at 19:53, Benjamin Herrenschmidt wrote:
> > - dma_is_consistent(dma_addr_t address) : Did somebody actually expect
> > anything useful out of this function ? AFAIK, it makes no sense. There
> > is simply no way an arch like ppc that use per-page cache-inhibit
> > mappings to do consistent memory will be able to tell you if a given
> > _DMA_ address is consistent... that makes no sense.
>
> > - dma_cache_sync(): What is that function supposed to do ? It's a
> > duplicate of the other sync() functions and David didn't even bother
> > turning it into _for_device/for_cpu... which is fine since it doesn't
> > even takes a struct device argument.
>
> They are both used. Look at section II of DMA-API.txt.cd ..
I've looked and I couldn't find a proper meaning for them.
> They have to do with incoherent platforms which I assume you don't have,
> but just leave them alone for those of use who are so burdened.
We do have incoherent PPCs (the embedded ones)
> Actually, I was planning to update dma_cache_sync to take a device and
> to conform to the new style (except I was thinking of an ownership flag
> rather than introducing two more APIs). The lack of device to
> dma_cache_sync is probably irrelevant since they only apply to older
> arch's which don't have bus caches.
How can dma_is_consistent() be implemented at all on an arch that
implement consistency by allocating non-cacheable space using PTE
bits ? we just cannot know if a given dma_addr_t is mapped by the
kernel using a cacheable or non-cacheable (or both) mapping.
Regarding dma_cache_sync(), I still don't understand what it means
and what it should be used for. We have dma_consistent_sync_*,
care to explain in which cases those aren't useable and one would
have to call dma_cache_sync() ?
Ben.
next prev parent reply other threads:[~2004-03-16 1:38 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 [this message]
2004-03-16 3:24 ` James Bottomley
2004-03-16 3:32 ` Benjamin Herrenschmidt
2004-03-16 3:48 ` James Bottomley
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=1079400742.1968.209.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=James.Bottomley@steeleye.com \
--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