lkml.org 
[lkml]   [2004]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: can device drivers return non-ram via vm_ops->nopage?


On Sun, 21 Mar 2004, Russell King wrote:
>
> Remember that we're fond of telling driver writers to use scatter gather
> lists rather than grabbing one large contiguous memory chunk... So
> they did exactly as we told them. Using pci_alloc_consistent and/or
> dma_alloc_coherent and built their own scatter lists.

I do think that we should introduce a "map_dma_coherent()" thing, which
basically takes a list of pages that have been allocated by
dma_alloc_coherent(), and remaps them into user space. How hard can that
be?

In fact, on a lot of architectures (well, at least x86, and likely
anything else that doesn't use any IOTLB and just allocates a chunk of
physical memory), I think the "map_dma_coherent()" thing should basically
just become a "remap_page_range()". Ie something like

#define map_dma_coherent(vma, vaddr, len) \
remap_page_range(vma, vma->vm_start, __pa(vaddr), len, vma->vm_page_prot)

for the simple case.

Ehh?

Linus
-
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/

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.064 / U:0.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site