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

From: Gerd Knorr
Date: Mon May 30 2005 - 04:44:54 EST


Timur Tabi <timur.tabi@xxxxxxxxxxx> writes:

> Also, does the pgd/pmd/pte page-table walking work on addresses
> returned by kmalloc(), or do I have to use __pa() to get the physical
> address?

You should use vmalloc_to_page() (this does the page-table walking
with correct locking), then the usual dma mapping interface
(pci_map_page() or pci_map_sg()) to get bus address(es) you can pass
to your device for DMA.

Gerd

-
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/