Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Nov 1996 00:00:04 -0800 (PST)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs
Subject:   Re: kern/1976: psm and syscons conflicts have escalated
Message-ID:  <199611080800.AAA16943@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/1976; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.org, Tor.Egge@idt.ntnu.no
Cc:  Subject: Re: kern/1976: psm and syscons conflicts have escalated
Date: Fri, 8 Nov 1996 18:38:44 +1100

 >>Fix:
 >
 >	psm interrupt must block clock software interrupt to be able to block
 >	the keyboard polling.
 >
 >	This might mean that tty_imask must block the clock software 
 >	interrupt :-(
 
 It already does :-)  (all h/w interrupts and all splnnn()s block
 softclock()).
 
 psmintr() and psm_poll_status() and the keyboard <-> psm interface seem
 to be too simple to work.  psmintr() assumes that the interrupt is always
 for it and that exactly one scancode is delivered.  If the configuration
 in GENERIC is correct:
 
 1. psm_poll_status() steals keyboard scancodes.
 
 2. Now equality is restored - the syscons timeout routine steals psm
    scancodes :-).
 
 3. The different irq for psm is the only thing that separates psm
    scancodes from keyboard scancodes.  Polling cannot work.
    psm_poll_status() tests the magic bits 0x03.  0x01 is KB_BUF_FULL and
    0x02 is KB_READY.  Actually, psm_poll_status() is not so magic, just
    badly written and probably broken.  0x02 is also PSM_OUTPUT_ACK.
    psm_poll_status() bogusly reads the input to ack output and loops
    forever unless the (ack) input happens to be ready then or interrupts
    are bogusly enabled so that an interrupt can clear the input.
 
 4. psm_poll_status() is sometimes (e.g. in psmopen()) used without
    blocking tty interrupt.  This bug makes the bugs in 1) and 3) less
    serious.
 
 Summary: equality isn't quite restored.  psm_poll_status() is actually a
 broken version of kbd_wait(), and it is only used to issue commands, not
 to poll for input, so it only hangs the system sometimes :-].  However,
 syscons now polls for input, and this cannot work.
 
 Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611080800.AAA16943>