Fixed address device-shared kernel memory

Richard B. Johnson (root@chaos.analogic.com)
Wed, 22 Sep 1999 16:23:47 -0400 (EDT)


Memory Wizards,

given:
(ignoring casts)

ptr = phys_to_vert(0xcc000);

... which is a shared memory window in kernel space.

This works for about 20 seconds. Then (it appears as though)
the kernel unmaps this virtual address, resulting in
data observed at this address to not be the data from the
shared-memory device.

The problem with the disappearing mapping seems to correspond
with the wakeup of kswapd or kflushd.

I looked through kernel drivers and didn't get a clue as
to how to prevent this. Many drivers, which use shared memory,
don't even use the phys_to_vert macro. If I try that, the
result is a panic with Unable to handle kernel paging request
of 0x000cc000. So, the physical to virual mapping is obviously
required in a kernel module.

So, the question is; "How do I prevent the kernel from unmapping
the physical-to-virtual translated pages?"

Was I supposed to call do_mmap(); and later do_munmap(); in
the kernel driver?

Cheers,
Dick Johnson
**** FILE SYSTEM WAS MODIFIED ****
Penguin : Linux version 2.3.13 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

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