Re: [Xenomai] Writing to UDD driver through mapped memory cause secondary mode switch

2018-01-30 Thread MINIER Bertrand
Hello Greg,

I didn't succeed to solve this issue.
The switch to secondary mode only happen on the first write to the memory 
mapped area. As far as I understood, the secondary mode switch is caused by a 
page fault.
I workaround it by doing a dummy write just after the mmap() call, which anyway 
trigger a switch to secondary mode.
After this first dummy write, my rt thread doesn't switch anymore to secondary 
mode.

I used the documentation you point but I didn't found any help for this issue.

Best regards,

Bertrand


-Message d'origine-
De : Greg Gallagher [mailto:g...@embeddedgreg.com]
Envoyé : vendredi 26 janvier 2018 21:43
À : MINIER Bertrand
Cc : xenomai@xenomai.org
Objet : Re: [Xenomai] Writing to UDD driver through mapped memory cause 
secondary mode switch

Sorry to bring back an old thread but I just noticed this.  Did you solve your 
issue?  Did you use the documentation in this file for help? 
https://git.xenomai.org/xenomai-3.git/tree/include/cobalt/kernel/rtdm/udd.h?id=f4a54b173db71a182d9826852a94b20f6095b411

-Greg

On Thu, Dec 14, 2017 at 6:23 AM, MINIER Bertrand <bertrand.min...@sercel.com> 
wrote:
> Hi,
>
> I implemented an UDD driver for a SOC IP on my Xilinx Ultrascale ZCU102 board.
> The arch is arm64 so I'm using Xenomai from the next branch.
>
> When I try to write to the memory mapped from the user space side, Xenomai 
> switches to secondary mode.
>
> I activated the SIGDEBUG and attached an handler to point the origin and the 
> reason of this secondary mode switch.
> The result of sigdebug_reason(siginfo) is SIGDEBUG_MIGRATE_FAULT.
>
> I'm using mmap with the following attributes:
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fpgaMemfd, 0);
>
> The file descriptor is opened with O_RDWR flag.
>
> What is strange is that memory write effectively works but the 
> SIGDEBUG_MIGRATE_FAULT is triggered. Reading the physical driver memory with 
> devmem returns the written value.
>
> Does anyone would have any idea about the origin of the issue ?
>
> Thanks,
>
> Bertrand Minier
>
>
> This e-mail and any accompanying attachments are confidential. If you are not 
> the intended recipient, you must not review, disclose, copy, distribute or 
> use this e-mail; please delete it from your system and notify the sender 
> immediately.
> ___
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai
This e-mail and any accompanying attachments are confidential. If you are not 
the intended recipient, you must not review, disclose, copy, distribute or use 
this e-mail; please delete it from your system and notify the sender 
immediately.
___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai


Re: [Xenomai] Writing to UDD driver through mapped memory cause secondary mode switch

2018-01-26 Thread Greg Gallagher
Sorry to bring back an old thread but I just noticed this.  Did you
solve your issue?  Did you use the documentation in this file for
help? 
https://git.xenomai.org/xenomai-3.git/tree/include/cobalt/kernel/rtdm/udd.h?id=f4a54b173db71a182d9826852a94b20f6095b411

-Greg

On Thu, Dec 14, 2017 at 6:23 AM, MINIER Bertrand
 wrote:
> Hi,
>
> I implemented an UDD driver for a SOC IP on my Xilinx Ultrascale ZCU102 board.
> The arch is arm64 so I'm using Xenomai from the next branch.
>
> When I try to write to the memory mapped from the user space side, Xenomai 
> switches to secondary mode.
>
> I activated the SIGDEBUG and attached an handler to point the origin and the 
> reason of this secondary mode switch.
> The result of sigdebug_reason(siginfo) is SIGDEBUG_MIGRATE_FAULT.
>
> I'm using mmap with the following attributes:
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fpgaMemfd, 0);
>
> The file descriptor is opened with O_RDWR flag.
>
> What is strange is that memory write effectively works but the 
> SIGDEBUG_MIGRATE_FAULT is triggered. Reading the physical driver memory with 
> devmem returns the written value.
>
> Does anyone would have any idea about the origin of the issue ?
>
> Thanks,
>
> Bertrand Minier
>
>
> This e-mail and any accompanying attachments are confidential. If you are not 
> the intended recipient, you must not review, disclose, copy, distribute or 
> use this e-mail; please delete it from your system and notify the sender 
> immediately.
> ___
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai

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


[Xenomai] Writing to UDD driver through mapped memory cause secondary mode switch

2017-12-14 Thread MINIER Bertrand
Hi,

I implemented an UDD driver for a SOC IP on my Xilinx Ultrascale ZCU102 board.
The arch is arm64 so I'm using Xenomai from the next branch.

When I try to write to the memory mapped from the user space side, Xenomai 
switches to secondary mode.

I activated the SIGDEBUG and attached an handler to point the origin and the 
reason of this secondary mode switch.
The result of sigdebug_reason(siginfo) is SIGDEBUG_MIGRATE_FAULT.

I'm using mmap with the following attributes:
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fpgaMemfd, 0);

The file descriptor is opened with O_RDWR flag.

What is strange is that memory write effectively works but the 
SIGDEBUG_MIGRATE_FAULT is triggered. Reading the physical driver memory with 
devmem returns the written value.

Does anyone would have any idea about the origin of the issue ?

Thanks,

Bertrand Minier


This e-mail and any accompanying attachments are confidential. If you are not 
the intended recipient, you must not review, disclose, copy, distribute or use 
this e-mail; please delete it from your system and notify the sender 
immediately.
___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai