Re: [LIP] pci_alloc_consistent usage in x86-64 kernel
Arun Sharma <[email protected]>
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jun 07, 2004 at 04:18:19AM +0000, Sathya Prakash V wrote: > I thought of using get_free_pages and virt_to_bus pair together instead of > pci_alloc_consistent will that be ok. or do i need to use pci_map_single > before passing the address to my device. If you use GFP and virt_to_bus, your driver may not be portable across all the platforms Linux supports. The PCI DMA mapping APIs hide these platform dependent details behind the APIs. So the general recommendation has been to not use GFP and virt_to_bus directly. True, pci_map_single may not succeed always, but get_free_pages may not either. Specifically, you may address a lot of memory (upto 64 bits) at a time, but at any point in time, you're limited by how much memory your IOMMU (either hardware or implemented in software) can map at a time. Does your driver need to keep > 2GB memory mapped at the same time ? You normally do pci_map_single, do DMA and free the memory in a streaming fashion. -Arun ------------------------------------------------------- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org