From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: wael showair <showair2003@yahoo.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: Missing some interrupts
Date: Tue, 09 Jun 2009 08:13:00 +1000 [thread overview]
Message-ID: <1244499180.8971.7.camel@pasglop> (raw)
In-Reply-To: <23927820.post@talk.nabble.com>
On Mon, 2009-06-08 at 09:45 -0700, wael showair wrote:
>
> wael showair wrote:
> >
> >> > You cannot really rely on getting the exact same number of edge
> >> > interrupts that were emitted. At least not unless you have a hard RT
> >> > system and can guarantee that you'll always dequeue them fast enough.
> >>
> >> Yes, my system is a hard RT & i want to receive all the interrupts that
> >> have been generated exactly
> >
> > No. Linux is not hard RT. You cannot rely on this in a reliable way,
> > if for any reason the kernel masks interrupt for too long, which can
> > happen, you'll see that sort of coalescing happening.
>
> what about using the RT-Preempt Patch? i can see that it will convert Linux
> ti an RTOS.
Not only I don't think it's going to guarantee RT response (just improve
it), that's a pretty big hammer to work around what is a design bug in
your system in the first place :-)
> i have check the function of do_IRQ: there is no ack called b 4 calling the
> handler but actually it does the following:
You haven't read properly :-)
> 1. it gets the irq number using :
> irq = ppc_md.get_irq();
>
> 2. then it calls the handler :
> if (irq != NO_IRQ && irq != NO_IRQ_IGNORE) {
> generic_handle_irq(irq);
> } else if (irq != NO_IRQ_IGNORE)
> /* That's not SMP safe ... but who cares ? */
> ppc_spurious_interrupts++;
>
> i have checked the function of generic_handle_irq where it is defined
> linux/irq.h & it calls the handler
No. It call the -flow- handler, which is a different thing (yes, the
terminology can be a bit confusing). The flow handler is configured
by the interrupt controller itself and will do whatever necessary
ack'ing, masking, EOI'ing etc... for a given PIC around the call to the
actual driver handler.
> so from the previous code the processor or the pic does not ack but they
> call my ISR handler.
They do. You missed it.
> i have also read the specs of my OpenPIC & found that:
>
> "the interrupt handler executing on the processor should then acknowledge
> the interrupt by explicitly reading the IACK register.
Reading the IACK is what get_irq() does on OpenPIC.
> The PIC unit
> interprets this read as an interrupt acknowledge (IACK) cycle; in response,
> the PIC unit returns the vector associated with the
> interrupt source to the interrupt handler routine."
>
> "At the end of the interrupt the End Of Interrupt (EOI) register must be
> set"
Which is done by the flow handler.
> So the processor neither reads this iack register nor the handler set the
> EOI register.
You obviously missed both :-)
Ben.
prev parent reply other threads:[~2009-06-08 22:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-06 13:17 Missing some interrupts wael showair
2009-06-06 13:34 ` Jon Smirl
2009-06-06 17:27 ` Grant Likely
2009-06-06 22:47 ` Benjamin Herrenschmidt
2009-06-07 0:05 ` wael showair
2009-06-07 0:26 ` wael showair
2009-06-08 16:45 ` wael showair
2009-06-08 22:13 ` Benjamin Herrenschmidt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1244499180.8971.7.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=showair2003@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.