Subject: Re: kern/8702: Keyboard frozen after RB_ASKNAME
To: None <tech-kern@netbsd.org>
From: Jaromír <jdolecek@netbsd.org>
List: tech-kern
Date: 05/17/2001 10:32:51
Hi,
I've encountered this problem of one of my machines. I've succeeded
in tracking it down. The issue (at least on my box) is, that
some controllers, if a key is pressed, seem to present the interrupt
until it's read from the device register. For console polling, the interrupt
handling code doesn't read anything and simply immediatelly returns. However,
since the interrupt condition is not cleared, system is immediatelly
presented with another interrupt and system loops calling kbd
intr routine.

This is not a problem during system boot, when the interrupts are
disabled. This starts to be a problem once the interrupts are enabled.
Note that the mountroothooks and askname stuff is called with
interrupts already enabled, so once any routine calls cnpollc(1)
and a key is pressed, system starts looping (observed for floppy
mountroothook in my case).

One possible solution to this problem is to disable tty interrupts
for FOOcnpollc(1) and enable them in FOOcnpollc(0). This works for
pccons (older version), in the pccnpollc() routine:

	if (!cold) {
		static int s;

		if (on)
			s = spltty();
		else
			splx(s);
	}

Similar thing could be done for dev/ic/pckbc.c:pckbc_set_poll().

Is this right solution? Is there any better solution?

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
NetBSD - just plain best OS! -=*=- Got spare MCA cards or docs? Hand me them!