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

Christoph Hellwig hch at infradead.org
Tue May 16 13:05:01 PDT 2006


On Mon, May 15, 2006 at 02:21:21PM -0700, Bryan O'Sullivan wrote:
> On Mon, 2006-05-15 at 08:50 -0700, Roland Dreier wrote:
> 
> > Actually I NAK'ed this patch.  It compiles the same thing on x86_64
> > but makes the source code wrong -- dma_map_single() returns a bus
> > address, not a physical address.
> 
> As Segher mentioned, bus_to_virt is unportable, so it's definitely the
> wrong thing to use.

phys_to_virt is as bad.  please fix your code to do the right thing, that
is to stop pretending to be able to map back from a bus to a virtual address.
The only way to get at the virtual address from a bus one is to store it
away at the time you call the dma mapping function.




More information about the general mailing list