From owner-freebsd-usb@FreeBSD.ORG Mon Feb 11 10:30:01 2013 Return-Path: Delivered-To: freebsd-usb@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DEE3056D for ; Mon, 11 Feb 2013 10:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D21BD1974 for ; Mon, 11 Feb 2013 10:30:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r1BAU1no073784 for ; Mon, 11 Feb 2013 10:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r1BAU1hf073781; Mon, 11 Feb 2013 10:30:01 GMT (envelope-from gnats) Date: Mon, 11 Feb 2013 10:30:01 GMT Message-Id: <201302111030.r1BAU1hf073781@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org Cc: From: Hans Petter Selasky Subject: usb/175731: detaching USB keyboard freezes other USB keyboards X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Hans Petter Selasky List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Feb 2013 10:30:01 -0000 The following reply was made to PR usb/175731; it has been noted by GNATS. From: Hans Petter Selasky To: freebsd-usb@freebsd.org, bug-followup@freebsd.org Cc: x11@freebsd.org Subject: usb/175731: detaching USB keyboard freezes other USB keyboards Date: Mon, 11 Feb 2013 11:26:08 +0100 On Thursday 07 February 2013 22:40:01 Hans Petter Selasky wrote: > The following reply was made to PR usb/175731; it has been noted by GNATS. > Hi, You should look into HAL and xf86-input-keyboard ports. I don't have time to debug this currently. To prevent KBD X11 driver unload by /usr/ports/x11-drivers/xf86-input-keyboard change this in the source code: { - xf86AddInputDriver(&KBD, NULL, 0); + xf86AddInputDriver(&KBD, module, 0); return module; } The problem is deeper. When X11 sees that the keyboard is gone it issues some IOCTLs on /dev/console, like the keyboard MODE and then no more keys are received. See using ktrace on Xorg. This is a shared device receiving key-presses for all keyboards as far as I can see and it should only be programmed once. This is currently not handled. Inside the file referenced below code is present to set "x11_driver" to "kbd". Probably changing this will affect the outcome too: /usr/local/share/hal/fdi/policy/10osvendor/10-x11-input.fdi How to reproduce: Plug two USB keyboards using a HAL enabled Xorg server. Unplug one keyboard. Input from the other keyboard disappears until some other keyboard device is plugged again! --HPS