From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Thierry Bultel <thierry.bultel@wanadoo.fr>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Target frozen with rtcan_virt
Date: Tue, 09 Oct 2012 23:34:36 +0200 [thread overview]
Message-ID: <5074986C.8000509@xenomai.org> (raw)
In-Reply-To: <50741C5B.4060206@wanadoo.fr>
On 10/09/2012 02:45 PM, Thierry Bultel wrote:
> (snip)
> (gdb) bt
> #0 __ticket_spin_lock (lock=<optimized out>) at
> /home/thierry/workspace/Buildroot/output/build/linux-3.2.21/arch/x86/include/asm/spinlock.h:63
> #1 arch_spin_lock (lock=<optimized out>) at
> /home/thierry/workspace/Buildroot/output/build/linux-3.2.21/arch/x86/include/asm/spinlock.h:129
> #2 rtcan_raw_recvmsg (context=0xc7ff0000, user_info=0xd00b2290,
> msg=0xd796df04, flags=<optimized out>) at
> drivers/xenomai/can/rtcan_raw.c:655
> (snip)
>
>
> In my previous configuration, disabling CONFIG_SMP was enough to
> workaround it, but in that new case
> I have other bad side-effects (console and X server frozen at startup)
> that prevent me to work correctly.
That is essentially the same backtrace as in the first case. Could you
try the following patch?
diff --git a/ksrc/drivers/can/rtcan_raw.c b/ksrc/drivers/can/rtcan_raw.c
index ded024e..b07f19c 100644
--- a/ksrc/drivers/can/rtcan_raw.c
+++ b/ksrc/drivers/can/rtcan_raw.c
@@ -695,10 +695,7 @@ ssize_t rtcan_raw_recvmsg(struct rtdm_dev_context *context,
/* Message completely read from the socket's ring buffer. Now check if
* caller is just peeking. */
- if (flags & MSG_PEEK)
- /* Next one, please! */
- rtdm_sem_up(&sock->recv_sem);
- else
+ if ((flags & MSG_PEEK) == 0)
/* Adjust begin of first message in the ring buffer. */
sock->recv_head = recv_buf_index;
@@ -707,6 +704,11 @@ ssize_t rtcan_raw_recvmsg(struct rtdm_dev_context *context,
rtdm_lock_put_irqrestore(&rtcan_socket_lock, lock_ctx);
+ if (flags & MSG_PEEK)
+ /* Next one, please! */
+ rtdm_sem_up(&sock->recv_sem);
+
+
/* Create CAN socket address to give back */
if (msg->msg_namelen) {
scan.can_family = AF_CAN;
--
Gilles.
next prev parent reply other threads:[~2012-10-09 21:34 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <505EB99F.7050705@wanadoo.fr>
2012-09-23 7:42 ` [Xenomai] Target frozen with rtcan_virt Thierry Bultel
2012-09-23 13:23 ` Gilles Chanteperdrix
2012-09-23 14:57 ` Thierry Bultel
2012-09-23 14:59 ` Gilles Chanteperdrix
2012-10-09 12:45 ` Thierry Bultel
2012-10-09 21:34 ` Gilles Chanteperdrix [this message]
2012-10-09 21:41 ` Gilles Chanteperdrix
2012-10-09 21:51 ` Gilles Chanteperdrix
2012-10-10 7:38 ` Thierry Bultel
2012-10-10 7:51 ` Gilles Chanteperdrix
2012-10-10 7:56 ` Jan Kiszka
2012-10-10 8:04 ` Gilles Chanteperdrix
2012-10-10 8:10 ` Jan Kiszka
2012-10-10 8:58 ` Gilles Chanteperdrix
2012-10-10 9:01 ` Jan Kiszka
2012-10-10 9:23 ` Gilles Chanteperdrix
2012-10-10 10:04 ` Jan Kiszka
2012-10-10 10:07 ` Gilles Chanteperdrix
2012-10-10 10:25 ` Jan Kiszka
2012-10-10 10:54 ` Philippe Gerum
2012-10-10 11:30 ` Gilles Chanteperdrix
2012-10-10 12:09 ` Philippe Gerum
2012-10-10 12:33 ` Gilles Chanteperdrix
2012-10-10 12:41 ` Philippe Gerum
2012-10-10 12:43 ` Philippe Gerum
2012-10-10 12:45 ` Philippe Gerum
2012-10-10 12:55 ` Gilles Chanteperdrix
2012-10-10 12:57 ` Philippe Gerum
2012-10-10 13:01 ` Gilles Chanteperdrix
2012-10-10 13:09 ` Philippe Gerum
2012-10-10 13:16 ` Gilles Chanteperdrix
2012-10-10 13:18 ` Philippe Gerum
2012-10-10 13:19 ` Gilles Chanteperdrix
2012-10-10 13:57 ` Philippe Gerum
2012-10-10 14:52 ` Gilles Chanteperdrix
2012-10-11 8:05 ` Gilles Chanteperdrix
2012-11-05 13:33 ` Thierry Bultel
2012-11-05 18:46 ` Gilles Chanteperdrix
2012-11-06 7:22 ` Thierry Bultel
2012-11-06 11:59 ` Philippe Gerum
2012-11-06 14:49 ` Gilles Chanteperdrix
2012-10-10 13:17 ` Philippe Gerum
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=5074986C.8000509@xenomai.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=thierry.bultel@wanadoo.fr \
--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.