linux-mips
[Top] [All Lists]

Re: clearing interrupt outside handler..?

To: "ashish anand" <ashish_ibm@rediffmail.com>
Subject: Re: clearing interrupt outside handler..?
From: Goswin von Brederlow <brederlo@informatik.uni-tuebingen.de>
Date: 28 Mar 2004 07:46:30 +0200
Cc: linux-mips@linux-mips.org
In-reply-to: <20040326130600.4179.qmail@webmail7.rediffmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20040326130600.4179.qmail@webmail7.rediffmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Reasonable Discussion)
"ashish  anand" <ashish_ibm@rediffmail.com> writes:

> Hello,
> 
> I am restarting a thread discussed november last year regarding
> spurious interrupts generation due to edge triggering .
> pls. refer ,
> http://www.linux-mips.org/archives/linux-mips/2003-11/msg00071.html
> 
> somehow this problem is again surfaced.
> I am interfacing a peripheral to mips CP0 interrupt controller
> through GPIO which converts edge to level .
> now my question is that ,
> 
> is it always safe to clear the interrupt status outside the interrupt handler 
> in a driver under some particular path flow ?
> I think it is not as it may land-up in a situation where by the time
> GPIO detects the edge due to requirement of certain  minimum pulse width 
> duration , it is already cleared and thus a spurious interrupt generation 
> will happen.
> 
> I might be wrong .I am looking for comments on above mentioned situation.
> 
> Best Regards,
> Ashish

I might be wrong, I'm just starting learing about the details of mips,
but its my understanding that the interrupt would reassert itself
imediatly when you leave the interrupt vector without clearing it
first.

That said, when you are outside the interrupt handler the interrupt
bit should always be unset. The only thing I can imagine hapening is
the interrupt getting triggered while the clear instruction is
running. You might or might not have a race condition there then.

But why would you ever want to clear an interrupt outside the handler,
it normaly cannot be set. Spurious interrupts shouldn't be caused by
this I think. If at all you would miss some interrupt completly.


Or am I totally off there?

MfG
        Goswin

<Prev in Thread] Current Thread [Next in Thread>