All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Tomas Kalibera <kalibera@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Cannot end interrupt from user space: add	rt_intr_end call ?
Date: Thu, 24 Apr 2008 10:45:20 +0200	[thread overview]
Message-ID: <481048A0.7040101@domain.hid> (raw)
In-Reply-To: <48100D81.9090109@domain.hid>

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

Tomas Kalibera wrote:
> Hi,
> 
> I think that when I handle interrupts from user space, I cannot 
> correctly use I_NOAUTOENA. The thing is that this flag in fact means "do 
> not call automatically xnarch_end_irq". The xnarch_end_irq call usually 
> maps to unmasking the interrupt, but not always - depending on interrupt 
> type (sometimes in eoi, sometimes is nop).
> 
> I was thinking that it would be nice if I could call something like 
> "xnarch_end_irq" (i.e. rt_intr_end) from user space, so that I could 
> correctly use I_NOAUTOENA to control the flow of interrupts.
>

What would this buy you? xnarch_irq_end() would still handle the unmasking logic
depending on the interrupt type, because it knows how the interrupt was
acknowledged in the first place -- in contrast, the application does not and
should not.

xnarch_end_irq() basically calls the ->unmask() method of the interrupt chip
descriptor, which is the same as calling rt_intr_enable(). Before you do that,
you may want to try the attached patch, which makes sure that
rt_intr_enable/disable are eagerly routed to unmask/mask on x86 for post-2.6.18
kernels. That patch is expected to solve the "rt_intr_disable() not masking
IO-APIC interrupt" issue we discussed earlier.

> Cheers,
> Tomas
> 
> 
> 
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
> 


-- 
Philippe.

[-- Attachment #2: unconditionally-apply-irq-enable-disable-requests-to-pic.patch --]
[-- Type: text/x-diff, Size: 1666 bytes --]

Index: include/asm-x86/wrappers_32.h
===================================================================
--- include/asm-x86/wrappers_32.h	(revision 3708)
+++ include/asm-x86/wrappers_32.h	(working copy)
@@ -163,8 +163,8 @@
 
 #define rthal_irq_chip_end(irq)	rthal_irq_chip_enable(irq)
 #else /* >= 2.6.19 */
-#define rthal_irq_chip_enable(irq)   ({ rthal_irq_descp(irq)->chip->enable(irq); 0; })
-#define rthal_irq_chip_disable(irq)  ({ rthal_irq_descp(irq)->chip->disable(irq); 0; })
+#define rthal_irq_chip_enable(irq)   ({ rthal_irq_descp(irq)->chip->unmask(irq); 0; })
+#define rthal_irq_chip_disable(irq)  ({ rthal_irq_descp(irq)->chip->mask(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;
 
Index: include/asm-x86/wrappers_64.h
===================================================================
--- include/asm-x86/wrappers_64.h	(revision 3708)
+++ include/asm-x86/wrappers_64.h	(working copy)
@@ -31,8 +31,8 @@
 #define rthal_irq_descp(irq)		(irq_desc + irq)
 #define rthal_irq_desc_status(irq)	(rthal_irq_descp(irq)->status)
 
-#define rthal_irq_chip_enable(irq)   ({ rthal_irq_descp(irq)->chip->enable(irq); 0; })
-#define rthal_irq_chip_disable(irq)  ({ rthal_irq_descp(irq)->chip->disable(irq); 0; })
+#define rthal_irq_chip_enable(irq)   ({ rthal_irq_descp(irq)->chip->unmask(irq); 0; })
+#define rthal_irq_chip_disable(irq)  ({ rthal_irq_descp(irq)->chip->mask(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;

  reply	other threads:[~2008-04-24  8:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24  4:33 [Xenomai-core] Cannot end interrupt from user space: add rt_intr_end call ? Tomas Kalibera
2008-04-24  8:45 ` Philippe Gerum [this message]
2008-04-24 16:08   ` Tomas Kalibera
2008-04-24 16:39     ` Philippe Gerum
2008-04-24 19:16       ` Tomas Kalibera
2008-04-25  7:12         ` 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=481048A0.7040101@domain.hid \
    --to=rpm@xenomai.org \
    --cc=kalibera@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.