Messages in this thread | | | Date | Sat, 20 Mar 2004 16:23:25 -0800 | From | William Lee Irwin III <> | Subject | Re: can device drivers return non-ram via vm_ops->nopage? |
| |
On Sat, Mar 20, 2004 at 11:54:45PM +0000, Russell King wrote: > The issues are: > 1. ALSA wants to mmap the buffer used to transfer data to/from the > card into user space. This buffer may be direct-mapped RAM, > memory allocated via dma_alloc_coherent(), an on-device buffer, > or anything else. > The user space mapping must likewise be DMA-coherent. > Currently, ALSA just does virt_to_page() on whatever address it > feels like in its nopage() function, which is obviously not > acceptable for two out of the three specific cases above. > 2. ALSA wants to _coherently_ share data between the kernel-side > drivers, and user space ALSA library, mainly the DMA buffer > head/tail pointers so both kernel space and user space knows > when the buffer is full/empty.
Okay, so we've got these pinned down. So I've got two small ideas (I mentioned them earlier, but maybe vger dropped the message):
(a) I think prefaulting should work for that in general, though the API doesn't fit the extra things needed for e.g. DMA. Is there some way we could extend remap_area_pages() (or provide an alternative interface to similar functionality with the missing pieces included) to do the extra things needed to make the coherency and/or DMA (or whatever else is missing) work?
(b) Alternatively, would dma_coherent_to_pfn() instead of dma_coherent_to_page() and making ->nopage() return pfns help salvage the method using non-cachable and/or dma-coherent page protections in vma->vm_page_prot?
-- wli - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |