From owner-freebsd-usb@FreeBSD.ORG Mon Jan 11 08:08:23 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DAE31065676 for ; Mon, 11 Jan 2010 08:08:23 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe13.swipnet.se [212.247.155.129]) by mx1.freebsd.org (Postfix) with ESMTP id 77B458FC18 for ; Mon, 11 Jan 2010 08:08:20 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=l0Z3a6eDwrsA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=8kQB0OdkAAAA:8 a=BdEqAHv6TJqaahPLdvcA:9 a=4l4NvM21wrszWAAjEO7pMEojpVsA:4 a=9aOQ2cSd83gA:10 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe13.swip.net (CommuniGate Pro SMTP 5.2.16) with ESMTPA id 976928105; Mon, 11 Jan 2010 09:08:19 +0100 From: Hans Petter Selasky To: Wiktor Niesiobedzki Date: Mon, 11 Jan 2010 09:06:53 +0100 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) References: <201001101640.o0AGe37d002491@freefall.freebsd.org> <201001101923.16236.hselasky@c2i.net> <2ae8edf31001101527w91928d0s51bf32ca47c52e7d@mail.gmail.com> In-Reply-To: <2ae8edf31001101527w91928d0s51bf32ca47c52e7d@mail.gmail.com> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'( =?iso-8859-1?q?=3B=5FIjlA=3A=0A=09hGE=2E=2EEw?=, =?iso-8859-1?q?XAQ*o=23=5C/M=7ESC=3DS1-f9=7BEzRfT=27=7CHhll5Q=5Dha5Bt-s=7Co?= =?iso-8859-1?q?TlKMusi=3A1e=5BwJl=7Dkd=7DGR=0A=09Z0adGx-x=5F0zGbZj=27e?=(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201001110906.53917.hselasky@c2i.net> Cc: freebsd-usb Subject: Re: kern/141011: [usb] Encrypted root, geli password at boot; enter key never release X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 08:08:23 -0000 On Monday 11 January 2010 00:27:50 Wiktor Niesiobedzki wrote: > 2010/1/10 Hans Petter Selasky : > > On Sunday 10 January 2010 17:40:03 Wiktor Niesiobedzki wrote: > >> The following reply was made to PR kern/141011; it has been noted by > >> GNATS. > >> > >> > >> 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? > > > > Hi, > > > > The information we need is inside ukbd.c . Try to add printfs in code > > enabling and disabling the keyboard. Especially in the USB keyboard read > > character function, and try to figure out where the missing characters > > are going. > > Hi, > > Nothing new in enabling and disabling the keyboard. The only > intresting thing is, that although I have only one keyboard, the > ukbd_enable is called twice. > > What I found somehow helping, is some additional printfs in ukbd_read_char. > Especially in beginning part: > printf("enter ukbd_read_char\n"); > if (!KBD_IS_ACTIVE(kbd)) { > printf("kbd is not active - exiting\n"); > return (NOKEY); > } > > if (sc->sc_flags & UKBD_FLAG_POLLING) { > if (!mtx_owned(&Giant)) { > /* XXX cludge */ > printf("ukbd_read_char: UKBD_FLAG_POOLING is > set and giant is not owned - recursing and locking giant\n"); > int retval; > mtx_lock(&Giant); > retval = ukbd_read_char(kbd, wait); > mtx_unlock(&Giant); > return (retval); > } > } else { > /* XXX the keyboard layer requires Giant */ > if (!mtx_owned(&Giant)) > printf("ukbd_read_char: UKBD_FLAG_POOLING is > not set and Giant is not owned -> DISCARDING KEY!\n"); > return (NOKEY); > } > > > Then i see this message: > "ukbd_read_char: UKBD_FLAG_POOLING is set and giant is not owned - > recursing and locking giant" > > Full message is (for entering one character is something like that): > ukbd_read_char: UKBD_FLAG_POOLING is set and giant is not owned - > recursing and locking giant > enter ukbd_read_char > a (echo from GELI) > enter ukbd_read_char > ukbd_read_char: UKBD_FLAG_POOLING is set and giant is not owned - > recursing and locking giant > enter ukbd_read_char > enter ukbd_read_char > > And supriselingly - no characters were lost, when I was typing my > passphareses. > > As far as I know (and I may know wrong - please correct me here) - > there is some relation between Giant and printfs (something like - > when you printf on console, you have to have a giant) but this is just > my wild guessing (maybe from java - where System.out.println is > synchronized method). Is it possible, that my printf's affected how > Giant is handled within ukbd and thus - I don't see misbehaviour of > ukbd now? > > Or was it just my luck now? (I hardly believe that - I usulally got ~8 > characters lost for a boot sequence and now noone). > > > Any hints for now? It might be a timing issue, that we need to extend the polling loop after that the first key has been pressed, so that the key release is also recorded. --HPS