From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 18 17:58:58 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 063E7106566B; Sun, 18 Dec 2011 17:58:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B301A8FC0A; Sun, 18 Dec 2011 17:58:56 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA18656; Sun, 18 Dec 2011 19:58:51 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RcL0c-000CvS-Tv; Sun, 18 Dec 2011 19:58:50 +0200 Message-ID: <4EEE29D7.6020504@FreeBSD.org> Date: Sun, 18 Dec 2011 19:58:47 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <4EE51CB5.1060505@FreeBSD.org> <201112171806.43764.hselasky@c2i.net> <4EEDC771.800@FreeBSD.org> <201112181839.24813.hselasky@c2i.net> In-Reply-To: <201112181839.24813.hselasky@c2i.net> X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: usb@FreeBSD.org, freebsd-hackers@FreeBSD.org, John Baldwin , 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:58:58 -0000 on 18/12/2011 19:39 Hans Petter Selasky said the following: > 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? Yes :-) I want to see a non-polled code path in the keyboard layer where Giant is not locked. >>> 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! Hope it won't be long. Thank you! -- Andriy Gapon