Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Theo de Raadt <deraadt <at> cvs.openbsd.org>
Subject: keyboard and mouse problems
Newsgroups: gmane.os.openbsd.tech
Date: Wednesday 11th March 2015 15:11:38 UTC (over 2 years ago)
Two related problems regarding mice and keyboards came to my attention
during s2k15 in Brisbane and I worked with [email protected] 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.

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 
 #include 
+#include 
 
 #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 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -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);
 	}
 }
 
CD: 3ms