From owner-freebsd-current@FreeBSD.ORG Fri Sep 19 16:20:43 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 292DE106567C for ; Fri, 19 Sep 2008 16:20:43 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by mx1.freebsd.org (Postfix) with ESMTP id ABDF98FC27 for ; Fri, 19 Sep 2008 16:20:42 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by ug-out-1314.google.com with SMTP id m2so986018uge.39 for ; Fri, 19 Sep 2008 09:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=r8rCprG7oY230M2U1ABTP+hNY4p+dN/irntcK3CNLBQ=; b=ndAKbMQdB1awMHFWmPpZjcxkI1D2Q+xpOHiR+2DrIzBMRvc4p0kgfMVcUy/PiK7bqr 9McwiNf+tAdidj9BzKxlbcawC0DXBIAsboXL1C0mowDcnb21WpHgLG2WMhNO+HusRZS6 QThcXje8Hg+rmoM4BHyl4GFGNZGXC3I9BdoSc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=coRVwCEB8g4hcyhD/B+0ZnH+VQj6zHIT6jytcgSs0T7rPsNbCPQXBrEOtC2fKErYis ki9XoYpw3fHE72HoTvEGjog4IpIcm2RIVIS8K+Gzfgn84GUwMZ+RyGmqaKZ5RGO8V4QA k/4G8eK2oxtaaoaMdxwXvZUfk6AtbSs8VRkSk= Received: by 10.86.82.6 with SMTP id f6mr2129555fgb.53.1221841241340; Fri, 19 Sep 2008 09:20:41 -0700 (PDT) Received: by 10.86.62.1 with HTTP; Fri, 19 Sep 2008 09:20:41 -0700 (PDT) Message-ID: Date: Fri, 19 Sep 2008 09:20:41 -0700 From: "Maksim Yevmenkin" To: "Eygene Ryabinkin" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080917161633.9E2F717101@shadow.codelabs.ru> Cc: rik@freebsd.org, current@freebsd.org, bug-followup@freebsd.org Subject: Re: kern/127446: [patch] fix race in sys/dev/kbdmux/kbdmux.c 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, 19 Sep 2008 16:20:43 -0000 [moving to -current] On 9/18/08, Eygene Ryabinkin wrote: > Me again. > > > Thu, Sep 18, 2008 at 11:10:17AM +0400, Eygene Ryabinkin wrote: > > OK, I had tried substituting KBDMUX_LOCK/UNLOCK with Giant operations -- > > it works as expected. > > > Tried my initial patch on some 7.0-PRERELEASE -- it locks keyboard when > geli asks for the password. Had not much time to dig it out, will try > to do it as soon as I can. Substituting KBDMUX_LOCK/UNLOCK with Giant > locking helps even on this FreeBSD version. > > More testing needed, may be there are some other issues that aren't > revealing themselves... did you have a chance to do some testing? i tried substituting KBDMUX_LOCK/UNLOCK with Giant locking here locally and played with a couple of keyboards under X and console. no apparent issues or witness complains. would it be ok for me to commit this? --- kbdmux.c.orig 2008-07-29 14:21:20.000000000 -0700 +++ kbdmux.c 2008-09-19 09:02:54.000000000 -0700 @@ -104,9 +104,11 @@ #define KBDMUX_LOCK_DESTROY(s) -#define KBDMUX_LOCK(s) +#define KBDMUX_LOCK(s) \ + mtx_lock(&Giant) -#define KBDMUX_UNLOCK(s) +#define KBDMUX_UNLOCK(s) \ + mtx_unlock(&Giant) #define KBDMUX_LOCK_ASSERT(s, w) thanks, max