From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH V2 2/3] powerpc: Add support for swiotlb on 32-bit
Date: Thu, 28 May 2009 16:11:03 +1000 [thread overview]
Message-ID: <1243491063.3171.117.camel@pasglop> (raw)
In-Reply-To: <2CCC4C06-15EC-438B-8BEA-A31690B4FB2C@kernel.crashing.org>
On Wed, 2009-05-27 at 23:42 -0500, Kumar Gala wrote:
> Ben,
>
> Any comments on this.. need a decision so we can have patches ready
> for .31.
> > Clamping the DMA mask is even worse than the additional indirection
> > for us. We have valid scenarios in which we'd have 512M of outbound
> > PCI address space and 4G of mem and thus 3.5G of inbound PCI address
> > space. With the DMA mask we'd be limited to 2G and bouncing from
> > 2..3.5G when we don't need to.
Ok and agreed.
> > I think our options are to change archdata as follows:
> >
> > Option 1 - just add a new data member to dev_archdata
> >
> > struct dev_archdata {
> > /* Optional pointer to an OF device node */
> > struct device_node *of_node;
> >
> > /* DMA operations on that device */
> > struct dma_mapping_ops *dma_ops;
> > void *dma_data;
> > dma_addr_t direct_dma_addr;
> > };
That sounds like the "simple" option, might want for now to make
it conditional on SWIOTLB but the bloat is reasonably small I would
expect.
> > Option 2 - introduce a proper container for how we use dma_data.
> > This may just be moving the indirection from an indirection function
> > call to an indirection data reference:
Right, it somewhat defeats the purpose though an indirect data reference
tends to hit the pipeline less hard than an indirect function call...
> > Option 3 - use dma_data to keep the addr at which we need to bounce
> > vs not for SWIOTLB - this has potential issues w/conflicting with
> > dma_data being used as the dma_offset. (need to think on that a bit
> > more). Additionally this has the benefit in that we need dma_data
> > to be a 64-bit quantity on ppc32 w/>32-bit phys addr.
Well, that means that swiotlb can not be used with a !0 offset. That
-might- be an issue if the PCI is setup "backward", ie with 0..N being
the outbound MMIO and N..4G the DMA region, remapped to 0. There are
reasons to do it this way, it's not invalid, for example it allow easy
access to ISA/VGA holes.
At this stage I have no firm opinion. I'm thinking that either we try
to limit the overhead and option 1 is probably the simplest, at the
expense of a little bit of memory, or we think the overhead is going
to be minimum and we may as well stick to 2 functions since that's
going to be more flexible.
Cheers,
Ben.
next prev parent reply other threads:[~2009-05-28 6:11 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
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 [this message]
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=1243491063.3171.117.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=galak@kernel.crashing.org \
--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).