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:54:31AM +0200, Michael van Elst wrote:
> [...]
> > > Yes, that's possible, and mostly asks for another flag bit to distinguish
> > > both cases.
> > 
> > masking/unmasking is something that needs to be really fast, and is
> > different in nature from other configuration options (this is not a
> > configuration operation).
> 
> For many GPIOs that's just writing a mask register instead of writing a
> configuration register. Sometimes is even the same register controlling
> a single mode as in off/level/edge.

actually masking is different from turning off.
When an interrupt is masked, the hardware still monitors if an interrupt
occurs, and delays the delivery until it's unmasked.
When you turn it off, you stop monitoring the pin (and eventually the
related hardware part is powered down). You get no indication about what
happens while it's off.

> 
> 
> > I still think a separate callback
> > is better.
> 
> Maybe it cuts a few nanoseconds, but I fear it will just support
> the assumption that masking works in a specific way.

It *is* different from configuration. e.g. you may have to ack before
unmask (my current implementation doesn't do this, and it's a bug).

> If you make
> a new callback then it should also give a new quality. E.g.
> acting as a barrier to ensure that no interrupts occur when the
> callback returns.

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).

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


Home | Main Index | Thread Index | Old Index