mmap + segfaults on MPC8349E

R. Ebersole (VTI - new) rje at valleytech.com
Sun Dec 9 13:44:16 EST 2007


Hi.

We've run into an .... interesting (and frustrating) occurance recently 
while testing
out a new board (and BSP).   We were wondering if anybody has seen anything
like this.

A description follows:

We wrote some simple drivers/modules to mmap() FPGA registers to user space.
At the moment, for testing, we reserve the upper x-MB of RAM, and mmap() 
there, instead.

We open 4 such devices, and mmap() 64KB of space (memory, in this case) 
for each.
Accessing the first device opened & mmapped was fine.  But accesssing 
the 2nd device
yielded some odd behavior.  We could read and write the first and 3rd 4K 
regions fine, but
if we read from the 2nd one (at offset 0x1000) before we wrote to it, we 
get a segmentation
fault.  If, however, we wrote first (to the 2nd region), then things 
were OK.

Addendum: With the real device, this same behavior happens at the 10th 
4-KB region of the device.
 Without any of the others mmap()-ed.  If we mmap() just that 4-KB 
region, things are fine.  We
can access the region with ioremap() in the driver w/o issues.

We are running on an MPC8349-E.

Any thoughts or ideas?


vti

--

This message contains confidential information and is intended only for the
individual named.  If you are not the intended recipient you should not
disseminate, distribute or copy this e-mail.  Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20071208/137c73d6/attachment.html 


More information about the Linuxppc-embedded mailing list