All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Xenomai-core@domain.hid
Subject: Re: [Xenomai-core] latency hangs on AT91RM9200
Date: Mon, 26 Feb 2007 12:21:39 +0100	[thread overview]
Message-ID: <45E2C2C3.1020202@domain.hid> (raw)
In-Reply-To: <45E2B3A1.8070102@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

Gilles Chanteperdrix wrote:
> Ok, found the bug (actually, Philippe did), as almost expected, the way
> it is related to the latency program period is not really obvious. The
> bug is that in the macro "irq_handler" in entry-armv.S, the return value
> (in r0) of __ipipe_grab_irq is overriden by the subsequent call to
> get_irqnr_and_base.
> 

Here comes a patch. Note that it will only work correctly with
CONFIG_PREEMPT disabled for now.

-- 
                                                 Gilles Chanteperdrix

[-- Attachment #2: ipipe-arm-irq_handler_fix.diff --]
[-- Type: text/x-patch, Size: 1013 bytes --]

--- arch/arm/kernel/entry-armv.S~	2007-02-26 11:55:18.000000000 +0100
+++ arch/arm/kernel/entry-armv.S	2007-02-26 12:07:45.000000000 +0100
@@ -29,12 +29,16 @@
  * Interrupt handling.  Preserves r7, r8, r9
  */
 	.macro	irq_handler
-1:	get_irqnr_and_base r0, r6, r5, lr
+#ifdef CONFIG_IPIPE
+	mov r0, #2
+#endif
+1:	get_irqnr_and_base r4, r6, r5, lr
 	movne	r1, sp
 	@
 	@ routine called with r0 = irq number, r1 = struct pt_regs *
 	@
 	adrne	lr, 1b
+	movne   r0, r4
 #ifdef CONFIG_IPIPE
 	bne	__ipipe_grab_irq
 #else
@@ -48,19 +52,23 @@
 	 * this macro assumes that irqstat (r6) and base (r5) are
 	 * preserved from get_irqnr_and_base above
 	 */
-	test_for_ipi r0, r6, r5, lr
+	test_for_ipi r4, r6, r5, lr
 	movne	r0, sp
 	adrne	lr, 1b
 	bne	do_IPI
 
 #ifdef CONFIG_LOCAL_TIMERS
-	test_for_ltirq r0, r6, r5, lr
+	test_for_ltirq r4, r6, r5, lr
 	movne	r0, sp
 	adrne	lr, 1b
 	bne	do_local_timer
 #endif
 #endif
-
+#ifdef CONFIG_IPIPE
+	cmp	r0, #2
+	moveq	r0, sp
+	bleq	__ipipe_check_root
+#endif	
 	.endm
 
 /*

  reply	other threads:[~2007-02-26 11:21 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-23 11:27 [Xenomai-core] latency hangs on AT91RM9200 Steven Scholz
2007-02-23 13:16 ` Gilles Chanteperdrix
2007-02-23 13:26   ` Philippe Gerum
2007-02-23 13:53     ` Steven Scholz
2007-02-23 13:50   ` Steven Scholz
2007-02-23 13:57     ` Philippe Gerum
2007-02-23 13:56       ` Steven Scholz
2007-02-23 14:12         ` Philippe Gerum
2007-02-23 14:16           ` Steven Scholz
2007-02-23 14:11     ` Gilles Chanteperdrix
2007-02-23 14:14       ` Steven Scholz
2007-02-23 14:21         ` Jan Kiszka
2007-02-23 15:02           ` Steven Scholz
2007-02-23 15:09             ` Jan Kiszka
2007-02-23 14:24         ` Gilles Chanteperdrix
2007-02-23 14:33         ` Steven Scholz
2007-02-23 15:05           ` Gilles Chanteperdrix
2007-02-23 14:36         ` Jan Kiszka
2007-02-23 14:39           ` Steven Scholz
2007-02-23 14:41             ` Jan Kiszka
2007-02-26 10:11               ` Steven Scholz
2007-02-23 13:25 ` Philippe Gerum
2007-02-23 13:49 ` Steven Scholz
2007-02-23 15:14 ` Steven Scholz
2007-02-23 15:23   ` Gilles Chanteperdrix
2007-02-23 15:28     ` Jan Kiszka
2007-02-23 16:41   ` Gilles Chanteperdrix
2007-02-26 10:17     ` Gilles Chanteperdrix
2007-02-26 11:21       ` Gilles Chanteperdrix [this message]
2007-02-26 13:36         ` Steven Scholz
2007-03-08  8:28         ` Steven Scholz
2007-03-08  8:43           ` Gilles Chanteperdrix
2007-03-08  8:46             ` Steven Scholz
2007-03-08  9:18               ` 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=45E2C2C3.1020202@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=Xenomai-core@domain.hid \
    /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.