Subject: pckbc(4) not working with 3.0 GENERIC.MPACPI kernel....
To: NetBSD/i386 Discussion List <port-i386@NetBSD.org>
From: Greg A. Woods <woods@planix.com>
List: port-i386
Date: 05/17/2006 20:44:17
--pgp-sign-Multipart_Wed_May_17_20:44:15_2006-1
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

So, I've got this big little noisy IBM xSeries 336 server sitting here
in my basement that I've been preparing for a client with NetBSD-3.0 on
it.

After several hours of debugging the serial and keyboard/vga consoles
I've finally determined that the GENERIC.MPACPI kernel is somehow
killing the pckbc(4) controller or driver.

A normal boot of a default GENERIC kernel proceeds A-OK and wscons
starts up and all is well.

    wsdisplay0 at vga1 kbdmux 1
    wsmux1: connecting to wsdisplay0
 . . .
    com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
    com0: console
    pckbc0 at isa0 port 0x60-0x64
    pckbd0 at pckbc0 (kbd slot)
    pckbc0: using irq 1 for kbd slot
    wskbd0 at pckbd0 mux 1
    wskbd0: connecting to wsdisplay0

However when I boot the GENERIC.MPACPI kernel the following apparently
infamous "kbc" error ensues (however in my case it seems specific to
ACPI support) and the keyboard appears hung and wscons is useless:

    pckbc0 at acpi0 (PNP0303): kbd port
    pckbc0: io 0x64,0x60 irq 1
    pckbc1 at acpi0 (PNP0F13): aux port
    pckbc1: irq 12
    PNP0C02 [Plug and Play motherboard register resources] at acpi0 not con=
figured
    kbc: cmd word write error
 . . .
    wsdisplay0 at vga0 kbdmux 1
    wsmux1: connecting to wsdisplay0

(note there are no pkcbd* or wskbd* lines)

(now why the heck does the pckbc(4) driver use "kbc" for its error
messages, and why the heck are there several _identical_ error messages
hidden in the same driver!?!?!?!?!?!?!?!?  no fun!!!!  see fix below.)

Is that PNP0C02 warning perhaps related in some way, or is it something
else in the ACPI glue?  (I haven't tried the GENERIC.MP kernel recently
but I presume it still works as well as GENERIC in this respect.)


How the heck to I try to fix this?  I reallly need kbd/vga/wscons
support on this machine, and as far as I can tell I also need to run the
MPACPI kernel, if only so that we can power these machines down remotely
when necessary.

--=20
						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>       Secrets of the Weird <woods@weird.com>


Index: sys/dev/ic/pckbc.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
RCS file: /cvs/master/m-NetBSD/main/src/sys/dev/ic/pckbc.c,v
retrieving revision 1.34
diff -u -c -u -r1.34 sys/dev/ic/pckbc.c
cvs diff: conflicting specifications of output style
cvs diff: conflicting specifications of output style
--- sys/dev/ic/pckbc.c	27 Feb 2005 00:27:02 -0000	1.34
+++ sys/dev/ic/pckbc.c	17 May 2006 23:31:37 -0000
@@ -326,7 +326,7 @@
=20
 	/* set initial cmd byte */
 	if (!pckbc_put8042cmd(t)) {
-		printf("kbc: cmd word write error\n");
+		printf("pckbc: initial cmd word write error\n");
 		return;
 	}
=20
@@ -349,12 +349,12 @@
 	if (res =3D=3D 0 || res =3D=3D 0xfa || res =3D=3D 0x01 || res =3D=3D 0xab=
) {
 #ifdef PCKBCDEBUG
 		if (res !=3D 0)
-			printf("kbc: returned %x on kbd slot test\n", res);
+			printf("pckbc: returned %x on kbd slot test\n", res);
 #endif
 		if (pckbc_attach_slot(sc, PCKBC_KBD_SLOT))
 			cmdbits |=3D KC8_KENABLE;
 	} else {
-		printf("kbc: kbd port test: %x\n", res);
+		printf("pckbc: kbd port test failed: %x\n", res);
 		return;
 	}
 #else
@@ -368,11 +368,11 @@
 	 *  (eg UMC880?).
 	 */
 	if (!pckbc_send_cmd(iot, ioh_c, KBC_AUXECHO)) {
-		printf("kbc: aux echo error 1\n");
+		printf("pckbc: aux echo error 1, mouse on aux port disabled\n");
 		goto nomouse;
 	}
 	if (!pckbc_wait_output(iot, ioh_c)) {
-		printf("kbc: aux echo error 2\n");
+		printf("pckbc: aux echo error 2, mouse on aux port disabled\n");
 		goto nomouse;
 	}
 	t->t_haveaux =3D 1;
@@ -390,7 +390,7 @@
 			cmdbits |=3D KC8_MENABLE;
 	} else {
 #ifdef PCKBCDEBUG
-		printf("kbc: aux echo test failed\n");
+		printf("pckbc: aux echo test failed, aux port disabled\n");
 #endif
 		t->t_haveaux =3D 0;
 	}
@@ -399,7 +399,7 @@
 	/* enable needed interrupts */
 	t->t_cmdbyte |=3D cmdbits;
 	if (!pckbc_put8042cmd(t))
-		printf("kbc: cmd word write error\n");
+		printf("pckbc: cmd word write error enabling interrupts\n");
 }
=20
 static void
@@ -679,14 +679,14 @@
 	 * all until we request a self-test.
 	 */
 	if (!pckbc_send_cmd(iot, ioh_c, KBC_SELFTEST)) {
-		printf("kbc: unable to request selftest\n");
+		printf("pckbc: unable to request selftest\n");
 		res =3D EIO;
 		goto out;
 	}
=20
 	reply =3D pckbc_poll_data1(&pckbc_consdata, PCKBC_KBD_SLOT);
 	if (reply !=3D 0x55) {
-		printf("kbc: selftest returned 0x%02x\n", reply);
+		printf("pckbc: selftest returned 0x%02x\n", reply);
 		res =3D EIO;
 		goto out;
 	}
@@ -695,7 +695,7 @@
 	/* init cmd byte, enable ports */
 	pckbc_consdata.t_cmdbyte =3D KC8_CPU;
 	if (!pckbc_put8042cmd(&pckbc_consdata)) {
-		printf("kbc: cmd word write error\n");
+		printf("pckbc: cmd word write error sending KC8_CPU\n");
 		res =3D EIO;
 		goto out;
 	}

--pgp-sign-Multipart_Wed_May_17_20:44:15_2006-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: 10FxfqEZLbn+HZ7OwxugK4zxRocd2/aK

iQA/AwUBRGvDYGZ9cbd4v/R/EQJJOgCg+ZJoGp+7P3WIWLtHg0LQcq/aR7gAn1lJ
hT5fHuiEBtW56xO+JxvBtIgu
=L2uM
-----END PGP SIGNATURE-----

--pgp-sign-Multipart_Wed_May_17_20:44:15_2006-1--