[parisc-linux] tulip DMA mapping

Grant Grundler grundler@cup.hp.com
Fri, 10 Nov 2000 08:29:25 -0800


Mathew,
I think the situation is clarified. This is just FYI.

Matthew Wilcox wrote:
> On Thu, Nov 09, 2000 at 12:12:25PM -0800, Grant Grundler wrote:
> > 0 is a valid pci_map_single() return value when the system has an IO MMU.
> 
> Oh dear.  You can bet tulip won't be the only driver which assumes it
> isn't a valid return value.

Well, then:
1) the driver writer made a wrong assumption that the "spec"
   does not support.
2) that wasn't the case here - 0 was used as a flag to indicate
   a mapping had (or hadn't rather) been done - not that the
   mapping call had failed.

> Can't our IOMMU code be limited in such a
> way that 0 is not a valid return value?  Say, constrain all allocated
> addresses to the top half of the device bus?

It could pretty easily by reserving the dma_map[0] entry during
init time. Dave Miller already made it clear that's not desirable.

> (um, just check me on this, map_single returns a device bus address,
> not a processor bus address, right?)

Yes. It's the address a device must use to master DMA transactions.
pci_map_single() input parameters are "struct pci_dev *", virtual host
memory address, and buffer size. The return is a device specific I/O
DMA address - ie this mapping cannot be shared with other devices.

FWIW, "I/O DMA address" are called IOVAs in HPUX (I/O Virtual Address).
The HW guys prefer another name but this one stuck.

grant

Grant Grundler
Unix Systems Enablement Lab
+1.408.447.7253