Date: Tue, 14 Apr 2009 18:00:20 +0200 From: Fabian Keil <freebsd-listen@fabiankeil.de> To: Maksim Yevmenkin <emax@freebsd.org> Cc: freebsd-current@freebsd.org Subject: Re: svn commit: r190857 - head/sys/dev/kbdmux Message-ID: <20090414180020.34b97378@fabiankeil.de> In-Reply-To: <bb4a86c70904121000p60b48632q22a5b92fc791f4f8@mail.gmail.com> References: <200904082052.n38KqU9p075633@svn.freebsd.org> <20090412170335.5a8a3169@fabiankeil.de> <bb4a86c70904121000p60b48632q22a5b92fc791f4f8@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/pL.vY=1MxGzk3ySTJajbGIj Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Maksim Yevmenkin <emax@freebsd.org> wrote: > On Sun, Apr 12, 2009 at 8:03 AM, Fabian Keil > <freebsd-listen@fabiankeil.de> wrote: > > Maksim Yevmenkin <emax@FreeBSD.org> wrote: > > > >> Author: emax > >> Date: Wed Apr =A08 20:52:30 2009 > >> New Revision: 190857 > >> URL: http://svn.freebsd.org/changeset/base/190857 > >> > >> Log: > >> =A0 Undo SVN rev 183283 > >> > >> =A0 Do not use Giant for kbdmux(4) locking. This is wrong and apparent= ly > >> =A0 causing more problems than it solves. This will re-open the issue > >> =A0 where interrupt handlers may race with kbdmux(4) in polling mode. > >> =A0 Typical symptoms include (but not limited to) duplicated and/or > >> =A0 missing characters when low level console functions (such as gets) > >> =A0 are used while interrupts are enabled (for example geli password > >> =A0 prompt, mountroot prompt etc.) > >> > >> =A0 MFC after: =A03 days > >> > >> Modified: > >> =A0 head/sys/dev/kbdmux/kbdmux.c [...] > > Not even enabling the "visible characters" option helps > > because obviously backspace is broken too. >=20 > if you do not need kbdmix(4) you might just want to disable it on your > system. i think it should help with your particular problem. Removing kbdmux from the kernel does indeed work around the problem. > > Before theses locks were introduces I worked around the problem > > with this gets() hack (which forced me to reduce the key entropy): > > http://www.fabiankeil.de/sourcecode/freebsd/gets-no-duplicates.diff > > and now I will simply revert your commit locally, but I assume I'm > > not the only geli user who prefers to be able to boot the system > > without local patches. >=20 > if your primary keyboard is atkbd(4), you might want to try the > following patch. it is completely untested (i did not even compile > it), so be warned ... >=20 > Index: atkbd.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- atkbd.c (revision 190905) > +++ atkbd.c (working copy) > @@ -476,7 +476,7 @@ > static int > atkbd_intr(keyboard_t *kbd, void *arg) > { > - atkbd_state_t *state; > + atkbd_state_t *state =3D (atkbd_state_t *)kbd->kb_data; > int delay[2]; > int c; >=20 > @@ -485,7 +485,6 @@ > * The keyboard was not detected before; > * it must have been reconnected! > */ > - state =3D (atkbd_state_t *)kbd->kb_data; > init_keyboard(state->kbdc, &kbd->kb_type, > kbd->kb_config); > KBD_FOUND_DEVICE(kbd); > @@ -497,6 +496,9 @@ > } >=20 > if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) { > + if (state->ks_polling) > + return 0; > + > /* let the callback function to process the input */ > (*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT, > kbd->kb_callback.kc_arg); >=20 It compiles alright but once the system is running the keyboard no longer works at all. I tested the patch with kbdmux already disabled, but I assume it doesn't make a difference. Anyway, I don't need kbdmux, so having to remove it is no problem. Thanks a lot. Fabian --Sig_/pL.vY=1MxGzk3ySTJajbGIj Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAknksxoACgkQBYqIVf93VJ30rQCgxRiQdlHRmD/kzVSgNkua7Y8a 9OMAoIesdVWcFymsf+1L+wyHOXyBerhE =7Uvq -----END PGP SIGNATURE----- --Sig_/pL.vY=1MxGzk3ySTJajbGIj--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090414180020.34b97378>