From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Becky Bruce <beckyb@kernel.crashing.org>
Cc: fujita.tomonori@lab.ntt.co.jp, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH V2 2/3] powerpc: Add support for swiotlb on 32-bit
Date: Mon, 18 May 2009 14:49:01 +1000 [thread overview]
Message-ID: <1242622141.18075.37.camel@pasglop> (raw)
In-Reply-To: <1242340949-16369-2-git-send-email-beckyb@kernel.crashing.org>
On Thu, 2009-05-14 at 17:42 -0500, Becky Bruce wrote:
> This patch includes the basic infrastructure to use swiotlb
> bounce buffering on 32-bit powerpc. It is not yet enabled on
> any platforms. Probably the most interesting bit is the
> addition of addr_needs_map to dma_ops - we need this as
> a dma_op because the decision of whether or not an addr
> can be mapped by a device is device-specific.
>
> Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Hi Becky !
Finally I got to look at your patch :-)
A few comments below...
> #ifdef CONFIG_NOT_COHERENT_CACHE
> /*
> * DMA-consistent mapping functions for PowerPCs that don't support
> @@ -76,6 +85,8 @@ struct dma_mapping_ops {
> dma_addr_t dma_address, size_t size,
> enum dma_data_direction direction,
> struct dma_attrs *attrs);
> + int (*addr_needs_map)(struct device *dev, dma_addr_t addr,
> + size_t size);
What annoys me here is that we basically end up with two indirect
function calls for pretty much any DMA map. One was bad enough on low
end processors or very intensive networking, but this is getting real
bad don't you think ?
Granted, this is only used when swiotlb is used too, but still...
So the problem is that the region that can pass-through is somewhat
a mix of bus specific (incoming DMA window location & size) and
device specific (device addressing limitations).
Now, if we can always reduce it to a single range though, which I
think is practically the case, can't we instead pre-calculate that
range and stick -that- in the struct dev archdata or similar thus
speeding up the decision for a given address as to whether it needs
a swiotlb mapping or not ? Or does it gets too messy ?
Cheers,
Ben.
next prev parent reply other threads:[~2009-05-18 4:49 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-14 22:42 [PATCH V2 1/3] powerpc: Use sg->dma_length in sg_dma_len() macro on 32-bit Becky Bruce
2009-05-14 22:42 ` [PATCH V2 2/3] powerpc: Add support for swiotlb " Becky Bruce
2009-05-14 22:42 ` [PATCH V2 3/3] powerpc: Add 86xx support for SWIOTLB Becky Bruce
2009-05-15 4:49 ` [PATCH V2 2/3] powerpc: Add support for swiotlb on 32-bit Kumar Gala
2009-05-18 4:49 ` Benjamin Herrenschmidt [this message]
2009-05-18 13:25 ` Kumar Gala
2009-05-18 21:49 ` Benjamin Herrenschmidt
2009-05-19 13:04 ` Kumar Gala
2009-05-19 20:06 ` Becky Bruce
2009-05-28 4:42 ` Kumar Gala
2009-05-28 6:11 ` Benjamin Herrenschmidt
2009-05-28 13:06 ` Kumar Gala
2009-05-19 5:27 ` FUJITA Tomonori
2009-05-19 20:57 ` Becky Bruce
2009-05-21 17:43 ` Jeremy Fitzhardinge
2009-05-21 18:27 ` Becky Bruce
2009-05-21 19:01 ` Ian Campbell
2009-05-22 10:51 ` FUJITA Tomonori
2009-05-21 20:18 ` Jeremy Fitzhardinge
2009-05-21 22:08 ` Ian Campbell
2009-05-22 10:51 ` FUJITA Tomonori
2009-05-27 19:05 ` Becky Bruce
2009-05-22 11:11 ` Ian Campbell
2009-05-22 23:55 ` Jeremy Fitzhardinge
2009-05-23 22:59 ` Leon Woestenberg
2009-05-26 12:51 ` Ian Campbell
2009-05-27 19:11 ` Becky Bruce
2009-05-27 19:05 ` Becky Bruce
2009-05-27 20:29 ` Ian Campbell
2009-05-27 22:11 ` Becky Bruce
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=1242622141.18075.37.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=beckyb@kernel.crashing.org \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=linuxppc-dev@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).