Subject: Cleaning up isa_intr_establish - comments please
To: None <tech-kern@netbsd.org>
From: None <jchacon@genuity.net>
List: tech-kern
Date: 12/20/2000 16:32:01
Currently isa_intr_establish (and derivatives of it like intr_establish on
prep) panic on certain conditions such as overlapping interrupt handlers for
non-shareable cases.

Since ISA is so difficult in some cases to probe for an interrupt without 
apriori knowledge of the machine setup this means that some default cases in 
GENERIC will cause panics. (specifically read the port-i386 threads on wss 
panics I was seeing).

Looking over the code base there's a logical fix for most of this. The
intr_establish routines return a pointer to the handler. In cases where these
can't be done (like trying to register an edge and level on the same irq)
I think changing the establish routines to print and error and return NULL
rather than panic'ing makes more sense. It already appears a handfull of
drivers even assume this and check for it. (which is then broken as well 
today).

So, what I'm proposing to do is:

1. Change all isa related interrupt establish routines to return NULL on
   configuration error cases (like dual assigned irq's) rather than panic'ing.
2. Start going through drivers that call the establish routines and fix them
   to check the return value and not attach if they can't establish.

The only hole of course is that attach routines have no return value. However,
if they don't finish attaching or sub config'ing children and notification
to the user via printf() occurs there's not much more to worry about here.

Comments?

James