All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dmitry Adamushko" <dmitry.adamushko@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai@xenomai.org
Subject: [Xenomai-core] [PATCH] shirq correction
Date: Sat, 11 Mar 2006 12:44:27 +0200	[thread overview]
Message-ID: <b647ffbd0603110244y64ff4495t@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 291 bytes --]

Hello,

I overlooked that the logic of decrementing the interrupt nesting count has
been changed recently and
both xnintr_shirq_handler() and xnintr_edge_shirq_handler() behave wrong in
this respect.

The attached patch fixes this misbehavior.

--
Best regards,
Dmitry Adamushko

[-- Attachment #1.2: Type: text/html, Size: 350 bytes --]

[-- Attachment #2: intr.c.patch --]
[-- Type: application/octet-stream, Size: 1075 bytes --]

--- intr.c-old	2006-03-10 11:07:42.000000000 +0100
+++ intr.c	2006-03-10 11:08:47.000000000 +0100
@@ -493,14 +493,12 @@ static void xnintr_shirq_handler (unsign
         }
     xnintr_shirq_unlock(shirq);
 
-    --sched->inesting;
-
     if (s & XN_ISR_PROPAGATE)
 	xnarch_chain_irq(irq);
     else if (!(s & XN_ISR_NOENABLE))
 	xnarch_end_irq(irq);
 
-    if (sched->inesting == 0 && xnsched_resched_p())
+    if (--sched->inesting == 0 && xnsched_resched_p())
 	xnpod_schedule();
 
     xnltt_log_event(xeno_ev_iexit,irq);
@@ -557,8 +555,6 @@ static void xnintr_edge_shirq_handler (u
 
     xnintr_shirq_unlock(shirq);
 
-    --sched->inesting;
-
     if (counter > MAX_EDGEIRQ_COUNTER)
 	xnlogerr("xnintr_edge_shirq_handler() : failed to get the IRQ%d line free.\n", irq);
 
@@ -567,7 +563,7 @@ static void xnintr_edge_shirq_handler (u
     else if (!(s & XN_ISR_NOENABLE))
 	xnarch_end_irq(irq);
 
-    if (sched->inesting == 0 && xnsched_resched_p())
+    if (--sched->inesting == 0 && xnsched_resched_p())
 	xnpod_schedule();
 
     xnltt_log_event(xeno_ev_iexit,irq);

[-- Attachment #3: ChangeLog --]
[-- Type: application/octet-stream, Size: 220 bytes --]


2006-03-10  Dmitry Adamushko <dmitry.adamushko@domain.hid>

	* ksrc/nucleus/intr.c (xnintr_shirq_handler, xintr_edge_shirq_handler):
	Decrement the interrupt nesting count the same way as xnintr_irq_handler()
	does it.

             reply	other threads:[~2006-03-11 10:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-11 10:44 Dmitry Adamushko [this message]
2006-03-11 11:47 ` [Xenomai-core] Re: [PATCH] shirq correction 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=b647ffbd0603110244y64ff4495t@domain.hid \
    --to=dmitry.adamushko@domain.hid \
    --cc=rpm@xenomai.org \
    --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.