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 a lot for showing me what is wrong with me (have to read document completely :-( ). Actually I dont know whether pci_map_single will be success always, thats the reason I have gone for pci_alloc_consistent. Tell me which one of the following will be useful. My device is capable of 64 bit DMA. 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. Thanks Again. 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: Fri, 4 Jun 2004 00:42:36 -0700 > >On Mon, May 31, 2004 at 03:53:24AM +0000, Sathya Prakash V wrote: > > if (hwdev == NULL || hwdev->dma_mask < 0xffffffff || no_iommu) > > gfp |= GFP_DMA; > > If there is no_iommu then without considering the dma_mask the GFP_DMA >is > > set and the memory allocation is limited. > >Sorry, I should've caught this in the first place. That is precisely >what pci_alloc_consistent is defined to do. > >From Documentation/DMA-mapping.txt: > >The consistent DMA mapping interfaces, for non-NULL dev, will always >return a DMA address which is SAC (Single Address Cycle) addressable. >Even if the device indicates (via PCI dma mask) that it may address >the upper 32-bits and thus perform DAC cycles, consistent allocation >will still only return 32-bit PCI addresses for DMA. This is true >of the pci_pool interface as well. > >So, the real problem is: why are you using pci_alloc_consistent to >allocate lots of memory and why not use the streaming DMA mapping APIs >such as pci_map_single ? > > -Arun > > >------------------------------------------------------- >This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one >installation-authoring solution that does it all. Learn more and >evaluate today! http://www.installshield.com/Dev2Dev/0504 >_______________________________________________ >linux-india-programmers mailing list >linux-india-programmers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org >https://lists.sourceforge.net/lists/listinfo/linux-india-programmers _________________________________________________________________ Get ready to dream with Citibank Ready Cash. http://go.msnserver.com/IN/49355.asp The Next Generation Personal Loan! ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504