Subject: ibuf overflows
To: NetBSD port-arm32 <port-arm32@NetBSD.ORG>
From: Mark Brinicombe <amb@physig.ph.kcl.ac.uk>
List: port-arm32
Date: 01/03/1997 17:32:20
Hi,
  Ok the ibuf overflow problem has been fixed ;-)

I have commited the fix to the NetBSD source tree so people building 
there own kernels should now have a fixed kernel.
I will build a new release kernel shortly (need to port all the atapi 
patches again).

Tech bit:

The problem was a bug with the delivery of soft interrupts. The serial 
driver uses both hardware interrupts from the serial chip and software 
interrupts. The hardware ints xfer data from the chip into an input buffer
A soft interrupt occurs every 100th of a second and swaps the current 
input buffer for a second one. It then empties the last one in use into 
the tty layer.

The problem was that some soft interrupts were delivered during a 
hardware interrupt. The problem arose from the changes I made to the 
interrupt system to allow nesting of interrupts etc. softclock interrupt 
could get delivered after an hardware timer interrupt that interrupted a 
serial interrupt. The softclock interrupt handles timeouts and thus could
deliver the soft serial interrupt while the serial driver was in the hardware
interrupt routine.

Suddenly you have two parts of the serial driver playing with the input 
buffers at the same time ;-)

Anyway this problem is fixed by making sure that soft interrupts are only 
ever delivered when the last nested interrupt is finished. (2 lines of 
code to fix ;-)

Sorry for the time it took to fix this one. I really should have sat down 
and looked into it earlier.

Cheers,
				Mark

Mark Brinicombe				amb@physig.ph.kcl.ac.uk
Research Associate			http://www.ph.kcl.ac.uk/~amb/
Department of Physics			tel: 0171 873 2894
King's College London			fax: 0171 873 2716