tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: gpio interrupts



On Fri, Apr 08, 2016 at 11:29:06AM +0000, Michael van Elst wrote:
> bouyer%antioche.eu.org@localhost (Manuel Bouyer) writes:
> 
> >I'm not sure I understand what you mean. If I unmask interrupt, of
> >course an interrupt can happen when the callback return (as interrupt
> >is unmasked).
> 
> mask_interrupt();
> - can an interrupt still occur here, maybe the write was asynchronous ? */

no

> - can another CPU still run a handler for a previous interrupt ?

no

> 
> unmask_interrupt(); - does a pending interrupt call the handler here? */
> - or only after the function returned ?

immediately after the hardware has been changed. This is how the hardware
works - unless the interrupt is still masked at a higher level (e.g. spl).

> - on which CPU ?

The one which is getting interrupts (it depends on how interrupts are routed)

> 
> If we still need memory barriers, xcalls and mutexes to make this a
> safe operation, then it probably doesn't need to be extra fast.

It only needs a mutex, which is already in my backend implementation.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index