From nobody@FreeBSD.org  Mon Nov 30 02:53:25 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ADB2B106568D
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 30 Nov 2009 02:53:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 9B9578FC26
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 30 Nov 2009 02:53:25 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id nAU2rPxZ063162
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 30 Nov 2009 02:53:25 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id nAU2rOG8063160;
	Mon, 30 Nov 2009 02:53:24 GMT
	(envelope-from nobody)
Message-Id: <200911300253.nAU2rOG8063160@www.freebsd.org>
Date: Mon, 30 Nov 2009 02:53:24 GMT
From: Normand Leclerc <leclercn@videotron.ca>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Encrypted root, geli password at boot; enter key never released
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         141011
>Category:       kern
>Synopsis:       [usb8] Encrypted root, geli password at boot; enter key never released
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-usb
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 30 03:00:11 UTC 2009
>Closed-Date:    
>Last-Modified:  Sat Nov 13 14:37:59 UTC 2010
>Originator:     Normand Leclerc
>Release:        8.0
>Organization:
none
>Environment:
New install using abd64 GENERIC kernel (can't actually boot right now).
>Description:
  I just finished installing the new release 8.0 on a mini-ITX PC (Intel Atom boxd945gclf2 motherboard based).  The kernel I used is the GENERIC amd64 kernel.

  The installation is simple; two fully encrypted HDD (geom-eli) and a boot flash.  The flash starts the system, mounts the encrypted root and the process continues.

  The bootup sequence starts as usual; initializes all devices and asks for the encrypted root device password.  Once entered, the boot process continues but the screen output gets spaces like if the enter key was pressed.

  Login prompt then comes and, again like if the enter key was pressed, the login just repeats forever.

  I tried disabling the atkbd without success and disconnecting the usb keyboard does not stop the screen from scrolling.

  I also tried to boot the install disk with geom_eli loaded to mount the encrypted partition.  The kernel asks for password and continues with lines inserted again as if the enter key was pressed.  The sysinstall then starts and switches from the main menu to info and back (forever).

  Something is keeping the last key entered from the keyboard and repreats it to infinity....
>How-To-Repeat:
Boot to an encrypted geom_eli partition using USB keyboard on a GENERIC amd64 kernel.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-geom 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Nov 30 04:42:32 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=141011 

From: Guido van Rooij <guido@gvr.org>
To: bug-followup@FreeBSD.org, leclercn@videotron.ca
Cc:  
Subject: Re: kern/141011: [geli] Encrypted root, geli password at boot;
	enter key never released
Date: Wed, 6 Jan 2010 13:22:01 +0100

 I have the same problem, but only when I have hw.usb.no_boot_wait=1.
 When I do not set this tunable, I never get the prompt for the
 GELI password. In stead, the system keeps printing: "Root mount
 waiting for: usbus4".
 Inserting the USB keyboad after entering the GELI password works okay.
 
 -Guido
Responsible-Changed-From-To: freebsd-geom->freebsd-usb 
Responsible-Changed-By: pjd 
Responsible-Changed-When: śro 6 sty 2010 14:04:41 UTC 
Responsible-Changed-Why:  
The problem is more related to USB and ukbd than to GEOM or GELI. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=141011 

From: Hans Petter Selasky <hselasky@freebsd.org>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: kern/141011: [usb] Encrypted root, geli password at boot; enter key never released
Date: Wed, 6 Jan 2010 19:45:38 +0100

 On Wednesday 06 January 2010 18:50:41 Pawel Jakub Dawidek wrote:
 > On Wed, Jan 06, 2010 at 03:21:03PM +0100, Hans Petter Selasky wrote:
 
 > > > Old Synopsis: [geli] Encrypted root, geli password at boot; enter key
 > > > never released New Synopsis: [usb] Encrypted root, geli password at
 > > > boot; enter key never released
 > >
 > > Hi,
 > >
 > > Could you try to comment out:
 > >
 > >                 /* read and discard the input, no one is waiting for it
 > > */ do {
 > >                         c = ukbd_read_char(&sc->sc_kbd, 0);
 > >                 } while (c != NOKEY);
 > >
 > > In "ukbd_interrupt()" in "src/sys/dev/usb/input/ukbd.c" ?
 > 
 
 --HPS

From: Wiktor Niesiobedzki <bsd@w.evip.pl>
To: bug-followup <bug-followup@FreeBSD.org>, leclercn <leclercn@videotron.ca>
Cc:  
Subject: Re: kern/141011: [usb] Encrypted root, geli password at boot; enter 
	key never released
Date: Sat, 9 Jan 2010 13:22:15 +0100

 Hi,
 
 I've just tried your suggestion to comment out the code "read and
 discard the input, no one is waiting for it". (I had to comment out
 also uint32_t c declaration), but I don't see any improvement. Still
 ukbd is behaving, as enter key hadn't been released.
 
 Cheers,
 
 Wiktor Niesiob=C4=99dzki

