Hi, I have written a driver that implements mmap using the nopage method. I handle the nopage simply by supplying a page that i get from get_free_page.
As a user I'm using mmap (share mode) to get the page. I write to the memory, then I cout its contents (in user mode), then I invoke an ioctl that simply prints the content of the first bytes of the page, from the kernel point of view.
The problem is that the kernel doesn't get updated often enough. i.e. if I wait a second and invoke the ioctl I might see the new value, but if I don't wait at all I see an older value.
I guess the problem has to do with cache coherency, but I couldn't find a way to solve it (I tried flush_dcache_page before printing the content of the page, I also tried changing the VMA prot mode to no_cache but non of them helped).
The other direction is true as well, if I change the buffer in the ioctl (after the mapping) I do not see the result in the user application.
I'm using arm xscale processor. Kernel 2.6.12.
Any suggestions?