summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2011-05-20 22:36:17 +0000
committerdelphij <delphij@FreeBSD.org>2011-05-20 22:36:17 +0000
commitb1c7404a29cca0fe879d99c3022eef64cb1a8017 (patch)
tree47bf37de0fac2dc4334f390e3560b01b3292888b
parenta1bf1a258207345435ea10acd5842a3edd836a66 (diff)
downloadFreeBSD-src-b1c7404a29cca0fe879d99c3022eef64cb1a8017.zip
FreeBSD-src-b1c7404a29cca0fe879d99c3022eef64cb1a8017.tar.gz
Add a new knob to atkbd(4) to enable typematic rate detection on boot,
which is now disabled by default. The detection is known to cause hangs on boot with some new Lenovo laptops on FreeBSD/amd64. Reported by: gnn Discussed with: jkim MFC after: 3 months
-rw-r--r--share/man/man4/atkbd.47
-rw-r--r--sys/dev/atkbdc/atkbd.c3
-rw-r--r--sys/dev/atkbdc/atkbdreg.h1
3 files changed, 10 insertions, 1 deletions
diff --git a/share/man/man4/atkbd.4 b/share/man/man4/atkbd.4
index 73831c2..0c486e2 100644
--- a/share/man/man4/atkbd.4
+++ b/share/man/man4/atkbd.4
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 29, 2008
+.Dd May 20, 2011
.Dt ATKBD 4
.Os
.Sh NAME
@@ -176,6 +176,11 @@ When this option is given, the
.Nm
driver will not test the keyboard port during the probe routine.
Some machines hang during boot when this test is performed.
+.It bit 4 (PROBE_TYPEMATIC)
+When this option is given, the
+.Nm
+driver will try to probe the keyboard typematic rate on boot.
+Some machines hang during boot when this test is performed.
.El
.\".Sh FILES
.Sh EXAMPLES
diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c
index 600020f..643554d 100644
--- a/sys/dev/atkbdc/atkbd.c
+++ b/sys/dev/atkbdc/atkbd.c
@@ -1097,6 +1097,9 @@ get_typematic(keyboard_t *kbd)
x86regs_t regs;
uint8_t *p;
+ if (!(kbd->kb_config & KB_CONF_PROBE_TYPEMATIC))
+ return (ENODEV);
+
if (x86bios_get_intr(0x15) == 0 || x86bios_get_intr(0x16) == 0)
return (ENODEV);
diff --git a/sys/dev/atkbdc/atkbdreg.h b/sys/dev/atkbdc/atkbdreg.h
index cf7ee6b..3d54b4d 100644
--- a/sys/dev/atkbdc/atkbdreg.h
+++ b/sys/dev/atkbdc/atkbdreg.h
@@ -36,6 +36,7 @@
#define KB_CONF_NO_RESET (1 << 1) /* don't reset the keyboard */
#define KB_CONF_ALT_SCANCODESET (1 << 2) /* assume the XT type keyboard */
#define KB_CONF_NO_PROBE_TEST (1 << 3) /* don't test keyboard during probe */
+#define KB_CONF_PROBE_TYPEMATIC (1 << 4) /* probe keyboard typematic */
#ifdef _KERNEL
OpenPOWER on IntegriCloud