Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jun 2022 09:37:02 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        Ivan Quitschal <tezeka@hotmail.com>,  "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>, "wulf@freebsd.org" <wulf@freebsd.org>
Subject:   Re: iichid/hms keyboard/mouse wrongly reattached to uhid/ums
Message-ID:  <CANCZdfoK71fKS0jc4TwBTh7gQ8kJDz=wdZOfhAS1cgfdLr67Tg@mail.gmail.com>
In-Reply-To: <420b1f58-09c4-6876-b1ad-91751c60e83c@selasky.org>
References:  <CP6P284MB1900818F505F78F68EC4C6BECBB99@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM> <420b1f58-09c4-6876-b1ad-91751c60e83c@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000add41b05e26fb199
Content-Type: text/plain; charset="UTF-8"

On Mon, Jun 27, 2022 at 9:27 AM Hans Petter Selasky <hps@selasky.org> wrote:

> On 6/27/22 17:19, Ivan Quitschal wrote:
> > Hi all
> >
> > Not sure if I found a problem here but here we go.
> >
> > Since I have a KVM usb switch here for keyboard/mouse sometimes I toggle
> it between my windows and freebsd.
> > I am using iichid here to have my multimedia keys working on keyboard
> and all
> >
> > hw.usb.usbhid.enable="1"
> >
> > Im also using Wulf's moused
> > https://github.com/wulf7/moused
> > so far so good. Problem is:
> >
> > when I switch to windows , everything is detached correctly (hms, hkbd
> etc), but when I switch back, sometimes
> > the keyboard and mouse are wrongly attached to "ums" device , not hms.
> (sometimes it goes to the correct one).
> > Shouldn't ums/uhid modules be deactivated once hw.usb.usbhid.enable is
> set to 1 ?
> >
> > The workaround I did here was to manually kldunload both uhid.ko and
> ums.ko within rc.local during boot.
> > This way I can detache attach the kbd/mouse back as much as I want and
> it always end up in hms/hkbd devices
> >
> > Is this how its supposed to function? Randomly choosing between ums or
> hms?
> >
>
> Hi,
>
> Can you dump "kldstat" at the different times?
>
> I guess it may be just be that the wrong module is loaded first, so it
> grabs the device, because there are no other drivers loaded, even though
> ums is a generic driver.
>
> Try loading all relevant drivers in /boot/loader.conf . Then the attach
> order shouldn't matter.
>

We should fix the priority of the two drivers if the order matters...

Another possibility is that the ums is loaded and hms isn't so ums wins. If
any device wins, devmatch isn't invoked to load possible drivers..

Warner

--000000000000add41b05e26fb199
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Mon, Jun 27, 2022 at 9:27 AM Hans =
Petter Selasky &lt;<a href=3D"mailto:hps@selasky.org">hps@selasky.org</a>&g=
t; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0p=
x 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 6/2=
7/22 17:19, Ivan Quitschal wrote:<br>
&gt; Hi all<br>
&gt; <br>
&gt; Not sure if I found a problem here but here we go.<br>
&gt; <br>
&gt; Since I have a KVM usb switch here for keyboard/mouse sometimes I togg=
le it between my windows and freebsd.<br>
&gt; I am using iichid here to have my multimedia keys working on keyboard =
and all<br>
&gt; <br>
&gt; hw.usb.usbhid.enable=3D&quot;1&quot;<br>
&gt; <br>
&gt; Im also using Wulf&#39;s moused<br>
&gt; <a href=3D"https://github.com/wulf7/moused" rel=3D"noreferrer" target=
=3D"_blank">https://github.com/wulf7/moused</a><br>;
&gt; so far so good. Problem is:<br>
&gt; <br>
&gt; when I switch to windows , everything is detached correctly (hms, hkbd=
 etc), but when I switch back, sometimes<br>
&gt; the keyboard and mouse are wrongly attached to &quot;ums&quot; device =
, not hms. (sometimes it goes to the correct one).<br>
&gt; Shouldn&#39;t ums/uhid modules be deactivated once hw.usb.usbhid.enabl=
e is set to 1 ?<br>
&gt; <br>
&gt; The workaround I did here was to manually kldunload both uhid.ko and u=
ms.ko within rc.local during boot.<br>
&gt; This way I can detache attach the kbd/mouse back as much as I want and=
 it always end up in hms/hkbd devices<br>
&gt; <br>
&gt; Is this how its supposed to function? Randomly choosing between ums or=
 hms?<br>
&gt; <br>
<br>
Hi,<br>
<br>
Can you dump &quot;kldstat&quot; at the different times?<br>
<br>
I guess it may be just be that the wrong module is loaded first, so it <br>
grabs the device, because there are no other drivers loaded, even though <b=
r>
ums is a generic driver.<br>
<br>
Try loading all relevant drivers in /boot/loader.conf . Then the attach <br=
>
order shouldn&#39;t matter.<br></blockquote><div><br></div><div>We should f=
ix the priority of the two drivers if the order matters...</div><div><br></=
div><div>Another possibility is that the ums is loaded and hms isn&#39;t so=
 ums wins. If any device wins, devmatch isn&#39;t invoked to load possible =
drivers..</div><div><br></div><div>Warner</div></div></div>

--000000000000add41b05e26fb199--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoK71fKS0jc4TwBTh7gQ8kJDz=wdZOfhAS1cgfdLr67Tg>