NetBSD Problem Report #37569

From sborrill@ugly.precedence.co.uk  Wed Dec 19 17:58:22 2007
Return-Path: <sborrill@ugly.precedence.co.uk>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 2F66563B8F0
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 19 Dec 2007 17:58:22 +0000 (UTC)
Message-Id: <200712191759.lBJHxfnE020797@ugly.precedence.co.uk>
Date: Wed, 19 Dec 2007 17:59:41 GMT
From: sborrill@precedence.co.uk
Reply-To: sborrill@precedence.co.uk
To: gnats-bugs@NetBSD.org
Subject: Hangs on kernel entry due to pckbc
X-Send-Pr-Version: 3.95

>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
>Last-Modified:  Thu Dec 20 18:55:01 +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();

>Audit-Trail:
From: Stephen Borrill <sborrill@precedence.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/37569: Hangs on kernel entry due to pckbc
Date: Thu, 20 Dec 2007 10:18:38 +0000

 Hmm, insufficient testing marrs the patch in the general case.
 100 is not sufficient for normal detection, neither is 1000. 10000 works
 on my laptop, but this is clearly stabbing in the dark!

 -- 
 Stephen

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
 --

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.