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.
Getting Started with DevOps - Including New Data on IT Performance from Puppet Labs 2015 State of DevOps Report
August 27, 2015
12:00 PM CDT
DevOps represents a profound change from the way most IT departments have traditionally worked: from siloed teams and high-anxiety releases to everyone collaborating on uneventful and more frequent releases of higher-quality code. It doesn't matter how large or small an organization is, or even whether it's historically slow moving or risk averse — there are ways to adopt DevOps sanely, and get measurable results in just weeks.
Free to Linux Journal readers.Register Now!
|Secure Server Deployments in Hostile Territory, Part II||Jul 29, 2015|
|Hacking a Safe with Bash||Jul 28, 2015|
|KDE Reveals Plasma Mobile||Jul 28, 2015|
|Huge Package Overhaul for Debian and Ubuntu||Jul 23, 2015|
|diff -u: What's New in Kernel Development||Jul 22, 2015|
|Shashlik - a Tasty New Android Simulator||Jul 21, 2015|
- Secure Server Deployments in Hostile Territory, Part II
- Hacking a Safe with Bash
- KDE Reveals Plasma Mobile
- Huge Package Overhaul for Debian and Ubuntu
- The Controversy Behind Canonical's Intellectual Property Policy
- Home Automation with Raspberry Pi
- Shashlik - a Tasty New Android Simulator
- Embed Linux in Monitoring and Control Systems
- diff -u: What's New in Kernel Development
- General Relativity in Python