[etherlab-users] rtdm compile error
Ravi Chemudugunta
chemuduguntar at gmail.com
Fri May 6 06:29:52 CEST 2011
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: safe_lock.diff
Type: text/x-patch
Size: 5703 bytes
Desc: not available
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20110506/2d04e3b2/attachment-0004.bin>
More information about the Etherlab-users
mailing list