[openib-general] Re: [PATCH 21 of 53] ipath - use phys_to_virt instead of bus_to_virt

Roland Dreier rdreier at cisco.com
Mon May 15 14:28:45 PDT 2006


    Bryan> As Segher mentioned, bus_to_virt is unportable, so it's
    Bryan> definitely the wrong thing to use.

Yes, but at least it says what you're trying to do.  asm-powerpc's
io.h has this for phys_to_virt:

 *	This function does not handle bus mappings for DMA transfers. In
 *	almost all conceivable cases a device driver should not be using
 *	this function

so replacing bus_to_virt with that is not a step forward.

    Bryan> Any ideas?  Should this turn from a one-liner into a
    Bryan> big-refactor-for-2.6.18 patch?

I don't think there's a quick way to fix this.  What you really want
to do is override the DMA mapping functions for your device so that
you can keep track of the kernel mapping.  powerpc can already do this
(cf the ehca driver), and I think patches to do it on x86-64 are
floating around as part of the "Calgary IOMMU" work.

 - R.



More information about the general mailing list