All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "Stoidner, Christoph" <c.stoidner@arvero.de>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Sleeping function called from invalid context
Date: Sun, 7 Dec 2014 13:40:41 +0100	[thread overview]
Message-ID: <20141207124041.GS10014@hermes.click-hack.org> (raw)
In-Reply-To: <471986235a5c47e395ece6b3d18830bd@EX132MBOX1A.de2.local>

On Sat, Dec 06, 2014 at 02:19:27PM +0000, Stoidner, Christoph wrote:
> 
> Hi at all,
> 
> I am using linux 3.10.18 and ipipe-core-3.10.18-arm-1 on a Freescale i.MX28. I have also merged PREEMPT RT rt14 into the kernel. FCSE is disabled.
> 
> I have enabled several debug options in the kernel. When a started program exits I get the message below:
> 
> [   33.187104] BUG: sleeping function called from invalid context at kernel/rtmutex.c:659
> [   33.187125] in_atomic(): 1, irqs_disabled(): 128, pid: 87, name: 
> [   33.187138] 1 lock held by /87:
> [   33.187213]  #0:  (rcu_read_lock){......}, at: [<c002add8>] __lock_task_sighand+0x24/0xf4
> [   33.187232] Preemption disabled at:[<  (null)>]   (null)
> [   33.187237] 
> [   33.187262] CPU: 0 PID: 87 Comm:  Not tainted 3.10.18-rt14-arvero-rev01-ipipe #2
> [   33.187337] [<c0013110>] (unwind_backtrace+0x0/0xf0) from [<c001158c>] (show_stack+0x10/0x14)
> [   33.187398] [<c001158c>] (show_stack+0x10/0x14) from [<c04a0b70>] (rt_spin_lock+0x20/0x64)
> [   33.187444] [<c04a0b70>] (rt_spin_lock+0x20/0x64) from [<c002ae28>] (__lock_task_sighand+0x74/0xf4)
> [   33.187479] [<c002ae28>] (__lock_task_sighand+0x74/0xf4) from [<c002aecc>] (do_send_sig_info+0x24/0x64)
> [   33.187522] [<c002aecc>] (do_send_sig_info+0x24/0x64) from [<c00b0878>] (lostage_handler+0xf8/0x128)
> [   33.187568] [<c00b0878>] (lostage_handler+0xf8/0x128) from [<c0073860>] (rthal_apc_handler+0x60/0x84)
> [   33.187615] [<c0073860>] (rthal_apc_handler+0x60/0x84) from [<c0066a58>] (__ipipe_do_sync_stage+0x1f8/0x288)
> [   33.187655] [<c0066a58>] (__ipipe_do_sync_stage+0x1f8/0x288) from [<c00145c0>] (__ipipe_syscall_root+0xf4/0x13c)
> [   33.187694] [<c00145c0>] (__ipipe_syscall_root+0xf4/0x13c) from [<c000ea34>] (vector_swi+0x54/0x74)
> 
> For me it seems as I have done something wrong when merging spinlocks of PREEMPT RT and ipipe. Isn't rt_spin_lock() allowed to be called within that context? Does anyone has an idea why?

>From what I understand of Xenomai 2.6 code (if this is the version
you are using), normally, the apc should be invoked from the
rthal_apc_thread context, not from rthal_apc_handler.

The virq handler should be rthal_apc_kicker, which wakes up the
process.

This code is #ifdef CONFIG_PREEMPT_RT, is not CONFIG_PREEMPT_RT
defined in your kernel ?

-- 
					    Gilles.


  parent reply	other threads:[~2014-12-07 12:40 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-06 14:19 [Xenomai] Sleeping function called from invalid context Stoidner, Christoph
2014-12-06 14:25 ` Gilles Chanteperdrix
2014-12-06 15:11   ` Stoidner, Christoph
2014-12-07 12:32     ` Stoidner, Christoph
2014-12-07 12:40 ` Gilles Chanteperdrix [this message]
2014-12-07 13:50   ` Stoidner, Christoph
2014-12-07 13:52     ` Gilles Chanteperdrix
2014-12-07 15:05       ` Stoidner, Christoph
2014-12-09 20:06         ` Stoidner, Christoph
2014-12-09 20:08           ` Gilles Chanteperdrix
2014-12-09 20:18             ` Stoidner, Christoph
2014-12-09 20:24               ` Gilles Chanteperdrix
2014-12-09 20:34                 ` Stoidner, Christoph
2014-12-09 20:37                   ` Gilles Chanteperdrix
2014-12-09 20:47                     ` Stoidner, Christoph
2014-12-09 20:55                       ` Gilles Chanteperdrix
2014-12-09 20:49           ` Stoidner, Christoph
2014-12-09 20:59             ` Gilles Chanteperdrix
2014-12-10 16:23               ` Stoidner, Christoph
2014-12-10 16:26                 ` Gilles Chanteperdrix
2014-12-10 18:23                   ` Stoidner, Christoph
2014-12-10 18:41                     ` Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2014-12-10 18:58 Stoidner, Christoph
2014-12-10 19:01 ` Gilles Chanteperdrix
2014-12-11 10:00   ` Stoidner, Christoph
2014-12-11 10:05     ` Gilles Chanteperdrix
2014-12-11 10:18       ` Stoidner, Christoph
2014-12-11 10:22         ` Gilles Chanteperdrix
2014-12-11 10:29           ` Stoidner, Christoph
2014-12-11 10:47             ` Gilles Chanteperdrix
2014-12-11 11:17               ` Stoidner, Christoph
2014-12-11 14:47                 ` Gilles Chanteperdrix
2014-12-11 15:47                   ` Stoidner, Christoph
2014-12-11 16:06                     ` Gilles Chanteperdrix
2014-12-11 16:31                       ` Stoidner, Christoph
2014-12-11 16:38                         ` Gilles Chanteperdrix
2014-12-11 19:23                           ` Stoidner, Christoph
2014-12-12 16:42                             ` Stoidner, Christoph
2014-12-15 11:42                               ` Stoidner, Christoph
2014-12-15 13:23                                 ` Gilles Chanteperdrix
2014-12-15 13:29                                   ` Stoidner, Christoph
2014-12-15 14:20                                     ` Gilles Chanteperdrix
2014-12-15 15:11                                       ` Stoidner, Christoph
2014-12-15 15:19                                         ` Gilles Chanteperdrix
2014-12-17 12:24                                           ` Stoidner, Christoph
2014-12-17 12:38                                             ` Gilles Chanteperdrix
2014-12-17 13:22                                             ` Gilles Chanteperdrix
2014-12-17 15:46                                               ` Gilles Chanteperdrix
2014-12-17 22:40                                                 ` Stoidner, Christoph

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=20141207124041.GS10014@hermes.click-hack.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=c.stoidner@arvero.de \
    --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.