From owner-freebsd-x11@FreeBSD.ORG Sat Feb 8 13:54:11 2014 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C7BF916; Sat, 8 Feb 2014 13:54:11 +0000 (UTC) Received: from ravenloft.kiev.ua (ravenloft.kiev.ua [94.244.131.95]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 119C61D53; Sat, 8 Feb 2014 13:54:06 +0000 (UTC) Date: Sat, 8 Feb 2014 15:54:04 +0200 From: Alex Kozlov To: Robert Millan Subject: Re: [PATCH] do not feed keyboard device path in X devd backend Message-ID: <20140208135404.GA75736@ravenloft.kiev.ua> References: <52EFA9A9.2040901@freebsd.org> <52F61969.2060503@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52F61969.2060503@freebsd.org> Cc: freebsd-x11@freebsd.org X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 13:54:11 -0000 On Sat, Feb 08, 2014 at 11:47:53AM +0000, Robert Millan wrote: > On 03/02/2014 14:37, Robert Millan wrote: > > > > When feeding the keyboard device path (e.g. /dev/ukbd0) to X server, > > it will attempt to open it. This is incorrect because X doesn't want > > _all_ the input from keyboard but rather just the one typed in its > > VT (usually /dev/ttyv7). > > > > Plus, attempting to open /dev/ukbd0 usually fails with EBUSY as the > > keyboard is already being used by syscons. > > > > This patch adjusts devd.c to follow the same approach as HAL: detect > > the keyboard but feed it a zero-length device path. The result is > > that X detects the presence of a keyboard, and therefore loads the > > kbd_drv module, but doesn't attempt to open it directly (which is > > unnecessary since /dev/ttyv7 is already open). > > Unfortunately this didn't completely fix the problem. Testing by Debian > developers revealed that attaching a second keyboard and then detaching > it disabled keyboard handling in X somehow: > > https://lists.debian.org/debian-bsd/2014/02/msg00074.html > > I investigated and found that HAL avoids this by ignoring keyboard events > completely. Instead, it generates a fake "AT Keyboard" event during > initialization (with empty device path too), which makes X load the kbd > driver just once. > > Here's a patch that implements the same behaviour with devd. I've verified > that attaching/detaching a second keyboard no longer causes this ill effect. Can you please check if devd patch from xorg-dev work for you? http://trillian.chruetertee.ch/ports/browser/trunk/x11-servers/xorg-server/files/extra-devd -- Alex