Subject: port-sparc64/11939: interrupts without handlers crash the kernel
To: None <>
From: Martin Husemann <>
List: netbsd-bugs
Date: 01/11/2001 14:54:14
>Number:         11939
>Category:       port-sparc64
>Synopsis:       interrupts without established handler cause kernel traps
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-sparc64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 11 14:54:00 PST 2001
>Originator:     Martin Husemann
>Release:        1.5Q as of Jan 8, 2001
System: NetBSD 1.5Q NetBSD 1.5Q (PORTER) #0: Fri Jan 5 15:25:38 MET 2001 i386
Architecture: i386
Machine: i386

When initializing some hardware that will cause interrupts before establishing
an interrupt handler for this cause kernel faults in setup_sparcintr/
interrupt_vector in locore.s.


In the typical autoconfig attach sequence:

 (probe some info and print it)
 (init card)
 (establish interrupt handler)

do something in the "init card" section, that will cause the card to interrupt.
At this point, the interrupt handler is not yet established.

Workaround is to move the interrupt establish call in the attach routine
in front of the card initialization. BUT: this does not keep random (bogus)
interrupts from happeneing and renders a lot of drivers working on all other
archs (where usually interrupts are globaly disabled at this stage) useless
on sparc64.

Proper fix would be to install a dummy handler for every interrupt or globaly
disable interrupts.