All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Antonio Garcia Redondo <juan-antonio.garcia@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: jagarcia@domain.hid, xenomai@xenomai.org
Subject: Re: [Xenomai-help] PIOX irq problems with at91sam9260
Date: Fri, 21 Dec 2007 09:27:24 +0100	[thread overview]
Message-ID: <20071221082724.GA9091@domain.hid> (raw)
In-Reply-To: <2ff1a98a0712190838n68ea4dacs9a27834e07de4939@domain.hid>

I've found a workaround for my problem, but I'm not sure if is the
correct solution.

First, my test program test_irq.c had an error, after request the irq,
it have be enabled; anyway the problem persists because the
__ipipe_mach_demux_irq find the irq disabled (gpio->depth = 1).

My workaround:
+++ wrappers.h	2007-12-21 08:19:19.000000000 +0100
@@ -74,8 +74,15 @@
 #define rthal_irq_chip_disable(irq)  ({
rthal_irq_descp(irq)->chip->disable(irq); 0; })
 #define rthal_irq_chip_end(irq)      ({
rthal_irq_descp(irq)->ipipe_end(irq, rthal_irq_descp(irq)); 0; })
 typedef irq_handler_t rthal_irq_host_handler_t;
-#define rthal_mark_irq_disabled(irq) (rthal_irq_desc_status(irq) |=
IRQ_DISABLED)
-#define rthal_mark_irq_enabled(irq) (rthal_irq_desc_status(irq) &=
~IRQ_DISABLED)
+#define rthal_mark_irq_disabled(irq) do {              \
+            rthal_irq_desc_status(irq) |= IRQ_DISABLED; \
+            rthal_irq_descp(irq)->depth = 1;            \
+        } while(0);
+#define rthal_mark_irq_enabled(irq) do {                 \
+            rthal_irq_desc_status(irq) &= ~IRQ_DISABLED; \
+            rthal_irq_descp(irq)->depth = 0;             \
+        } while(0);
+#endif

Regards,
	Juan Antonio



  reply	other threads:[~2007-12-21  8:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-19 15:06 [Xenomai-help] PIOX irq problems with at91sam9260 Juan Antonio Garcia Redondo
2007-12-19 16:38 ` Gilles Chanteperdrix
2007-12-21  8:27   ` Juan Antonio Garcia Redondo [this message]
2007-12-26 21:51     ` Gilles Chanteperdrix
2007-12-28  8:29       ` Juan Antonio Garcia Redondo
2007-12-28 10:02         ` Gilles Chanteperdrix
2007-12-28 11:34           ` Juan Antonio Garcia Redondo
2007-12-28 21:29         ` 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=20071221082724.GA9091@domain.hid \
    --to=juan-antonio.garcia@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.org \
    --cc=jagarcia@domain.hid \
    --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.