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

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

 



Hello,

On Thu, May 19, 2011 at 3:19 AM, Shaohua Li <shaohua.li@xxxxxxxxx> wrote:
> On Wed, 2011-05-18 at 21:02 +0800, Leon Woestenberg wrote:
> 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.
>
Thanks for thinking along.

I need contiguous memory in this case.  But yes, I have just found out
that __get_free_pages() with pci_map_single()  does work with my
mmap() fault() handler.
See my other thread with the code posted.

I just want to understand how this would work with
pci_alloc_consistent(), as that is the generic interface for PCI
drivers.

Note that the latter provides consistent / coherent mapping, whereas
pci_map_single() does not in general.   On x86 it probably is the same
due to bus-snooping (right?).

Regards,
--
Leon
--
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