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 16:51:28 +1100 [thread overview]
Message-ID: <1078120287.21575.12.camel@gaston> (raw)
In-Reply-To: <20040229214750.74c4ce36.davem@redhat.com>
On Mon, 2004-03-01 at 16:47, David S. Miller wrote:
> 1) A way to say "I can map all of physical space into the 32-bit
> PCI BUS DMA addressing space, ie. iommu platform.
>
> 2) A way to say "I can map all of physical space using 64-bit
> addressing too"
>
> I think the first thing is a seperate question. Purely, the IOMMU exists
> precisely to serve this purpose, map physical memory space (however large
> bitness wise it is) into the 32-bit SAC PCI address space.
>
> 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 ?
> so scsi could say:
>
> if (dma_can_use_iommu(dev) &&
> !(dma_iommu_mask(dev) & ~(u64)0xffffffff)) {
> /* do the 32-bit space saving trick... */
> dma_set_blah_mask(0xffffffff);
> ... etc. ...
> }
>
> Sound ok?
Except for 32 bits archs without iommu ...
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 ?
If it's the pci_map_* code that will either go through the iommu or
not, on what bases does it make that decision ?
Once the above example you pasted did return that we can indeed get
only 32 bits addresses, we do a dma_set_dma_mask(32bits) to force
pci_map_sg() to only return us addresses in the low 32 bits mask,
that's fine, just make it clear that this dma_set_blah_mask is
actually the real & good old dma/pci_set_dma_mask()...
Ben.
next prev parent reply other threads:[~2004-03-01 6:01 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 [this message]
2004-03-01 6:34 ` David S. Miller
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=1078120287.21575.12.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