From: Clifford Wolf <clifford@clifford.at>
To: linuxppc-embedded@ozlabs.org, Arnd Bergmann <arnd@arndb.de>
Subject: Re: Mem-2-Mem DMA - Generalized API
Date: Wed, 11 Jul 2007 11:35:34 +0200 [thread overview]
Message-ID: <20070711093534.GA6366@clifford.at> (raw)
In-Reply-To: <200707071508.04143.arnd@arndb.de>
Hi again,
The updated status of my DMA Transfer API can be found at:
http://www.clifford.at/priv/dmatransfer-20070711.diff
I have incorporated your feedback and would appreciate if you could have
another look over the updated sourcecode. Changes include:
- Many cosmetic / coding style related changes
- Added MPC3494 Scatter/Gather DMA Support
- Added a 'softdma' driver providing software emulation
- Added DMATRANSFER_MAYFAIL flag, panic() if a DMA Transfer without
this flag set fails.
- Added /proc/dmatransfer with statistic data
I also have two questions. In the my current source there is the following
hack:
--snip--
wmb();
dma_cache_wback_inv(sg_list, sizeof(struct chain_desc) * segment_n);
#if 1
/* FIXME: dma_cache_wback_inv() should have done this already! */
{
void *p = sg_list;
while (p < ((void*)sg_list) +
sizeof(struct chain_desc) * segment_n) {
__asm__ __volatile__ ("dcbf 0,%0" : : "r" (p));
p += 4;
}
__asm__ __volatile__ ("sync");
}
#endif
--snap--
In my understanding, dma_cache_wback_inv() should do exactly the same thing
as my loop with PowerPC inline assembly. However, if I change the '#if 1'
to '#if 0' in this source it stopps working.
What am I doing wrong? What function should I use instead of
dma_cache_wback_inv() in this place?
> BUG() may be a little harsh here, especially since you are holding spinlocks.
> It would be better to try to recover here, unless you expect actual data
> corruption, in which case a full panic() might be more appropriate.
So what exactly would be the correct usecase of BUG() over panic()?
My impressions was that BUG() would be the right choice for errors coming
from bad programming while panic() would be for errors coming from bad
hardware.
yours,
- clifford
--
For extra security, this message has been encrypted with double-ROT13.
prev parent reply other threads:[~2007-07-11 9:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-24 19:39 Mem-2-Mem DMA - Generalized API Clifford Wolf
2007-06-24 20:21 ` Arnd Bergmann
2007-06-25 8:03 ` Clifford Wolf
2007-06-25 11:03 ` Matt Sealey
2007-06-25 12:53 ` Clemens Koller
2007-06-25 14:31 ` Matt Sealey
2007-06-25 17:00 ` Olof Johansson
2007-06-25 17:48 ` Clifford Wolf
2007-06-25 18:01 ` Clifford Wolf
2007-06-25 21:20 ` Matt Sealey
2007-07-04 9:05 ` Clifford Wolf
2007-07-04 10:11 ` Clemens Koller
2007-07-07 5:24 ` Timur Tabi
2007-07-07 8:41 ` Clifford Wolf
2007-07-07 13:08 ` Arnd Bergmann
2007-07-07 13:27 ` Clifford Wolf
2007-07-07 13:28 ` Arnd Bergmann
2007-07-07 13:34 ` Clifford Wolf
2007-07-11 9:35 ` Clifford Wolf [this message]
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=20070711093534.GA6366@clifford.at \
--to=clifford@clifford.at \
--cc=arnd@arndb.de \
--cc=linuxppc-embedded@ozlabs.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).