Subject: what blocks splserial?
To: None <tech-kern@netbsd.org>
From: Daniel Brewer <danielb@cat.co.za>
List: tech-kern
Date: 08/18/2003 16:47:03
Hi

We have a serial piggy-back add-on card to one of our PCI card and we're
seeing some oddities with the interrupts.

The serial add-on causes the PCI card to generate interrupts as necessary.
In the attach function for the pci card, we use bus_space_subregion and
config_found_sm to attach the 4 extra serial com devices. There is a
transparent channel through the PCI card to the serial add-on, so the
registers on the serial device are mapped directly into the register memory
space on the PCI card. We've written a test program that writes and reads
data to all 4 serial ports on the add-on card (mapped to tty02-tty05).

Everything works great under normal operation. But, we've noticed that
running the test program and a compile at the same time, can sometimes cause
the loss of a few characters. Digging deeper, we've measured the time
between when the card raises the interrupt line and when the driver accesses
the registers on the serial card to handle the interrupt is sometimes really
long when compiling and reading/writing to the com ports (up to about
7ms!!!). At 115200 baud, that's quite a few characters.

The com devices are using the IPL_SERIAL level interrupts and access the
serial-port registers. The PCI device's driver is responding to IPL_TTY
level interrupts, and it is the device that will actually clear the
interrupt pin on the PCI device's controller chip. So, what could block the
IPL_SERIAL level interrupts for several milliseconds while a compile is
occurring?

Thanks
-Daniel