Hi,

On Friday 17 October 2008 06:46, [EMAIL PROTECTED] wrote:
> No comments or ideas? Providing this feature is essential for our CPCI
> drivers. We have to port some Linux applications to Xenomai which use that
> mmap stuff intensely.
>
> Thanks again!
>
> Thomas
>
> > -----Ursprüngliche Nachricht-----
> > Von: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] Im Auftrag von
> > [EMAIL PROTECTED]
> > Gesendet: Mittwoch, 8. Oktober 2008 11:49
> > An: [email protected]
> > Betreff: [Xenomai-help] rtdm_iomap_to_user on PPC
> >
> > Hello,
> >
> > in the following thread I was asking for a solution to use
> > rtdm_iomap_to_user() on PPC (MPC5200, Denx 2.4.25)


In 2.4 kernel, rtdm_iomap_to_user() is based on the function remap_page_range 
(with vma->vm_flags |= VM_RESERVED).

Once, I had to develop a classical Linux driver (for PPC) which provided mmap 
functionalites so as to let a user application mmap a buffer allocated thanks 
to __get_free_pages().

On a 2.6 kernel, I used remap_pfn_range() and it works great but on 2.4 kernel 
the function remap_page_range() did not work as I expected. I had a quick 
look on its implementation and I found that instead of mapping my buffer it 
mapped newly allocated zeroed pages (if my memories are correct).

If I remember well, these pages were allocated in lazy mode. That could 
explain the freeze of your whole system: in case a RT application in primary 
mode tries to access the mmapped buffer.

My remembrance are not very accurate and considering the hour, I will just be 
able to give you some idea of tests to perform.

1) Have you tried to access your driver with a classical NRT process (not with 
a RT task even on secondary mode); in such a configuration, I think there 
should be no freeze.

2) Could you try to develop a minimal Linux driver (without RTDM) which maps a 
buffer thanks to remap_page_range(). Could you check that you are not able to 
properly access the data (you should read zero everywhere) ? A good test 
would be to open and perform the mmap with a classical user process and, once 
the mmap initialization is done, you could shadow your process 
(rt_task_shadow) and try to access the mmapped buffer. That should freeze 
your system and then prove that the problem comes from remap_page_range().

In my case, I resolved my problem by using the no_page() way described in 
Rubbini's book (Linux device driver 2nd edition). By the way, I think that 
was the recommended method for my configuration.

Alexis.

> > https://mail.gna.org/public/xenomai-help/2008-05/msg00153.html
> >
> > As suggested by Philippe I tried the current 2.4.5 stable
> > release, but the problem still remains. The call to
> > rtdm_iomap_to_user returns success (0) but any access to the
> > mapped memory section ends in freezing the whole system.
> >
> > Thanks for your help!
> >
> > Thomas
> >
> > Achtung: Neue E-Mail-Adresse! Attention: New e-mail-address!
> > [EMAIL PROTECTED]
> > --------------------------------------------------------
> > manroland AG
> > Vorsitzender des Aufsichtsrates: Hanno C. Fiedler
> > Vorstand: Gerd Finkbeiner (Vorsitzender), Dr. Ingo Koch, Dr.
> > Markus Rall, Paul Steidle
> > Sitz der Gesellschaft: Offenbach am Main, Registergericht:
> > Amtsgericht Offenbach HRB-Nr. 42592 USt-Ident-Nr. DE 250200933
> >
> > _______________________________________________
> > Xenomai-help mailing list
> > [email protected]
> > https://mail.gna.org/listinfo/xenomai-help
>
> Achtung: Neue E-Mail-Adresse! Attention: New e-mail-address!
> [EMAIL PROTECTED]
> --------------------------------------------------------
> manroland AG
> Vorsitzender des Aufsichtsrates: Hanno C. Fiedler
> Vorstand: Gerd Finkbeiner (Vorsitzender), Dr. Ingo Koch, Dr. Markus Rall,
> Paul Steidle Sitz der Gesellschaft: Offenbach am Main, Registergericht:
> Amtsgericht Offenbach HRB-Nr. 42592 USt-Ident-Nr. DE 250200933
>
> _______________________________________________
> Xenomai-help mailing list
> [email protected]
> https://mail.gna.org/listinfo/xenomai-help


_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to