diff options
author | sobomax <sobomax@FreeBSD.org> | 2005-04-07 17:15:10 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2005-04-07 17:15:10 +0000 |
commit | 80da76bc5041a75d882110b83cf10ca98ce646b8 (patch) | |
tree | 6ab8593c5a0d3cae64cafc06661c5ec6686cdb07 /sys/dev/atkbdc | |
parent | ebb3a9b55bc4865ab615fc039c3b9bd3ff2ef685 (diff) | |
download | FreeBSD-src-80da76bc5041a75d882110b83cf10ca98ce646b8.zip FreeBSD-src-80da76bc5041a75d882110b83cf10ca98ce646b8.tar.gz |
Provide a new tunable hw.atkbdc.broken_kit_cmd, which if set to 1
instructs the driver to avoid using Keyboard Interface Test command.
This command causes problems with some non-compliant hardware, resulting
in machine being abruptly powered down early in the boot process.
Particularly it's known that HP ZV5000 and Compaq R3000Z notebooks
are affected by this problem.
Due to popularity of those models this patch is good MFC5.4 candidate.
PR: 67745
Submitted by: Jung-uk Kim jkim at niksun.com
MFC after: 1 days
Diffstat (limited to 'sys/dev/atkbdc')
-rw-r--r-- | sys/dev/atkbdc/atkbdc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/atkbdc/atkbdc.c b/sys/dev/atkbdc/atkbdc.c index 7fc2325..0e1fdea 100644 --- a/sys/dev/atkbdc/atkbdc.c +++ b/sys/dev/atkbdc/atkbdc.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> +#include <sys/kernel.h> #include <sys/malloc.h> #include <sys/syslog.h> #include <machine/bus_pio.h> @@ -941,6 +942,17 @@ test_controller(KBDC p) return (c == KBD_DIAG_DONE); } +/* + * Provide a way to disable using Keyboard Interface Test command, which may + * cause problems with some non-compliant hardware, resulting in machine + * being powered down early in the boot process. + * + * Particularly it's known that HP ZV5000 and Compaq R3000Z notebooks are + * affected. + */ +static int broken_kit_cmd = 0; +TUNABLE_INT("hw.atkbdc.broken_kit_cmd", &broken_kit_cmd); + int test_kbd_port(KBDC p) { @@ -948,6 +960,9 @@ test_kbd_port(KBDC p) int again = KBD_MAXWAIT; int c = -1; + if (broken_kit_cmd != 0) + return 0; + while (retry-- > 0) { empty_both_buffers(p, 10); if (write_controller_command(p, KBDC_TEST_KBD_PORT)) |