Re: [LIP] pci_alloc_consistent usage in x86-64 kernel
"Sathya Prakash V" <[email protected]>
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Message-ID | <[email protected]> |
Hi Arun,
Thanks for those detailed information,
My driver at single moment will not require morethan 32Mb mapped to bus
addresses.
So Now I am using pci_map_* APIs and my driver is able to allocate more
memory and able to do data transfer perfectly.
Note: in x86-64, If there is no_iommu space to allocate mapping then
pci_single just returns the iommu bus base
iommu_page = alloc_iommu(npages);
if (iommu_page == -1) {
iommu_full(dev, addr, size, dir);
return iommu_bus_base;
}
So I feel there is no point we will be getting error in mapping? is my
conclusion right?
Thanks for your help.
Sathya
>From: Arun Sharma <[email protected]>
>Reply-To: linux-india-programmers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>To: linux-india-programmers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>Subject: Re: [LIP] pci_alloc_consistent usage in x86-64 kernel
>Date: Tue, 8 Jun 2004 20:55:12 -0700
>
>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
>_______________________________________________
>linux-india-programmers mailing list
>linux-india-programmers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>https://lists.sourceforge.net/lists/listinfo/linux-india-programmers
_________________________________________________________________
Think online shopping is cool? Enter the Baazee contest now!
http://server1.msn.co.in/sp04/Baazee/ Win great prizes while you shop!
-------------------------------------------------------
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