From: Anders Blomdell <anders.blomdell@domain.hid>
To: Dmitry Adamushko <dmitry.adamushko@domain.hid>
Cc: Jan Kiszka <jan.kiszka@domain.hid>, xenomai@xenomai.org
Subject: Re: [Xenomai-core] Re: [PATCH] Shared interrupts (ready to merge)
Date: Wed, 22 Feb 2006 14:15:06 +0100 [thread overview]
Message-ID: <43FC63DA.3010103@domain.hid> (raw)
In-Reply-To: <b647ffbd0602220445k749d630j@domain.hid>
Dmitry Adamushko wrote:
>
> > For RTDM I'm now almost determined to rework the API in way that only
> > HANDLED/UNHANDLED (or what ever their names will be) get exported, any
> > additional guru features will remain excluded as long as we have no
> > clean usage policy for them.
>
> Good. Then let's go for
>
> HANDLED, UNHANDLED - we may consider them even as 2 scalar values
>
> +
>
> NOENABLE, CHAINED - additional bits.
>
> They are not encouraged to be used with shared interrupts
> (explained in docs + debug messages when XENO_OPT_DEBUG is on).
>
> Any ISR on the shared irq line should "understand" that it's
> just one among the equals. That said, it should not do anything
> that may affect other ISRs and not require any special treatment
> (like CHAINED or NOENABLE).
> If it wants it indeed, then don't declare itself as SHARED.
>
> We may come back to the topic about possible return values of ISRs
> a bit later maybe having got more feedback (hm.. hopefully)
> on shared irq support.
>
>
> >>>
> >>> But the later one is not only about enabling the line, but
> >>> on some archs - about .end-ing it too (sending EOI).
> >>>
> >>> And to support HANDLED_NOENABLE properly, those 2 have to be
> >>> decoupled, i.e.
> >>> EOI should always be sent from xnintr_shirq_handler().
> >> But the one returning HANDLED_NOENABLE is likely to leave the interrupt
> >> asserted, hence we can't EOI at this point (unless NO_ENABLE means
> >> DISABLE).
> >
> >I guess this is what Dmitry meant: explicitly call disable() if one or
> >more ISRs returned NOENABLE - at least on archs where end != enable.
> >Will this work? We could then keep on using the existing IRQ-enable API
> >from bottom-half IRQ tasks.
>
> Almost.
>
> Let's consider the following only as anorther way of doing some things;
> I don't propose to implement it, it's just to illustrate my thoughts.
> So one may simply ski-skip-skip it :o)
>
> Let's keep in mind that what is behind .end-ing the IRQ line depends on
> archs.
> Sometimes end == enable (EOI was sent on .ack step), while in other cases
> end == send_EOI [+ re-enabling].
>
> But anyway, all ISRs are running with a given IRQ line disabled.
>
> Supported values : HANDLED, UNHANDLED, PROPAGATE.
>
> nucleus :: xnintr_irq_handler()
> {
> ret = 0;
>
> ...
>
> for each isr in isr_list[ IRQ ]
> {
> temp = isr->handler();
>
> if (temp > ret)
> ret = temp;
> }
>
> if (ret == PROPAGATE)
> {
> // quite dengerous with shared interrupts, be sure you understand
> // what you are doing!
>
> xnarch_chain_irq(irq); // will be .end-ed in Linux domain
> }
> else
> {
> // HANDLED or UNHANDLED
>
> xnarch_end_irq();
> }
>
> ...
>
> }
>
> ENABLE or NOENABLE is missing? Nop.
>
> let's say we have 2 rt-ISRs :
>
> isr1 : HANDLED
> isr2 : HANDLED + WISH
>
> WISH == I want the IRQ line remain disabled until later
> (e.g. bottom half in rt_task will enable it)
>
> How may isr2 express this WISH? Simply, xnarch_irq_disable/enable() should
> support an internal counter that allows them to be called in a nested way.
>
> So e.g. if there are 2 consecutive calls to disable_irq(), then
> 2 calls to enable_irq() are needed to really enable the IRQ line.
>
> This way, the WISH is only about directly calling xnarch_irq_disable()
> in isr2
> and there is no need in ENABLE or NOENABLE flags.
>
> This way, PROPAGATE really means NOEND - the IRQ will be .end-ed in
> Linux domain;
> while WISH==NOENABLE - has nothing to do with sending EOI, but only with
> enabling/disabling the given IRQ line.
>
> Yes, if one isr (or a few) defers the IRQ line enabling until later, it
> will affect
> all others ISR => all interrupts are temporary not accepted on this line.
> This scenario is possible under Linux, but should be used with even more
> care in real-time system. At least, this way HANDLED_NOENABLE case works
> and doesn't lead to lost interrupts on some archs.
>
> Moreover, it avoids the need for ENABLE flag even in non-shared
> interrupt case.
Lokks clean enough to me, i.e. no objections...
--
Anders
next prev parent reply other threads:[~2006-02-22 13:15 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-15 17:39 [Xenomai-core] [PATCH] Shared interrupts (ready to merge) Dmitry Adamushko
2006-02-16 0:18 ` [Xenomai-core] " Jan Kiszka
2006-02-16 10:20 ` Dmitry Adamushko
2006-02-16 12:58 ` Jan Kiszka
2006-02-16 13:58 ` Dmitry Adamushko
2006-02-16 14:12 ` Jan Kiszka
2006-02-16 19:28 ` Dmitry Adamushko
2006-02-16 20:38 ` Jan Kiszka
2006-02-18 20:04 ` Dmitry Adamushko
2006-02-18 21:37 ` Jan Kiszka
2006-02-20 13:53 ` Anders Blomdell
2006-02-20 16:40 ` Dmitry Adamushko
2006-02-21 8:42 ` Jan Kiszka
2006-02-21 10:45 ` Dmitry Adamushko
[not found] ` <43FAD322.4060001@domain.hid>
2006-02-21 10:54 ` Dmitry Adamushko
2006-02-21 11:28 ` Anders Blomdell
2006-02-21 11:49 ` Jan Kiszka
2006-02-21 16:48 ` Dmitry Adamushko
2006-02-21 17:04 ` Anders Blomdell
2006-02-21 17:49 ` Jan Kiszka
2006-02-21 18:50 ` Anders Blomdell
2006-02-22 12:45 ` Dmitry Adamushko
2006-02-22 13:15 ` Anders Blomdell [this message]
2006-02-22 21:59 ` Jan Kiszka
2006-02-23 12:21 ` Philippe Gerum
2006-02-25 20:14 ` Dmitry Adamushko
2006-02-26 18:51 ` Jan Kiszka
2006-02-26 19:15 ` Philippe Gerum
2006-02-26 19:21 ` Jan Kiszka
2006-02-26 20:37 ` Philippe Gerum
2006-02-27 8:14 ` Anders Blomdell
2006-02-27 8:23 ` Jan Kiszka
2006-02-27 9:20 ` Philippe Gerum
2006-02-21 11:39 ` Anders Blomdell
2006-02-21 8:39 ` Jan Kiszka
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=43FC63DA.3010103@domain.hid \
--to=anders.blomdell@domain.hid \
--cc=dmitry.adamushko@domain.hid \
--cc=jan.kiszka@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.