From: Dan Malek <dan@embeddededge.com>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: linux-ppc-embedded <linuxppc-embedded@ozlabs.org>
Subject: Re: [PATCH] allow coherent DMA API to work before main page allocator is set up
Date: Fri, 20 May 2005 17:03:59 -0400 [thread overview]
Message-ID: <e503cf4ab6d2d389b29474561048f2f2@embeddededge.com> (raw)
In-Reply-To: <20050520141244.GD24923@logos.cnet>
On May 20, 2005, at 10:12 AM, Marcelo Tosatti wrote:
> The following patch changes dma_alloc_coherent() to, in case the
> main page allocator is not yet up and running, use the bootmem
> allocator instead.
I'm concerned about this ... Why did the drivers change in 2.6
such that they now call dma_alloc_coherent() prior to the VM set up?
> It also adds a new parameter to m8xx_cpm_hostalloc() to send back
> the physical address to its caller.
Anyone calling m8xx_cpm_hostalloc() is likely to be immediately
calling dma_alloc_coherent(). There is some design problem here
if we can't properly use these interfaces and get the mapping we
need. The TLB pinning option won't work if we can't do this.
> ..... Special casing such as
> drivers/serial/cpm_uart/cpm_uart_cpm1.c's cpm_uart_allocbuf() can be
> removed:
>
> if (is_con) {
> mem_addr = (u8 *) m8xx_cpm_hostalloc(memsz);
> dma_addr = 0;
> } else
> mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,
> GFP_KERNEL);
This is bogus and should not be necessary. The original serial
driver was able to work without doing this, I spent lots of time so
stuff like this wasn't necessary, and it's sad to see us take such
a step backward.
> What is your opinion on this approach?
As you can tell, I don't like it and we shouldn't need it :-)
The first call to m8xx_cpm_hostalloc() should be able to call
dma_consistent_alloc() to get a consistent page. If this isn't the
case, we have to fix the drivers so they can do this. The only
change that should be necessary is to return the physical address
from m8xx_cpm_hostalloc(), if for some reason we see some
need to get rid of the immensely useful iopa() function.
Thanks.
-- Dan
next prev parent reply other threads:[~2005-05-20 21:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-20 14:12 [PATCH] allow coherent DMA API to work before main page allocator is set up Marcelo Tosatti
2005-05-20 21:03 ` Dan Malek [this message]
2005-05-20 17:51 ` Marcelo Tosatti
2005-05-21 21:21 ` Dan Malek
2005-05-21 22:27 ` [RFT] 8xx cpm_hostalloc patch was: " Marcelo Tosatti
2005-05-23 6:27 ` Pantelis Antoniou
2005-05-23 15:19 ` Dan Malek
2005-05-27 15:48 ` [PATCH] PSC with devfs on 5200 Mark Chambers
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=e503cf4ab6d2d389b29474561048f2f2@embeddededge.com \
--to=dan@embeddededge.com \
--cc=linuxppc-embedded@ozlabs.org \
--cc=marcelo.tosatti@cyclades.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;
as well as URLs for NNTP newsgroup(s).