From owner-freebsd-current@FreeBSD.ORG Fri Jul 24 12:39:52 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C082106566B; Fri, 24 Jul 2009 12:39:52 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 392878FC0A; Fri, 24 Jul 2009 12:39:51 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA20586; Fri, 24 Jul 2009 15:39:46 +0300 (EEST) (envelope-from avg@icyb.net.ua) Message-ID: <4A69AB91.2010208@icyb.net.ua> Date: Fri, 24 Jul 2009 15:39:45 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.22 (X11/20090630) MIME-Version: 1.0 To: Maksim Yevmenkin , Hans Petter Selasky References: <1280352d0907101020q69f494cdndb01ff14ecf7ea8c@mail.gmail.com> <200907152236.58049.hselasky@c2i.net> <20090720215141.GL49724@elvis.mu.org> <200907211420.33571.hselasky@c2i.net> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: usb@freebsd.org, freebsd-current@freebsd.org, Andrew Thompson Subject: Re: USB polling (75% done) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 12:39:52 -0000 on 23/07/2009 21:23 Maksim Yevmenkin said the following: > On Tue, Jul 21, 2009 at 5:20 AM, Hans Petter Selasky wrote: >> On Monday 20 July 2009 23:51:41 Alfred Perlstein wrote: >>> * Hans Petter Selasky [090715 13:37] wrote: ... >>>> Using USB keyboard in KDB: Does not work because Giant is not locked when >>>> calling into the UKBD's get char routine. UKBD is Giant locked. Someone >>>> familiar with the keyboard system on FreeBSD please step forward and fix >>>> this so that UKBD gets independent of the Giant mutex. >>> the ukbd driver needs giant? >> I think the keyboard mux is under Giant, and does not have any concept about >> mutexes. Most simple solution would be that DDB locks Giant before entering >> into the keyboard code. > > as i understand it, keyboard drivers (and kbdmux(4) is a keyboard > driver), can/should not use any locks. period. so whatever calls into > keyboard driver should take care of locking. Maybe I am missing something but I do not see any explicit locking or lock assertions in kbdmux code. All lock defines are under #if 0. kbdmux does use taskqueue_swi_giant though. Tasks are queued on it in kbdmux_kbd_intr_timo (periodic callout) and in kbdmux_kbd_event (kbd callback). But, these shouldn't get called in polling mode, right? (because there shouldn't be any interrupts) Maybe Giant asserts in ukbd are not needed? Or should be asserted only in "normal" mode? P.S. I am far from knowing this area, just got curious. -- Andriy Gapon