All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Dmitry Adamushko <dmitry.adamushko@domain.hid>
Cc: xenomai@xenomai.org
Subject: [Xenomai-core] Re: More on Shared interrupts
Date: Tue, 14 Feb 2006 18:46:14 +0100	[thread overview]
Message-ID: <43F21766.70109@domain.hid> (raw)
In-Reply-To: <b647ffbd0602110335u58e2d4cek@domain.hid>

Dmitry Adamushko wrote:
> 
>  > >
>  > >   irq K  | ----------- | ---o    |   // Linux only
>  > >   ...
>  > >   irq L  | ---o        |         |   // RT-only
>  > >   ...
>  > >   irq M  | ---o------- | ---o    |   // Shared between domains
>  > >   ...
>  > >   irq N  | ---o---o--- |         |   // Shared inside single domain
>  > >   ...
>  > >   irq O  | ---o---o--- | ---o    |   // Shared between and inside 
> single
>  > > domain
>  > >
>  > > Xenomai currently handles the K & L cases, Dmitrys patch addresses 
> the N
>  > > case, with edge triggered interrupts the M (and O after Dmitry's patch)
>  > > case(s) might be handled by returning RT_INTR_CHAINED | RT_INTR_ENABLE
>  > >
>  >
>  > As you pointed out recently, using this combo for M (and thus O) 
> might also be
>  > unsafe, e.g. causing some implementation to send eoi twice or more 
> (and the second
>  > time while hw IRQs are off and the second IRQ is still pending) if 
> more than a
>  > single domain ends the current interrupt. This said, I've never tried 
> that
>  > actually, but this does seem a bit optimistic to always expect a 
> proper behaviour
>  > in this case (basically, it all depends on what "ending" the 
> interrupt means hw-wise).
> 
> 
> Just to be sure I've got the things more or less clear. I feel there are 
> some holes in my understanding of the irq handling stuff, mainly hw-wise.
> 
> x86 + i8259A.
> 
> In this case, .end handler does nothing more than enabling the IRQ line.
> The "eoi" is sent in .ack right after disabling the IRQ line.
> 
> Let's suppose we have the "M" case ("O" makes no difference here).
> 
> When the ISR handler in Linux domain gets control :
> 
> - the IRQ line is ON (it was already .end-ed in the primary domain in case
>   of XN_ISR_ENABLE | XN_ISR_CHAINED ).
> 
> ===
>   Actually, it's possible to set IPIPE_PASS flag for
>   the primary_domain.irqs[THIS_IRQ].control
>   when THIS_IRQ is shared across domains. This way, there is no need
>   to call propagate_irq() in xnintr_irq_handler(). Ok, it's not
>   that important so far.
> ===
> 
>   This is not how it happens when the IRQ is only handled in the
>   Linux domain. But the ISR is still serialized (need not to be
>   reentrant) because do_IRQ() takes care of it (by means
>   of RUNNING and PENDING flags).
> 
> So, I suppose, it's possible to use XN_ISR_ENABLE | XN_ISR_CHAINED in that
> case?
> 
> In case of a pure Linux :
> 
> SMP : I/O APIC + local APICs. As I know, enabling/disabling
> the IRQ line occurs (normally?) on per-local APIC basis. This said, when
> the ISR is running on CPU_0 with the IRQ line disabled, nothing prevents
> (probably, if the IRQ also was .ack-ed by that time?) the same IRQ from
> being signaled on another CPU (even on a few).
> In that case, it gets marked as PENDING and do_IRQ() on CPU_0 will run
> handler_IRQ_events() - ISR handlers - once more.
> 
> Since PENDING is only a flag (not a counter), the fact that the IRQ was 
> signaled
> is not lost but Linux can't know how much time it was signaled.
> I guess, it's not true for devices that e.g. do not rise a new interrupt 
> until
> the ISR handler does some special acknowledgement device-wise.
> 
> am I right?

Yes. Additionally, the uncertainty about the last issue is one of the reasons why 
Adeos keeps a count of pending IRQs, and not just a flag; the other being that we 
do want virtual interrupts to be counted and not just marked so that the software 
can rely on this.

> 
> 
> -- 
> Best regards,
> Dmitry Adamushko


-- 

Philippe.


  parent reply	other threads:[~2006-02-14 17:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-07  9:04 [Xenomai-core] [Combo-PATCH] Shared interrupts (final) Dmitry Adamushko
2006-02-07  9:58 ` Wolfgang Grandegger
2006-02-07 17:58   ` Jan Kiszka
2006-02-08  7:26     ` Wolfgang Grandegger
2006-02-08  8:24       ` Jan Kiszka
2006-02-08 10:12         ` Dmitry Adamushko
2006-02-08 10:57     ` Philippe Gerum
2006-02-09  8:30       ` Anders Blomdell
2006-02-09  9:11         ` Jan Kiszka
2006-02-09 10:07           ` Philippe Gerum
2006-02-09  9:59         ` Philippe Gerum
2006-02-09 10:19           ` Jan Kiszka
2006-02-09 11:11             ` Dmitry Adamushko
2006-02-09 15:46               ` [Xenomai-core] More on Shared interrupts Anders Blomdell
2006-02-09 16:39                 ` Jan Kiszka
2006-02-10  8:04                   ` Anders Blomdell
2006-02-10 13:59                 ` [Xenomai-core] " Philippe Gerum
2006-02-11 11:35                   ` Dmitry Adamushko
2006-02-13  7:49                     ` Anders Blomdell
2006-02-13 11:00                       ` Dmitry Adamushko
2006-02-14 17:46                     ` Philippe Gerum [this message]
2006-02-16 16:05                 ` [Xenomai-core] " Anders Blomdell
2006-02-09 11:14             ` [Xenomai-core] [Combo-PATCH] Shared interrupts (final) Philippe Gerum
2006-02-09 10:43           ` Anders Blomdell
2006-02-07 19:24   ` Dmitry Adamushko

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=43F21766.70109@domain.hid \
    --to=rpm@xenomai.org \
    --cc=dmitry.adamushko@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.