Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

serial console versus wscons



Hi,

Whilst looking at something else, I came across a problem with wscons and a
serial console - we crash in sys/dev/sun/kbd.c:kbd_input_console() when we
call callout_reset(), because we never called callout_init(). To reproduce
this, boot up a serial console on a machine with a framebuffer, start then
stop X, and press a key on the real keyboard.

The crash happens because we call kbd_input() with k->k_wsenabled=0.  When
we called kbd_input() previously (and the other kbd routines) k->k_wsenabled
was 1, so we followed the wscons path.  Now, k->k_wsenabled has been set to
0 because stopping X closes wskbd in sys/dev/wscons/wskbd:wskbdclose() and
that calls wskbd_enable(foo, 0) and then wssunkbd_enable(foo, 0).

We don't get the crash when the framebuffer/keyboard is console because when
we call wskbd_enable() there, sc->sc_base.me_dispdv != NULL, so we return
instead of calling wssunkbd_enable().

A quick fix seems to never unset k->k_wsenabled once it has been set in the
attach routines.  However, I'm not 100% sure why we change that after attach
time.  (I haven't checked what the setting of sc->sc_base.me_dispdv means.)

Thanks,

J

PS.  I tried this with a cgsix, but the behaviour should be the same on all
framebuffers.  I also think port-sparc is affected too, as this is in the
common sun keyboard code.

-- 
  My other computer also runs NetBSD    /        Sailing at Newbiggin
        http://www.netbsd.org/        /   http://www.newbigginsailingclub.org/


Home | Main Index | Thread Index | Old Index