mmap'd physical memory not updating user virtual
I am writing a user space MAC driver in Linux 2.6.23 hosted on a Arm11 mpcore. A contiguous block of physical memory is allocated and mmap'd to userspace.
/dev/mem with O_SYNC flag is used to mmap so that the user virtual memory is uncached (with no much benefit).
kptr = kmalloc(sz, GFP_DMA|GFP_KERNEL);
pptr = __pa(kptr);
fd = open("/dev/mem", O_RDWR|O_SYNC);
uptr = mmap(0, sz, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED,fd, pptr);
The map'd user virtual memory is carved into network buffers and used for DMA.The MAC is successfully able to DMA ethernet frames to the physical memory. From the Rx interrupt handler bh (kernel logical memory) the frames received could be viewed and the cache functions also work fine. However, the mmap'd memory in user space does not reflect the changes.
Why is the physical memory mapped to user virtual does not reflect the chages ?
Or any suggestions on what could be going wrong here ?
Deb Rupam Banerjee
P.S: Please note that all buffer alignment's are taken care of.
Webinar: 8 Signs You’re Beyond Cron
11am CDT, April 29th
Join Linux Journal and Pat Cameron, Director of Automation Technology at HelpSystems, as they discuss the eight primary advantages of moving beyond cron job scheduling. In this webinar, you’ll learn about integrating cron with an enterprise scheduler.Join us!
- New Products
- Users, Permissions and Multitenant Sites
- Not So Dynamic Updates
- Flexible Access Control with Squid Proxy
- Security in Three Ds: Detect, Decide and Deny
- DevOps: Everything You Need to Know
- Tighten Up SSH
- Solving ODEs on Linux
- Non-Linux FOSS: MenuMeters
- diff -u: What's New in Kernel Development