From: "David S. Miller" <davem@redhat.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-arch@vger.kernel.org
Subject: Re: dma_mask semantic problems
Date: Sun, 29 Feb 2004 22:34:12 -0800 [thread overview]
Message-ID: <20040229223412.493e3f32.davem@redhat.com> (raw)
In-Reply-To: <1078120287.21575.12.camel@gaston>
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.
> 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".
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).
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.
next prev parent reply other threads:[~2004-03-01 6:34 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 [this message]
2004-03-01 6:28 ` Benjamin Herrenschmidt
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=20040229223412.493e3f32.davem@redhat.com \
--to=davem@redhat.com \
--cc=benh@kernel.crashing.org \
--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