Re: Shared edge triggered interrupts

Peter T. Breuer (ptb@it.uc3m.es)
Sat, 8 Aug 1998 19:36:02 +0200 (MET DST)


"A month of sundays ago Meelis Roos wrote:"
>
> PTB> Seems a flawed argument to me.
>
> PTB> I don't know how _PC_ interrupts handle themselves, but in an industry
> PTB> generic context I would have expected that we now have to return and tell
> PTB> X that we handled its interrupt and would it now please stop shouting
> PTB> and lower its line (it may have already done so - I don't know if it
> PTB> expects an ack).
>
> PTB> We then should look again to see if the interrupt is still asserted, and
> PTB> if it is, poll to find out why. I assume the interrupt was latched
> PTB> but level triggered, so that resetting the latch while Y is still
> PTB> asserting a high will leave the latch set and we'll see it.
>
> To me it seems that you are describing level-triggered interrupts.

Yes, indeed. I now look at the subject and see from that that maybe
linus was talking about edge-triggered (I can't see the subject line
when replying to mail) though I got the impression that he was talking
about level triggered from the message body. I don't know why ... I'll
go back and try and find the message (we just had a 24hr power cut here
so my mail is stacked high somewhere out there).

Edge triggered interrupts obviously suffer from the defect that if the
interrupt latch is set, then in that state it physically can't see a new
edge that comes in, so the kernel has no chance to see it either. The
kernels only chance is to work reeeal fast to service the previous
interrupt and reset the latch back to a seeing state again.

Level triggered interrupts also suffer from a physical limitation
however: they can't tell you if TWO events on the same interface
happened before the kernel reset the latch. Only that for sure at least
one event happened. That would be fixed by having a counter instead of a
simple latch. Dunno why not.

When it comes to shared interrupts, I really would need to know if there
is a latch on the peripheral's side of the interface, as well as on the
motherboard side, before saying anything ,.. it sounds to me as though
there is. In that case, yes level-triggered interrupts are safe to
share in that they guarrantee to notify you if at least one event has
happened on any device. Without the latch on the peripheral's side,
that is not so. Double events in which the second does not persist
beyond the ack from the kernel may not be perceived as two. In other
words, "it depends".

> These are reliably shareable AFAIK. The problem is with sharing
> edge-triggered interrupts.

Indeed. Apologies for somehow misreading. This post is to make sure
the right info gets in the archives.

> --
> Meelis Roos (mroos@tartu.cyber.ee)
>

Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html