linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* IRQ Level / Edge
@ 2004-07-02 21:39 Sylvain Munaut
  2004-07-02 22:47 ` Andy Fleming
  0 siblings, 1 reply; 6+ messages in thread
From: Sylvain Munaut @ 2004-07-02 21:39 UTC (permalink / raw)
  To: Linux/PPC Development


Hello

I don't really understand what setting an IRQ as Level or Edge really
implies. (  I mean in irq_desc[i] )
And how to know what to put.

Can some one explain me or give me some pointers.


Sylvain Munaut


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: IRQ Level / Edge
  2004-07-02 21:39 IRQ Level / Edge Sylvain Munaut
@ 2004-07-02 22:47 ` Andy Fleming
  2004-07-03 16:42   ` Sven Luther
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Fleming @ 2004-07-02 22:47 UTC (permalink / raw)
  To: Sylvain Munaut; +Cc: Linux/PPC Development


Level sensitive Interrupts will continue to fire until the interrupt is
cleared.  Essentially, the hardware device causing the interrupt will
bring the interrupt line up (or down, depending on the polarity), and
keep it at that level until the condition disappears.  By setting the
IRQ controller to consider that interrupt level-sensitive, the
controller knows that the interrupt is still firing, and if you unmask
the interrupt while the signal is high, it will fire again.

Edge sensitive means that the interrupt only fires on a transition (low
to high for positive, high to low for negative).  Thus you don't have
to worry about clearing the interrupt before unmasking it.

I'm not sure if that's clear, but to summarize: Level and edge are
descriptions of how the interrupt is detected (by the "level" of the
interrupt, or by a transition *to* that level).  As for where to find
out which it is, the manual for the device should specify whether the
interrupt signal is level or edge sensitive.

On Jul 2, 2004, at 16:39, Sylvain Munaut wrote:

>
> Hello
>
> I don't really understand what setting an IRQ as Level or Edge really
> implies. (  I mean in irq_desc[i] )
> And how to know what to put.
>
> Can some one explain me or give me some pointers.
>
>
> Sylvain Munaut
>
>
>


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: IRQ Level / Edge
  2004-07-02 22:47 ` Andy Fleming
@ 2004-07-03 16:42   ` Sven Luther
  2004-07-04 17:31     ` Sylvain Munaut
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Luther @ 2004-07-03 16:42 UTC (permalink / raw)
  To: Andy Fleming; +Cc: Sylvain Munaut, Linux/PPC Development


On Fri, Jul 02, 2004 at 05:47:59PM -0500, Andy Fleming wrote:
>
> Level sensitive Interrupts will continue to fire until the interrupt is
> cleared.  Essentially, the hardware device causing the interrupt will
> bring the interrupt line up (or down, depending on the polarity), and
> keep it at that level until the condition disappears.  By setting the
> IRQ controller to consider that interrupt level-sensitive, the
> controller knows that the interrupt is still firing, and if you unmask
> the interrupt while the signal is high, it will fire again.
>
> Edge sensitive means that the interrupt only fires on a transition (low
> to high for positive, high to low for negative).  Thus you don't have
> to worry about clearing the interrupt before unmasking it.
>
> I'm not sure if that's clear, but to summarize: Level and edge are
> descriptions of how the interrupt is detected (by the "level" of the
> interrupt, or by a transition *to* that level).  As for where to find
> out which it is, the manual for the device should specify whether the
> interrupt signal is level or edge sensitive.

Err, i suppose the interesting bit is not how the board designer will
know wheter the interrupt is edge or level, but how the kernel running
on the board is able to detect it ?

Friendly,

Sven Luther

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: IRQ Level / Edge
  2004-07-03 16:42   ` Sven Luther
@ 2004-07-04 17:31     ` Sylvain Munaut
  2004-07-04 17:58       ` Gary Thomas
  2004-07-04 18:05       ` Sven Luther
  0 siblings, 2 replies; 6+ messages in thread
