Subject: Re: kern/37569: Hangs on kernel entry due to pckbc
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-bugs
Date: 12/20/2007 18:55:02
The following reply was made to PR kern/37569; it has been noted by GNATS.

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
	netbsd-bugs@NetBSD.org
Subject: Re: kern/37569: Hangs on kernel entry due to pckbc
Date: Wed, 19 Dec 2007 20:31:33 +0100

 On Wed, Dec 19, 2007 at 06:00:00PM +0000, sborrill@precedence.co.uk wrote:
 > >Number:         37569
 > >Category:       kern
 > >Synopsis:       On a machine with USB keyboard only, the kernel hangs on entry for a considerable time
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    kern-bug-people
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Wed Dec 19 18:00:00 +0000 2007
 > >Originator:     Stephen Borrill
 > >Release:        NetBSD 4.99.42
 > >Organization:
 > >Environment:
 > 	
 > 	
 > System: NetBSD 4.99.42 (GENERIC) #4: Tue Dec 18 14:36:45 GMT 2007
 > Architecture: i386
 > Machine: i386
 > >Description:
 > On an HP ML110 boot a GENERIC kernel. There is a very long pause (5 mins?) before
 > any kernel text is printed, a similar pause after pckbd0 as isa0 is probed and also when
 > shutting down.
 > 
 > The ML110 is odd in that it appears to have  PS/2 ports, but in fact these are connected
 > to an internal PS/2 to USB convertor:
 > 
 > uhidev0 at uhub3 port 1 configuration 1 interface 0
 > uhidev0: ServerEngines SE USB Device, rev 1.10/0.01, addr 2, iclass 3/1
 > ukbd0 at uhidev0
 > wskbd1 at ukbd0 mux 1
 > wskbd1: connecting to wsdisplay0
 > uhidev1 at uhub3 port 1 configuration 1 interface 1
 > uhidev1: ServerEngines SE USB Device, rev 1.10/0.01, addr 2, iclass 3/1
 > ums0 at uhidev1: 8 buttons and Z dir.
 > wsmouse0 at ums0 mux 0
 > >How-To-Repeat:
 > Boot GENERIC i386 or amd64 on a HP ML110.
 > >Fix:
 > Options:
 > 1) put "no pckbd" in your kernel config
 > 2) Set a shorter timeout in dev/ic/pckbc.c
 > 
 > --- sys/dev/ic/pckbc.c.orig	2007-12-19 17:56:16.000000000 +0000
 > +++ sys/dev/ic/pckbc.c	2007-12-19 17:57:40.000000000 +0000
 > @@ -134,6 +134,11 @@
 >   * in some system configurations.
 >   * This is not canonical way to handle polling input.
 >   */
 > + 
 > +#ifndef PCKBC_POLLTIME
 > +#define PCKBC_POLLTIME 100
 > +#endif
 > +
 >  int
 >  pckbc_poll_data1(pt, slot)
 >  	void *pt;
 > @@ -143,7 +148,7 @@
 >  	struct pckbc_slotdata *q = t->t_slotdata[slot];
 >  	int s;
 >  	u_char stat, c;
 > -	int i = 100000; /* if 1 port read takes 1us (?), this polls for 100ms */
 > +	int i = PCKBC_POLLTIME;
 >  	int checkaux = t->t_haveaux;
 >  
 >  	s = splhigh();
 
 Won't this cause problem on other hardware ? It may be better to use delay()
 here, if it's possible at this time.
 
 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --