All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephane Grosjean <s.grosjean@peak-system.com>
To: xenomai@xenomai.org
Subject: [Xenomai] Fighting with deadlock in xenomai 2.6.3 + linux 3.5.7...
Date: Fri, 4 Sep 2015 16:24:54 +0200	[thread overview]
Message-ID: <55E9A9B6.50802@peak-system.com> (raw)

Hello,

I'm working on a RT device driver on a dual-kernel configuration (see 
subject).

I'm going to be crazy with this simple case of a user task filling with 
data a driver
internal Tx queue, and going to sleep when the queue is full. The task 
enters the sleep state,
thanks to a rtdm_event_timedwait() call. The ISR uses the 
rtdm_event_signal() to wake any
sleeping task up (something actually very close to the 16550A serial 
driver).

My problem is that, as soon as the fifo is full, the whole system hangs, 
and a terminal
connected to the serial port (kernel cmd line changed with 
"console=ttyS0,115200")
displays such infos:

[ 3802.078363] Xenomai: stuck on nucleus lock c188d4c0
[ 3802.078363]    waiter = kernel/xenomai/nucleus/intr.c:114 
(xnintr_clock_handler(), CPU #2)
[ 3802.078363]    owner  = kernel/xenomai/skins/rtdm/drvlib.c:857 
(rtdm_event_signal(), CPU #0)
[ 3802.077955] Xenomai: stuck on nucleus lock c188d4c0
[ 3802.077955]    waiter = kernel/xenomai/nucleus/intr.c:114 
(xnintr_clock_handler(), CPU #1)
[ 3802.077955]    owner  = kernel/xenomai/skins/rtdm/drvlib.c:857 
(rtdm_event_signal(), CPU #0)
[ 3802.078610] Xenomai: stuck on nucleus lock c188d4c0
[ 3802.078610]    waiter = kernel/xenomai/nucleus/intr.c:114 
(xnintr_clock_handler(), CPU #3)
[ 3802.078610]    owner  = kernel/xenomai/skins/rtdm/drvlib.c:857 
(rtdm_event_signal(), CPU #0)
[ 3802.077955] Xenomai: stuck on nucleus lock c188d4c0
[ 3802.077955]    waiter = kernel/xenomai/nucleus/intr.c:114 
(xnintr_clock_handler(), CPU #1)
[ 3802.077955]    owner  = kernel/xenomai/skins/rtdm/drvlib.c:857 
(rtdm_event_signal(), CPU #0)
[ 3802.078610] Xenomai: stuck on nucleus lock c188d4c0
[ 3802.078610]    waiter = kernel/xenomai/nucleus/intr.c:114 
(xnintr_clock_handler(), CPU #3)
[ 3802.078610]    owner  = kernel/xenomai/skins/rtdm/drvlib.c:857 
(rtdm_event_signal(), CPU #0)
[ 3802.078363] Xenomai: stuck on nucleus lock c188d4c0
[ 3802.078363]    waiter = kernel/xenomai/nucleus/intr.c:114 
(xnintr_clock_handler(), CPU #2)
...

(yes, mys PC is equipped with a 4xcores i7).

My question is: how and why a "simple" "rtdm_event_signal()" may lock 
the entire system?
I know these system calls are using some global locks, but, in that 
case, why the
"rtdm_event_signal()" does not put this lock back?

Note that the rtdm_event_signal() is called by the ISR each time the Tx 
fifo is not full.
Thus, there are many calls before the hang that succeed! So it is 
reasonable to omit the cases
when the event pointer and/or its content is invalid...

Finally, note that the lock may also occur when the user task enters the 
rtdm_event_timedwait() call:

[  343.660015]    waiter = kernel/xenomai/nucleus/intr.c:114 
(xnintr_clock_handler(), CPU #3)
[  343.660015]    owner  = kernel/xenomai/skins/rtdm/drvlib.c:957 
(rtdm_event_timedwait(), CPU #1)

Any suggestion would be welcome.

Many thanks in advance for your help!

Stephane


--
PEAK-System Technik GmbH
Sitz der Gesellschaft Darmstadt
Handelsregister Darmstadt HRB 9183 
Geschaeftsfuehrung: Alexander Gach, Uwe Wilhelm
--


             reply	other threads:[~2015-09-04 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-04 14:24 Stephane Grosjean [this message]
2015-09-04 15:17 ` [Xenomai] Fighting with deadlock in xenomai 2.6.3 + linux 3.5.7 Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55E9A9B6.50802@peak-system.com \
    --to=s.grosjean@peak-system.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.