Making memory uncacheable for a linux kernel module
Hi,
I'm facing an issue regarding making certain memory
uncacheable when using a linux kernel module.
Here's a brief description of what I'm doing.
There’s a shared memory between the arm processor(ARM926EJ-S) and an
ASIC. Both processor (kernel module) and asic read and write to this
memory. When asic writes to this memory, say location 0xff00, the
contents of this location are read by arm processor from its cache
instead of from the memory.
I’m trying to make sure processor always reads from memory instead of reading invalid data from its cache.
So I tried using ioremap_nocache to make the whole shared memory as
uncacheable. Though this function returned non-null (signalling a successful return), I found that processor was still reading stale data
from its cache.
My linux version details are as under.
Linux version 2.6.22.18 (root@demo) (gcc version 4.2.1) #1 Thu Jun 25 11:50:35 PDT 2009
Ubuntu 9.04 \n \l
Linux Debian 5.0 ( 2.6.22.18 armv5tejl)
I would like to know if there's a bug in ioremap_nocache for this
particular linux kernel version for the given ARM processor or
there is any other assured way of making memory uncacheable.
Thanks in advance,
Mahendra
|