From: Sylvain Munaut @ 2004-07-04 17:31 UTC (permalink / raw)
  To: Sven Luther; +Cc: Andy Fleming, Linux/PPC Development


 >
 > Err, i suppose the interesting bit is not how the board designer
 > will know wheter the interrupt is edge or level, but how the kernel
 > running on the board is able to detect it ?
 >
 > Friendly,


Well, the kernel doesn't detect it. You have to tell him !
That's why I asked, because in the interrupt controller code, you have
to set it in the irq_desc[i] structure.

Sylvain


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: IRQ Level / Edge
  2004-07-04 17:31     ` Sylvain Munaut
@ 2004-07-04 17:58       ` Gary Thomas
  2004-07-04 18:05       ` Sven Luther
  1 sibling, 0 replies; 6+ messages in thread
From: Gary Thomas @ 2004-07-04 17:58 UTC (permalink / raw)
  To: Sylvain Munaut; +Cc: Sven Luther, Andy Fleming, Linux/PPC Development


On Sun, 2004-07-04 at 11:31, Sylvain Munaut wrote:
>  >
>  > Err, i suppose the interesting bit is not how the board designer
>  > will know wheter the interrupt is edge or level, but how the kernel
>  > running on the board is able to detect it ?
>  >
>  > Friendly,
>
>
> Well, the kernel doesn't detect it. You have to tell him !
> That's why I asked, because in the interrupt controller code, you have
> to set it in the irq_desc[i] structure.

Indeed, the kernel *can't* detect this (at least not easily).  You have
to know how the device (chip, etc) works.  If it generates edge
interrupts, then typically it will only generate a small pulse and the
interrupt controller has to be set up to recognize this.  For edge
interrupts, you normally only care about either a "falling" edge (the
transition from logic high to logic low) or "rising" edge (low to high).
It is then up to the device driver to tell the device to generate the
next interrupt as part of the interrupt service.  Most devices will not
generate another edge until the current one has been "cleared" or
"acknowledged."

If it is a level interrupt, then the device will assert its interrupt
signal until told to remove it (by the device driver).  In this case,
it is important for the interrupt controller to be aware that this
signal may persist (it's a level) and only tell the CPU about it
once.  In this case, the driver needs to tell the interrupt controller
when it has serviced the interrupt so that it will recognize when
the device re-asserts its interrupt signal.

n.b. this assumes that the interrupt controller is behaving like an
edge itself, i.e. it only interrupts the CPU once per state change.

--
Gary Thomas <gary@mlbassoc.com>
MLB Associates


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: IRQ Level / Edge
  2004-07-04 17:31     ` Sylvain Munaut
  2004-07-04 17:58       ` Gary Thomas
@ 2004-07-04 18:05       ` Sven Luther
  1 sibling, 0 replies; 6+ messages in thread
From: Sven Luther @ 2004-07-04 18:05 UTC (permalink / raw)
  To: Sylvain Munaut; +Cc: Sven Luther, Andy Fleming, Linux/PPC Development


On Sun, Jul 04, 2004 at 07:31:41PM +0200, Sylvain Munaut wrote:
>
> >
> > Err, i suppose the interesting bit is not how the board designer
> > will know wheter the interrupt is edge or level, but how the kernel
> > running on the board is able to detect it ?
> >
> > Friendly,
>
>
> Well, the kernel doesn't detect it. You have to tell him !
> That's why I asked, because in the interrupt controller code, you have
> to set it in the irq_desc[i] structure.

Mmm, i suppose the firmware would know about it, and it should be
possible to read it from there ?

Friendly,

Sven Luther

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-07-04 18:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-02 21:39 IRQ Level / Edge Sylvain Munaut
2004-07-02 22:47 ` Andy Fleming
2004-07-03 16:42   ` Sven Luther
2004-07-04 17:31     ` Sylvain Munaut
2004-07-04 17:58       ` Gary Thomas
2004-07-04 18:05       ` Sven Luther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).