Re: driver mmap implementation for memory allocated with pci_alloc_consistent()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2011-05-18 at 21:02 +0800, Leon Woestenberg wrote:
> Hello all,
> 
> memory allocated with pci_alloc_consistent() returns the (kernel)
> virtual address and the bus address (which may be different from the
> physical memory address).
> 
> What is the correct implementation of the driver mmap (file operation
> method) for such memory?
> 
> I assume remap_pfn_range() must be used, but how can I find out the
> correct arguments, such as the physical address?
> 
> Some plainly use the bus address as the physical address to
> remap_pfn_range, but that seems plain wrong to be in general.
> 
> This questions seems a FAQ, but I found different (and
> contradictionary) answers on Google.
why use pci_alloc_consistent? you can allocate pages and mmap it to
userspace. when you want to do dma, you can use pci_map_page to get dma
address for the pages and do whatever.

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux