Disabling interrupts and masking interrupts

Dave Hylands dhylands at gmail.com
Thu Mar 7 12:28:58 EST 2013


Hi,

On Thu, Mar 7, 2013 at 8:53 AM, <Valdis.Kletnieks at vt.edu> wrote:

> On Thu, 07 Mar 2013 17:17:19 +0200, Kevin Wilson said:
>
> > Does this mean that once you are disabling
> > interrupts, these interrupts are lost ?  even later, when we will
> > enable interrupts, the interrupts from the past that should have been
> > created (but interrupts were disabled at that time interval) are in
> > fact lost?
>
> Level-triggered interruots will go off once interrupts are re-enabled,
> assuming that the device has kept the level set and not given up and timed
> out.
>
> Edge-trittered interrupts are gone.  That's part of why most hardware
> doesn't use edge triggers - it's just too hard to guarantee proper device
> driver operation.
>

In my experience, edges triggered interrupts are always latched by the HW
when they arrive. If another edge comes along between the initial edge and
the time that the interrupt is cleared, then this second edge is lost. The
fact that an interrupt is pending will still be retained though, and as
soon as interrupts are enabled, then the interrupt handler will fire.

So, it's quite often the case that you want to clear ("knock down") the
interrupt as soon as possible inside your drive to help reduce the window
where back-to-back edges will miss the second edge.

You'll never miss the first edge.


> Also, in common usage, "disabled interrupts" means that you're not
> listening
> to *any* interrupts, while "masked" means "we're not listening to *this*
> interrupt source, even if we *are* accepting interrupts from other
> sources".
>

Normally disabling interrupts is just another form of masking, it just
happens to mask all of the interrupts rather than one particular one. Even
when you disable interrupts, you typically still have access to the
unmasked interrupt state.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130307/374e3b8d/attachment.html 


More information about the Kernelnewbies mailing list