Subject: port-powerpc/35705: interrupt handler ext_intr for edge triggered IRQs, only?
To: None <port-powerpc-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <gfussan@web.de>
List: netbsd-bugs
Date: 02/19/2007 12:25:00
>Number:         35705
>Category:       port-powerpc
>Synopsis:       interrupt handler ext_intr for edge triggered IRQs, only?
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    port-powerpc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 19 12:25:00 +0000 2007
>Originator:     Gernot Fussan
>Release:        NetBSD-3.0
>Organization:
>Environment:
evbppc, powerpc
>Description:
For the PowerPC-arch the machine-depending main interrupt handler ("ext_intr()") doesn't work correctly for level-triggered interrupts, as re-enabling interrupting before calling the interrupt-specific routine causes a re-jump into the ext_intr() with marking the second jump as a "pending" interrupt. So, every interrupt handler is called twice per hard-interrupt, always!

Why was it implemented like that?
Can anybody help here?

Thank you!

Bye,
Gernot

>How-To-Repeat:
Run a kernel profiling and compare number of calls of your hardware interrupt rountine and the (expected) amount of hardware interrupts really received during the profiling time.

>Fix:
Level-triggered interrupts will always interrupt when set and enabled.
Todo: Disable the currently processed (level-triggered) interrupt BEFORE re-enable all interrupts (with mtmsr(msr|PSL_EE)) and during the processing of this interrupt, and re-enable this interrupt again right AFTER its processing, after it's been unset.