From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "David S. Miller" <davem@redhat.com>
Cc: Linux Arch list <linux-arch@vger.kernel.org>
Subject: Re: dma_mask semantic problems
Date: Mon, 01 Mar 2004 17:28:26 +1100 [thread overview]
Message-ID: <1078122505.21575.21.camel@gaston> (raw)
In-Reply-To: <20040229223412.493e3f32.davem@redhat.com>
On Mon, 2004-03-01 at 17:34, David S. Miller wrote:
> On Mon, 01 Mar 2004 16:51:28 +1100
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > > I would go so far as to propose a:
> > >
> > > int dma_can_use_iommu(dev);
> > > u64 dma_iommu_mask(dev);
> >
> > What about 32 bits archs without iommu ?
>
> They do not return true for the first function, which means
> the second function may not be called.
Yes, which means according to your example, that we do not enable
the 32 bits DMA optimizations for 32 bits arch :)
> > Well... Assuming we fix that, then what if we can do both 64 bit
> > addresses and 32 bits addresses, who decides what to use ? like we
> > support DAC. Who decides wether to use it or not ?
>
> Good question.
>
> Long ago we decided that the way we handle this on sparc64 is to
> only support 32-bit stuff via the dma interfaces, you have to use
> the explicit pci_dac_*() stuff to get at the 64-bit addresses and
> these interfaces are extremely frowned upon except in very specific
> kinds of drivers. See the section entitled "DAC Addressing for
> Address Space Hungry Devices".
Hrm...
> So on sparc64 we define dma_addr_t as a u32. We want to use the
> IOMMU for everything normal because unless you use the IOMMU you
> don't get the PCI controller DMA cache usage (which does prefetching
> for reads and coalescing for writes to encourage cacheline sized
> transactions on the system bus).
Ok, your controller is better than ours :)
> On the other side in SCSI we are talking about a driver specific
> issue in terms of performance. Basically what they want to know,
> in our terms, is: "If 32-bit vs 64-bit DMA address spacing has
> roughly the same performance, and gets access to the whole range
> of physical memory, let me use 32-bit."
>
> Maybe that more precise question leads more directly to a more useful
> dma_*() interface name and semantics? :-)
>
> You're right, my original suggestion does not handle this properly.
The thing is at the moment, I'm not sure what would be those better
semantics ... I started this discussion to get more inputs from
people like you that had to deal with it already ;)
I'll sleep on this and see if I get some good ideas, but any suggestion
is welcome.
Ben.
next prev parent reply other threads:[~2004-03-01 6:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-01 0:37 dma_mask semantic problems Benjamin Herrenschmidt
2004-03-01 5:47 ` David S. Miller
2004-03-01 5:51 ` Benjamin Herrenschmidt
2004-03-01 6:34 ` David S. Miller
2004-03-01 6:28 ` Benjamin Herrenschmidt [this message]
2004-03-01 10:23 ` Ivan Kokshaysky
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=1078122505.21575.21.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=davem@redhat.com \
--cc=linux-arch@vger.kernel.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