From owner-freebsd-usb@FreeBSD.ORG Sat Feb 1 04:10:02 2014 Return-Path: Delivered-To: freebsd-usb@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF156F61 for ; Sat, 1 Feb 2014 04:10:02 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B60791766 for ; Sat, 1 Feb 2014 04:10:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s114A2Kb000573 for ; Sat, 1 Feb 2014 04:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id s114A2pl000572; Sat, 1 Feb 2014 04:10:02 GMT (envelope-from gnats) Resent-Date: Sat, 1 Feb 2014 04:10:02 GMT Resent-Message-Id: <201402010410.s114A2pl000572@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andrew Childs 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 E504BF1D for ; Sat, 1 Feb 2014 04:03:26 +0000 (UTC) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by mx1.freebsd.org (Postfix) with ESMTP id AE479174C for ; Sat, 1 Feb 2014 04:03:25 +0000 (UTC) Received: from mxin2-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0N0A00J9WT8H7W20@smtp3.clear.net.nz> for FreeBSD-gnats-submit@freebsd.org; Sat, 01 Feb 2014 16:48:18 +1300 (NZDT) Received: from 202-78-141-194.cable.telstraclear.net (HELO mail.cons.org.nz) ([202.78.141.194]) by smtpin2.clear.net.nz with ESMTP; Sat, 01 Feb 2014 16:48:17 +1300 Received: from xenon.cons.org.nz (xenon.cons.org.nz [10.88.0.197]) by mail.cons.org.nz (Postfix) with ESMTP id 2240227F110 for ; Sat, 01 Feb 2014 16:48:15 +1300 (NZDT) Received: by xenon.cons.org.nz (Postfix, from userid 1001) id 6471F8B9BBB; Sat, 01 Feb 2014 16:48:14 +1300 (NZDT) Message-Id: <20140201034814.6471F8B9BBB@xenon.cons.org.nz> Date: Sat, 01 Feb 2014 16:48:14 +1300 (NZDT) From: Andrew Childs To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.114 Subject: usb/186317: ums module not loaded by devd for Razer Lachesis mouse X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Andrew Childs List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Feb 2014 04:10:02 -0000 >Number: 186317 >Category: usb >Synopsis: ums module not loaded by devd for Razer Lachesis mouse >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Feb 01 04:10:01 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Andrew Childs >Release: FreeBSD 10.0-RELEASE amd64 >Organization: >Environment: System: FreeBSD xenon 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 >Description: My mouse doesn't work by default in FreeBSD 10.0-RELEASE, but works fine after manually loading the ums module. This was not a problem with FreeBSD 9.1-RELEASE where the ums driver was compiled in. The Razer Lachesis exposes two interfaces: interface 0: class=3 (HID), subclass=0 (non-boot), protocol=2 (mouse) interface 1: class=3 (HID), subclass=1 (boot) , protocol=1 (keyboard) The intended logic of loading the ums driver is to fail at matching entirely, and fall through to devd's nomatch blocks, which will then load the ums module. There are two problems with this approach: 1. uhid will return a low priority match for all non boot protocol devices (3/0/*), (precisely: it explicitly ignores 3/1/1, 3/1/2, and quirks). We can see this behaviour in the probing of the Razer Lachesis mouse interface with dtrace: CPU ID FUNCTION:NAME 0 27731 device_probe_child:entry dev=fffff80030b73500, child=fffff80029148a00 0 11436 ukbd_probe:entry dev=fffff80029148a00 0 11437 ukbd_probe:return 6 0 48559 uhid_probe:entry dev=fffff80029148a00 0 48560 uhid_probe:return -100 (here the uhid driver is selected as best match and attached) 0 48559 uhid_probe:entry dev=fffff80029148a00 0 48560 uhid_probe:return -100 0 27732 device_probe_child:return 2. The ums driver's contribution to etc/devd/usb.conf (via ums_devs) will only match boot protocol mice (3/1/2) nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "intclass" "0x03"; match "intsubclass" "0x01"; match "intprotocol" "0x02"; action "kldload -n ums"; }; >How-To-Repeat: >Fix: I think the easiest solution is to compile in ums. A more correct solution to allow ums to be a module would be to modify uhid_probe to better reflect the result of ums_probe and ukbd_probe (check hid_is_mouse and hid_is_keyboard), and relax the the ums module's matching to only check interface class. As I workaround, I added ums_load="YES" to /boot/loader.conf. >Release-Note: >Audit-Trail: >Unformatted: