On Fri, Jan 11, 2013 at 04:44:07PM -0800, Kent Fritz wrote:
> I dug a little deeper, and defined PCKBCDEBUG in
> /usr/src/sys/dev/ic/pckbc.c, and it spews:
> pckbc_cmd: lost 0xfc
>
> Looking at pckbc_poll_cmd1, it looks like there's an infinite loop if
> it doesn't get back a response it expects. What's best: specifically
> handling 0xfc, or erroring out on any unexpected response with
> "cmd->status = ENXIO; return;"? (I did the former and it works for
> me.)
I see. So this is happening during pms_probe() which runs before the
protocol is selected. Maybe fix it like this? I think the code should
cope with hardware that returns unrecognizable garbage. But I don't
know very much about PS/2.
Thanks for pinning down the problem!
Index: pckbc.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/pckbc.c,v
retrieving revision 1.31
diff -u -p -r1.31 pckbc.c
--- pckbc.c 17 Oct 2012 19:16:10 -0000 1.31
+++ pckbc.c 12 Jan 2013 01:25:41 -0000
@@ -620,6 +620,11 @@ pckbc_poll_cmd1(struct pckbc_internal *t
#ifdef PCKBCDEBUG
printf("pckbc_cmd: lost 0x%x\n", c);
#endif
+ /* Don't retry cmd forever. */
+ if (cmd->retries++ >= 5) {
+ cmd->status = EIO;
+ return;
+ }
}
while (cmd->responseidx < cmd->responselen) {