Re: Will __pa(vmalloc()) ever work?

From: Russell King
Date: Sat May 28 2005 - 11:17:28 EST


On Fri, May 27, 2005 at 08:29:25PM +0100, Christoph Hellwig wrote:
> On Fri, May 27, 2005 at 02:26:36PM -0500, Timur Tabi wrote:
> > I have a driver that calls __pa() on an address obtained via vmalloc().
> > This is not supposed to work, and yet oddly it appears to. Is there a
> > possibility, even a remote one, that __pa() will return the correct
> > physical address for a buffer returned by the vmalloc() function?
>
> It will return the correct physical address for the start of the buffer.

__pa() is only defined to works on the direct-mapped kernel region.
The fact that it works on some architectures should be viewed as a
bug.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/