[etherlab-users] rtdm compile error
Andreas Stewering-Bone
ab at igh-essen.com
Fri May 6 11:57:17 CEST 2011
Hello Ravi,
I will talk to Florian about the locking.
Maybe we will open a devel branch for the rtdm interface?
Best regards
Andreas
Am 06.05.2011 06:29, schrieb Ravi Chemudugunta:
> I was able to get the domain to exchange, I recompiled everything
> (including etherlabmaster-1.5, with the above hack of disabling
> callbacks).
>
>
>> Which runtime enviroment do you use?
>>
>> Xenomai/RTAI?
>>
> RTAI 3.8.1
>
>
>> Kernelversion ?
>>
> 2.6.29.5
>
>
>> Distro?
>>
> Custom distribution made using buildroot, and gcc 4.4.3.
>
> I think I have found the source of the deadlock. The rtdm module
> creates a mutex that it uses to marshal calls to etherlab kernel
> functions, however it also uses the same mutex reference in the
> callback functions it registers.
>
> module.c:599 (initalisation of rtdm module)
> register locking / unlocking callback
> module.c:422 (marshal body)
> > marshal send call:
> > locks the mutex
> > calls ecrt_master_send
> master.c:2058 (send function body)
> > calls ec_master_inject_fsm_datagrams
> master.c:670 (inject function body)
> > calls the mutex callback (fsm_queue_locking_data)
>
> The callback registered @ initialisation time, attempts to lock the
> mutex, this is where the dead lock occurs.
>
> I think the intent of the callbacks has changed, it appears to be for
> the purposes of protecting the internal datagram queue; rather than
> for controlling when other threads (EoE) can also send/receive data.
> So I am not sure if they are needed to be used in this way as the user
> of the API does not have access to the internal queue directly anyway.
>
> Patch includes my effort so far, changed the nature of locking in
> inject datagrams to a speculative one. Doing so solves the dead-lock,
> however, no domain data is exchanged, as inject datagrams never gets a
> chance, except through ecrt_master_send (where a lock has already been
> borrowed by rtdm callback).
>
> -ravi
>
Mit freundlichem Gruß
Andreas Stewering-Bone
--
------------------------------------------------------------------------
Dipl.-Ing.(FH) Andreas Stewering-Bone
andreas.stewering-bone at igh-essen.com
Tel.: +49 201 / 36014-15
Ingenieurgemeinschaft IgH
Gesellschaft für Ingenieurleistungen mbH
Heinz-Bäcker-Str. 34
D-45356 Essen
Amtsgericht Essen HRB 11500
USt-Id.-Nr.: DE 174 626 722
Geschäftsführung:
- Dr.-Ing. S. Rotthäuser,
- Dr.-Ing. T. Finke,
- Dr.-Ing. W. Hagemeister
Tel.: +49 201 / 360-14-0
http://www.igh-essen.com
------------------------------------------------------------------------
More information about the Etherlab-users
mailing list