From nobody Mon Jun 27 16:58:14 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 25C0287C21F for ; Mon, 27 Jun 2022 16:59:39 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp.infotel.ru (corp.infotel.ru [195.170.219.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4LWv8p0tvRz4rYr for ; Mon, 27 Jun 2022 16:59:37 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp (corp.infotel.ru [195.170.219.3]) by corp.infotel.ru (Postfix) with ESMTP id ADEEC35E5CE; Mon, 27 Jun 2022 19:59:29 +0300 (MSK) X-Virus-Scanned: amavisd-new at corp.infotel.ru Received: from corp.infotel.ru ([195.170.219.3]) by corp (corp.infotel.ru [195.170.219.3]) (amavisd-new, port 10024) with ESMTP id P_uXXs_9TLxb; Mon, 27 Jun 2022 19:58:49 +0300 (MSK) Received: from mail.cicgroup.ru (unknown [195.170.219.74]) by corp.infotel.ru (Postfix) with ESMTP id 3713235E5CD; Mon, 27 Jun 2022 19:58:49 +0300 (MSK) Received: from mail.cicgroup.ru (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTP id 399C242211F; Mon, 27 Jun 2022 19:58:48 +0300 (MSK) Received: from mail.cicgroup.ru ([127.0.0.1]) by mail.cicgroup.ru (mail.cicgroup.ru [127.0.0.1]) (amavisd-new, port 10024) with SMTP id F3EsMHq_BMVg; Mon, 27 Jun 2022 19:58:41 +0300 (MSK) Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTPA id 257F742211C; Mon, 27 Jun 2022 19:58:41 +0300 (MSK) Message-ID: <8674be8f-b4fb-008d-9318-2184285b46a8@kondratyev.su> Date: Mon, 27 Jun 2022 19:58:14 +0300 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: iichid/hms keyboard/mouse wrongly reattached to uhid/ums Content-Language: en-US To: Ivan Quitschal , "freebsd-current@freebsd.org" References: From: Vladimir Kondratyev In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4LWv8p0tvRz4rYr X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of vladimir@kondratyev.su has no SPF policy when checking 195.170.219.3) smtp.mailfrom=vladimir@kondratyev.su X-Spamd-Result: default: False [-1.76 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.76)[-0.760]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[kondratyev.su]; AUTH_NA(1.00)[]; R_SPF_NA(0.00)[no SPF record]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[freebsd-current]; FREEMAIL_TO(0.00)[hotmail.com,freebsd.org]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8299, ipnet:195.170.192.0/19, country:RU]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 27.06.2022 18:19, Ivan Quitschal wrote: > Hi all >=20 > Not sure if I found a problem here but here we go. >=20 > Since I have a KVM usb switch here for keyboard/mouse sometimes I toggl= e it=20 > between my windows and freebsd. >=20 > I am using iichid here to have my multimedia keys working on keyboard a= nd all >=20 > hw.usb.usbhid.enable=3D"1" >=20 > Im also using Wulf=E2=80=99s moused >=20 > https://github.com/wulf7/moused >=20 > so far so good. Problem is: >=20 > when I switch to windows , everything is detached correctly (hms, hkbd = etc), but=20 > when I switch back, sometimes >=20 > the keyboard and mouse are wrongly attached to =E2=80=9Cums=E2=80=9D de= vice , not hms.=20 > (sometimes it goes to the correct one). >=20 > Shouldn=E2=80=99t ums/uhid modules be deactivated once hw.usb.usbhid.en= able is set to 1 ? >=20 > The workaround I did here was to manually kldunload both uhid.ko and um= s.ko=20 > within rc.local during boot. >=20 > This way I can detache attach the kbd/mouse back as much as I want and = it always=20 > end up in hms/hkbd devices >=20 > Is this how its supposed to function? Randomly choosing between ums or = hms? >=20 > Thanks >=20 > --tzk It seems that usbhid's bus probe priority must be increased from BUS_PROBE_GENERIC + 1 to BUS_PROBE_DEFAULT + 1 Test this patch: diff --git a/sys/dev/usb/input/usbhid.c b/sys/dev/usb/input/usbhid.c index fe53f11b8f4..174e1c28ae9 100644 --- a/sys/dev/usb/input/usbhid.c +++ b/sys/dev/usb/input/usbhid.c @@ -802,7 +802,7 @@ usbhid_probe(device_t dev) if (hid_test_quirk(&sc->sc_hw, HQ_HID_IGNORE)) return (ENXIO); - return (BUS_PROBE_GENERIC + 1); + return (BUS_PROBE_DEFAULT + 1); } static int --=20 WBR Vladimir Kondratyev