From: John Williams <john.williams@petalogix.com>
To: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Cc: arnd@arndb.de, linux-arch@vger.kernel.org,
John Linn <linnj@xilinx.com>,
matthew@wil.cx, will.newton@gmail.com, drepper@redhat.com,
microblaze-uclinux@itee.uq.edu.au, grant.likely@secretlab.ca,
Michal Simek <monstr@monstr.eu>,
linux-kernel@vger.kernel.org
Subject: RE: [PATCH] Microblaze: implement dma-coherent API and refactorcache flush code.
Date: Tue, 06 May 2008 10:14:59 +1000 [thread overview]
Message-ID: <1210032899.5798.179.camel@localhost> (raw)
In-Reply-To: <20080505231206.922A61C780C0@mail19-wa4.bigfish.com>
> > Does the DMA API insist upon the dma_cache_sync call to guarantee
> > sensible results? If so, your implementation looks fine. If not,
> then
> > the results will clearly be bogus as there's nothing magical about the
> > memory being allocated in dma_alloc.
>
> Yes, in fact this is one of the keys to getting the lltemac driver to
> work right. see Documentation/DMA-API.txt
>
> > To that end, can it just call kmalloc(), and similarly kfree() for
> > dma_free?
>
> My understanding is that on other architectures (x86, for instance)
> 'dma' memory ensures other things, like it's accessible in PCI memory
> space. On microblaze, there's nothing really special about dma memory,
> but you get the API as a chunk.
Sure - what I meant is can dma_alloc just call kmalloc to do it's work?
> > I'd still like to see the uncached shadow stuff make a return one day,
> > it is an effective way of solving the problem, we'll just need to find
> a
> > cleaner way to implement it. A linear walk through the cache to
> > invalidate is so slow, it destroys any benefit gained from DMA in the
> > first place.
>
> I think it's definitely a simple way of solving the problem (in fact,
> the version of the code that's currently at git.xilinx.com includes it).
> Would it be better dealt with at the page level, rather than at the
> address level, then one of the architecture-reserved flags could be used
> for it?
> If it really does have value, then I want to make sure it goes in, along
> with bits in EDK that make it straightforward to use. For me, the
> biggest barrier to using it is understanding exactly what assumptions it
> is making on the hardware, and making those assumptions bulletproof.
I agree. Michal did some work on that when he did the initial DTS stuff
with us over the (southern) summer this year. We looked at ways to
validate the HW design and Kconfig params to make sure that
uncached_shadow worked as expected.
If forget now the outcome, there's plenty of ways to get it wrong.
It would be easy at runtime to do some validation tests - write to a
pointer, cache flush (noop..), read back from the twiddled pointer, make
sure it matches. Repeat a few times until you're happy it wasn't a
fluke, that sort of thing.
John
>
> Steve
>
>
--
John Williams, PhD, B.Eng, B.IT
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663 f: +61-7-30090663
next prev parent reply other threads:[~2008-05-06 0:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-05 22:37 [PATCH] Microblaze: implement dma-coherent API and refactor cache flush code Stephen Neuendorffer
2008-05-05 22:37 ` Stephen Neuendorffer
2008-05-05 22:57 ` John Williams
2008-05-05 23:12 ` [PATCH] Microblaze: implement dma-coherent API and refactorcache " Stephen Neuendorffer
2008-05-06 0:14 ` John Williams [this message]
2008-05-06 0:31 ` [PATCH] Microblaze: implement dma-coherent API andrefactorcache " Stephen Neuendorffer
2008-05-06 7:23 ` Geert Uytterhoeven
2008-05-06 9:33 ` Michal Simek
2008-05-06 9:28 ` [PATCH] Microblaze: implement dma-coherent API and refactor cache " Michal Simek
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=1210032899.5798.179.camel@localhost \
--to=john.williams@petalogix.com \
--cc=arnd@arndb.de \
--cc=drepper@redhat.com \
--cc=grant.likely@secretlab.ca \
--cc=linnj@xilinx.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=microblaze-uclinux@itee.uq.edu.au \
--cc=monstr@monstr.eu \
--cc=stephen.neuendorffer@xilinx.com \
--cc=will.newton@gmail.com \
/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