From: Wiktor Niesiobedzki <bsd@w.evip.pl>
To: Hans Petter Selasky <hselasky@c2i.net>
Cc: bug-followup <bug-followup@freebsd.org>
Subject: Re: Re: kern/141011: [usb] Encrypted root, geli password at boot; 
	enter key never release
Date: Sun, 10 Jan 2010 01:19:08 +0100

 Hi,
 
 I've just tested your patch. After full boot process the keyboard is
 fully usable (that's the great improvement). But on the other hand, I
 see that some of the characters are droped during input of passpharse
 (it looks like every 10th or 15th - not sure if there is constant
 value between characters). The character is dropped no matter how long
 the key is pressed.
 
 Any further hints?
 
 Cheers,
 
 Wiktor Niesiobedzki
 
 2010/1/9 Hans Petter Selasky <hselasky@c2i.net>:
 >
 > ---------- =C2=A0Forwarded Message =C2=A0----------
 >
 > Subject: Re: kern/141011: [usb] Encrypted root, geli password at boot; en=
 ter
 > key never release
 > Date: Friday 08 January 2010
 > From: Hans Petter Selasky <hselasky@c2i.net>
 > To: Guido van Rooij <guido@gvr.org>
 >
 > Hi,
 >
 > Can you try the attached patch to ukbd.c . You might need to apply it by =
 hand.
 > I've attached the complete file aswell.
 >
 > --HPS
 >
 > -------------------------------------------------------
 >

From: Hans Petter Selasky <hselasky@c2i.net>
To: Wiktor Niesiobedzki <bsd@w.evip.pl>
Cc: "bug-followup" <bug-followup@freebsd.org>
Subject: Re: kern/141011: [usb] Encrypted root, geli password at boot; enter key never release
Date: Sun, 10 Jan 2010 08:59:44 +0100

 On Sunday 10 January 2010 01:19:08 Wiktor Niesiobedzki wrote:
 > Hi,
 > 
 > I've just tested your patch. After full boot process the keyboard is
 > fully usable (that's the great improvement). But on the other hand, I
 > see that some of the characters are droped during input of passpharse
 > (it looks like every 10th or 15th - not sure if there is constant
 > value between characters). The character is dropped no matter how long
 > the key is pressed.
 > 
 > Any further hints?
 > 
 
 Try to comment out:
 
                 /* read and discard the input, no one is waiting for it */
                 do {
                         c = ukbd_read_char(&sc->sc_kbd, 0);
                 } while (c != NOKEY);
 
 In: ukbd_interrupt() in ukbd.c.
 
 --HPS

From: Wiktor Niesiobedzki <bsd@w.evip.pl>
To: Hans Petter Selasky <hselasky@c2i.net>
Cc: bug-followup <bug-followup@freebsd.org>
Subject: Re: kern/141011: [usb] Encrypted root, geli password at boot; enter 
	key never release
Date: Sun, 10 Jan 2010 17:34:42 +0100

 2010/1/10 Hans Petter Selasky <hselasky@c2i.net>:
 >
 > Try to comment out:
 >
 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* read and discar=
 d the input, no one is waiting for it */
 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0do {
 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
 =A0 =C2=A0c =3D ukbd_read_char(&sc->sc_kbd, 0);
 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} while (c !=3D NO=
 KEY);
 >
 > In: ukbd_interrupt() in ukbd.c.
 >
 
 Hello Hans,
 
 I've tried to comment out this section in your version of ukbd.c, but
 to no extent. Still some events get discarded somehow. Shall I enable
 some usb debug-flags to help getting to the core of the problem?
 
 Cheers,
 
 Wiktor Niesiobedzki
>Unformatted:
