Message-ID: Date: Sat, 25 Feb 2006 22:14:15 +0200 From: "Dmitry Adamushko" Subject: Re: [Xenomai-core] Re: [PATCH] Shared interrupts (ready to merge) In-Reply-To: <43FDA8E2.5010806@domain.hid> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1745_26832109.1140898455168" References: <43FAF94C.4080709@domain.hid> <43FAFE58.5060201@domain.hid> <43FB480E.9020808@domain.hid> <43FB529B.3040207@domain.hid> <43FB6102.1070004@domain.hid> <43FDA8E2.5010806@domain.hid> List-Id: "Xenomai life and development \(bug reports, patches, discussions\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Philippe Gerum Cc: xenomai@xenomai.org ------=_Part_1745_26832109.1140898455168 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline > Ok, general bottom line regarding IRQ support (and the rest): > > 1- we want the rules applicable to the common case to be simple, well-defined and > straightforward. This applies to the ISR return value as exposed. > 2- some requirements might fall outside of the common case; to support them, we > need to refrain from imposing a strong policy, but only provide sound mechanisms > to implement that. Specifically, let's keep the basic ability to control the Adeos > pipelining from Xenomai intact. > 3- however, let's be true to the good old UNIX way-of-life: there is no point in > penalizing 99% of the common user base to please only 1% of them who happen to > have very specific needs. E.g., don't slow down the fast path everyone takes, > don't impose hard rules most of the users won't benefit from. Ack. > [I'm not referring > to the enable/disable nesting count here: this _is_ correct, and is currently > missing -- this should be done at Xeno's arch-level, not from the HAL which should > be kept the way it is to have a direct, unmoderated access to the PIC handling]. Let's consider it a bit. The counter as well as XENO_IRQ_DISABLED bit (or something similar) should be kept somewhere. So it's either xnintr_t or irq description in low-level ipipe code; we just don't want to introduce new structures and probably it's better to implement this feature on Xeno layer, rather than on ipipe one. Actually, xnintr_t is not visible from arch-level code. In order to support nested calls of irq_enable/disable, we should take additional control in all places where irq_desc[irq]->handler->enable/disable() are used (ok, hal interface is out of the scope, but e.g. xnintr_enable() and xnintr_disable() must be modified appropriately not to use this hal interface). Another thing is xnarch_irq_end() which re-enables the IRQ line upon exitting from interrupt handling code. It must make check for DISABLED bit (ISR might have called xnintr_disable() to defer the IRQ line enabling). For most part of the archs supported by Xeno, .ending (xnarch_irq_end()) is only about calling irq_desc[irq]->handler->enable() (handler->end() is never used) so it's not a problem to make a small wrappe= r that re-enables the IRQ line only when XENO_IRQ_DISABLED bit is not set. On ppc, irq_desc[irq]->handler->end() can be called indeed and we don't kno= w what's all about - at least, on the Xeno layer. So either handler->end() must check for XENO_IRQ_DISABLED - but this is an arch-level code in Linux (i.e. not the Xeno layer); or Xeno/arch/ppc must represent an .end substitution for each sub-arch supported. > IOW, the patch, the way you discussed it recently, is ok for me too. This said, I'm going to publish the shirq patch (after finalizing ISR retur= n bits, where I still have some doubts) without enable/disable nesting support. It can be supported at some point of time later, if it's really needed. -- > > Philippe. > -- Best regards, Dmitry Adamushko ------=_Part_1745_26832109.1140898455168 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

> Ok, general bottom line regarding IRQ support (and the rest):
>
> 1- we want the rules applicable to the common case to be simple, well-= defined and
> straightforward. This applies to the ISR return value as exposed.
> 2- some requirements might fall outside of the common case; to support= them, we
> need to refrain from imposing a strong policy, but only provide sound = mechanisms
> to implement that. Specifically, let's keep the basic ability to contr= ol the Adeos
> pipelining from Xenomai intact.
> 3- however, let's be true to the good old UNIX way-of-life: there is n= o point in
> penalizing 99% of the common user base to please only 1% of them who h= appen to
> have very specific needs. E.g., don't slow down the fast path everyone= takes,
> don't impose hard rules most of the users won't benefit from.

Ack.

> [I'm not referring
> to the enable/disable nesting count here: this _is_ correct, and is cu= rrently
> missing -- this should be done at Xeno's arch-level, not from the HAL = which should
> be kept the way it is to have a direct, unmoderated access to the PIC = handling].

Let's consider it a bit. The counter as well as XENO_IRQ_DISABLED bit (or s= omething similar)
should be kept somewhere. So it's either xnintr_t or irq description in low= -level
ipipe code; we just don't want to introduce new structures and probably
it's better to implement this feature on Xeno layer, rather than on ipipe o= ne.

Actually, xnintr_t is not visible from arch-level code.

In order to support nested calls of irq_enable/disable, we should take addi= tional control
in all places where irq_desc[irq]->handler->enable/disable() are used= (ok, hal interface
is out of the scope, but e.g. xnintr_enable() and xnintr_disable() must be = modified
appropriately not to use this hal interface).

Another thing is xnarch_irq_end() which re-enables the IRQ line upon exitti= ng from
interrupt handling code.

It must make check for DISABLED bit (ISR might have called xnintr_disable()= to defer
the IRQ line enabling).

For most part of the archs supported by Xeno, .ending (xnarch_irq_end()) is= only about
calling irq_desc[irq]->handler->enable()
(handler->end() is never used) so it's not a problem to make a small wra= pper
that re-enables the IRQ line only when XENO_IRQ_DISABLED bit is not set.
On ppc, irq_desc[irq]->handler->end() can be called indeed and we don= 't know
what's all about - at least, on the Xeno layer.

So either

handler->end() must check for XENO_IRQ_DISABLED - but this is an arch-le= vel code
in Linux (i.e. not the Xeno layer);

or Xeno/arch/ppc must represent an .end substitution for each sub-arch supp= orted.

 
> IOW, the patch, the way you discussed it recently, is ok for me too.
This said, I'm going to publish the shirq patch (after finalizing ISR retur= n bits,
where I still have some doubts) without enable/disable nesting support.
It can be supported at some point of time later, if it's really needed.
 

-= -

Philippe.



--
B= est regards,
Dmitry Adamushko ------=_Part_1745_26832109.1140898455168--