lkml.org 
[lkml]   [1999]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: DMA and Cache coherency on machines without hardware enforced cache coherency.

On Wed, 1 Dec 1999, Ralph Blach wrote:

> I have to write a device driver for a machine which does not have
> hardware enforced cache coherency between bus master devices and the
> CPU caches. Is there a way to allocate certain buffers in uncached
> memory. I know this would lower performance, but it would also solve
> certain problems which seem to be cropping up.

ioremap_nocache(). You can also use ioremap_nocache() on allocated pages
(it's a page granularity thing) via doing something like:

page = __get_free_pages(whatever, order);
ptr = ioremap_nocache(virt_to_phys(page), 1 <<
(order+PAGE_SHIFT));

then use 'ptr' as an uncached alias to your pages. You cannot do the above
in interrupts (obviously), and it's not fast so probably it's worth being
done once, at initization time.

for this to work you also have to modify arch/i386/mm/ioremap.c and
remove the following lines:

/*
* Don't allow anybody to remap normal RAM that we're using..
*/
if (phys_addr < virt_to_phys(high_memory))
return NULL;

and remove:

if (addr > high_memory)

from the iounmap() function.

or better, create a new interface (memremap_nocache()) which only remaps
normal RAM pages.

-- mingo


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.057 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site