Hi,

We wanted to share an issue we were having with the following setup and it's 
solution
Kernel 3.14.43 (Vendor)
Xenomai 3.0.2
Cobalt core.
ARM cortex A7 (SMP) based board.

We have mapped (in numerous ways/APIs) a register space of some device to user 
space using various methods
For IO mapping -
mmap
rtdm_iomap_to_user
rtdm_mmap_iomem
etc.

And for unknown at the time reason we have seen page faults on writes to these 
mapping which resulted
In mode switches no matter what method of mapping APIs we used. It is important 
to note that mapping the same registrer space in Kernel
i.e. devm_ioremap_resource for example did not result in page faults.

After some investigation we found this had to do with the actual mapping 
permissions being read-only on initial mapping to user space and after the page 
fault handling - each faulted page changed permission to read-write.

The solution to for this was to add L_PTE_DIRTY mask to pgprot for that mapping 
and in retrospect we found this patch
https://lkml.org/lkml/2015/9/12/29
which addressed the issue.

I'm unsure whether this patch found its way to 3.14, I think for Xenomai on ARM 
this can be very relevant so please consider adding to the mapping flow.

Thanks,
Alex Plits.



_______________________________________________
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai

Reply via email to