On 03/11/15 16:11, Theo de Raadt wrote:
Two related problems regarding mice and keyboards came to my attention
during s2k15 in Brisbane and I worked with jcs@ on solutions.

The first problem is some newer machines (such as the thinkpad x1)
have keyboard repeat or stuttering during install -- this issue only
happes on the RAMDISK kernel.  Eventually we figured out that this is
due to the large touchpad!  Even a light brush against it would mess
up the pckbc driver subtly, causing 10 second pauses.  This happens
because the RAMDISK media lacks the pms driver.

The solution is to forcibly reset the mouse port at attach.  We
  initially thought this change would only be needed for RAMDISK, but
it looks like this sequence was always missing in the past, and we
need it.

I also noticed the keyboard stutters on my Thinkpad Edge E130, but didn't make the connection to the touchpad. Great detective work! The stutters are gone after upgrading to the snapshot from 14-Mar-2015 and I don't notice any other issues with the keyboard.

Thank you!
Frederic



The second related issue is that boot -c on some machines has never
worked.  The keyboard would be unresponsive.  It turns out this is
also related to mouse ports which have not been reset.

These changes did not make the cut for 5.7, because there are a
plethora of keyboard contoller models, on PCs and non-PCs.  We need
lots of testing before it goes in.

Index: dev/ic/pckbc.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/pckbc.c,v
retrieving revision 1.43
diff -u -r1.43 pckbc.c
--- dev/ic/pckbc.c      19 Dec 2014 07:23:57 -0000      1.43
+++ dev/ic/pckbc.c      11 Feb 2015 03:52:01 -0000
@@ -41,6 +41,7 @@

  #include <dev/ic/i8042reg.h>
  #include <dev/ic/pckbcvar.h>
+#include <dev/pckbc/pmsreg.h>

  #include "pckbd.h"

@@ -277,6 +278,12 @@
                if (t->t_slotdata[slot] == NULL)
                        return 0;
                pckbc_init_slotdata(t->t_slotdata[slot]);
+       } else if (!found && slot == PCKBC_AUX_SLOT) {
+               u_char cmd[1] = { PMS_RESET };
+
+               (void) pckbc_poll_cmd(t, PCKBC_AUX_SLOT, cmd, sizeof cmd,
+                   0, NULL, 1);
+               pckbc_slot_enable(t, PCKBC_AUX_SLOT, 0);
        }
        return (found);
  }




Index: pckbd.c
===================================================================
RCS file: /cvs/src/sys/dev/pckbc/pckbd.c,v
retrieving revision 1.38
diff -u -p -u -r1.38 pckbd.c
--- pckbd.c     24 Jul 2014 22:38:19 -0000      1.38
+++ pckbd.c     11 Feb 2015 04:57:35 -0000
@@ -79,6 +79,7 @@
  #include <dev/ic/pckbcvar.h>
  #include <dev/pckbc/pckbdreg.h>
  #include <dev/pckbc/pckbdvar.h>
+#include <dev/pckbc/pmsreg.h>

  #include <dev/wscons/wsconsio.h>
  #include <dev/wscons/wskbdvar.h>
@@ -1033,6 +1034,8 @@ pckbd_cnpollc(void *v, int on)
                /* Just to be sure. */
                cmd[0] = KBC_ENABLE;
                pckbc_poll_cmd(t->t_kbctag, PCKBC_KBD_SLOT, cmd, 1, 0, NULL, 0);
+               cmd[0] = PMS_RESET;
+               pckbc_poll_cmd(t->t_kbctag, PCKBC_AUX_SLOT, cmd, 1, 0, NULL, 0);
        }
  }



Reply via email to