From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 18 17:41:57 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 084A2106566B; Sun, 18 Dec 2011 17:41:57 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe09.c2i.net [212.247.155.2]) by mx1.freebsd.org (Postfix) with ESMTP id B4B688FC12; Sun, 18 Dec 2011 17:41:55 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe09.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 44558516; Sun, 18 Dec 2011 18:41:53 +0100 From: Hans Petter Selasky To: Andriy Gapon Date: Sun, 18 Dec 2011 18:39:24 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4EE51CB5.1060505@FreeBSD.org> <201112171806.43764.hselasky@c2i.net> <4EEDC771.800@FreeBSD.org> In-Reply-To: <4EEDC771.800@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201112181839.24813.hselasky@c2i.net> Cc: usb@freebsd.org, freebsd-hackers@freebsd.org, mdf@freebsd.org Subject: Re: kern_yield vs ukbd_yield X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2011 17:41:57 -0000 On Sunday 18 December 2011 11:58:57 Andriy Gapon wrote: > on 17/12/2011 19:06 Hans Petter Selasky said the following: > > If the problem is only in UKBD driver, I don't think this is a big > > problem to solve. The reason for the auto-magic locking, is that I've > > sometimes seen callers in non-polling mode call into UKBD without Giant > > locked. And this causes a panic when starting USB transfers, because the > > code expects Giant to be locked. > > Hmm, do you have an example of such a panic? I couldn't find how this could > be possible in my examination of non-polling entry points into syscons and > kbd drives. mtx_assert(&Giant, MTX_OWNED); will panic if Giant is not locked. Do you need an example? > > > Requirement: I would say that to use UKBD polling mode, the scheduler > > must be stopped. Else you should not use polling mode at all. I think > > that mountroot is getting characters the wrong way in this regard. > > I think that this is a too strong / unnecessary requirement. I think that > now (after my recent syscons commits) ukbd should work correctly and > optimally in this context. > > I have written a small article about my analysis of locking in syscons, > underlying kbd drivers and ukbd in particular: > http://wiki.freebsd.org/AvgSyscons > I could have misunderstood or missed things, so I will appreciate a review > and discussion of my observations. Thank you! I will have a look at it when I find some time! --HPS