[openib-general] Suggestions for how to remove bus_to_virt()
Ralph Campbell
ralphc at pathscale.com
Fri Jul 14 16:45:19 PDT 2006
On Fri, 2006-07-14 at 15:35 -0700, David Miller wrote:
> From: Ralph Campbell <ralphc at pathscale.com>
> Date: Fri, 14 Jul 2006 15:27:07 -0700
>
> > Note that the current design only supports one IOMMU type in a system.
> > This could support multiple IOMMU types at the same time.
>
> This is not true, the framework allows multiply such types
> and in fact Sparc64 takes advantage of this. We have about
> 4 or 5 different PCI controllers, and the IOMMUs are slightly
> different in each.
I see. It looks like dma_map_single() is an inline call to
pci_map_single() which is a function call that can then
look at the device and tell what IOMMU function to call.
> Even with the standard PCI DMA mapping calls, we can gather the
> platform private information necessary to program the IOMMU
> appropriately for a given chipset.
>
> The dma_mapping_ops idea will never get accepted by folks like Linus,
> for reasons I've outlined in previous emails in this thread. So, it's
> best to look elsewhere for solutions to your problem, such as the
> ideas used by the USB and IEE1394 device layers.
The USB code won't work in my case because the USB system is
the one doing the memory allocation and IOMMU setup so it
can remember the kernel virtual address or physical pages used
to create the mapping.
In my case, the infiniband (SRP) code is doing the mapping and
only passing the dma_addr_t to the device driver at which point
I have no way to convert it back to a kernel virtual address.
I need to either change the IB device API to include mapping functions
or intercept the dma_* functions so I can save the inputs.
More information about the general
mailing list