Subject: interrupt routing issue with ioapic ?
To: None <>
From: Jeff Rizzo <>
List: tech-kern
Date: 01/20/2005 13:08:51
I'm working on porting drivers for some of the "Wildcard" 
zaptel-interface hardware for use with asterisk, and I finally got some 
stuff working with the driver built into the kernel last night after 
squashing some stupid bugs.  Working on it some more this morning, I 
discovered that if I loaded the driver as an LKM, I wasn't getting any 
interrupts.  After some investigation, I realized that for whatever 
reason, the "builtin" kernel was uniprocessor, with no ioapic, while the 
kernel I was loading the LKM into was MP, using MPBIOS and ioapic.  Sure 
enough, when I loaded a recompiled LKM into a UP kernel with no ioapic, 
things work as expected.    Even more interestingly, when I compile the 
driver into an MP kernel, it locks up after a brief period, though the 
driver does seem to get a few interrupts before this happens.

My development system is NetBSD/i386 -current as of a couple days ago.  
My MP kernel config is pretty close to GENERIC;  I only have KGDB and 
options INSECURE in the GENERIC config, and the MP part is thus:

include "arch/i386/conf/GENERIC.KGDB"

options         MULTIPROCESSOR
options         COM_MPLOCK      # com MP locking; REQUIRED on MP i386

options         APM_NO_IDLE
#options        LOCKDEBUG
#options        MPDEBUG
#options        MPVERBOSE
options DEBUG
makeoptions     DEBUG="-g"
options         MPBIOS          # configure CPUs and APICs using MPBIOS
#options        MPACPI          # configure CPUs and APICs using ACPI
                                # (acpi at mainbus must also be enabled)

ioapic*         at mainbus? apid ?
wcfxs*  at      pci?
zaptel* at      zaptelbus?

The "wcfxs*" and "zaptel*" lines are commented out for LKM use.

Does anything here look like I've done something glaringly wrong?  Any 
suggestions for other things to check or to try?