Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 May 2024 09:33:24 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Oleksandr Kryvulia <shuriku@shurik.kiev.ua>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: usb mouse not work on boot
Message-ID:  <CANCZdfr6XMAtq-XDeCwnHs%2BGh=tmRR36C_AcXJwCfYXh0DH_xg@mail.gmail.com>
In-Reply-To: <c98a9e1d-3ab7-4a45-b514-cfed7d475198@shurik.kiev.ua>
References:  <ae973e80-7f06-432c-ab66-b1a2ab337eaa@shurik.kiev.ua> <20240518092649.6430ad53@ernst.home> <af05317d-8d64-4a25-b13d-785848c0d326@shurik.kiev.ua> <86ttivwikf.fsf@ltc.des.dev> <cae2b31c-68ed-46c9-9d7b-415926186766@shurik.kiev.ua> <34a397ef-ca2d-4e04-9066-3cf8a0c48616@shurik.kiev.ua> <CANCZdfpD5FeHbb2B-cMDjQesr9NS%2BUVBpzgLG%2Bg4GgSjkBxC3A@mail.gmail.com> <c98a9e1d-3ab7-4a45-b514-cfed7d475198@shurik.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000164d230618bc3116
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, May 18, 2024, 9:22=E2=80=AFAM Oleksandr Kryvulia <shuriku@shurik.ki=
ev.ua>
wrote:

> 18.05.24 16:06, Warner Losh:
>
>
>
> On Sat, May 18, 2024, 6:51=E2=80=AFAM Oleksandr Kryvulia <shuriku@shurik.=
kiev.ua>
> wrote:
>
>> 18.05.24 12:59, Oleksandr Kryvulia:
>>
>> 18.05.24 12:55, Dag-Erling Sm=C3=B8rgrav:
>>
>> Oleksandr Kryvulia <shuriku@shurik.kiev.ua> <shuriku@shurik.kiev.ua> wri=
tes:
>>
>> Gary Jennejohn <garyj@gmx.de> <garyj@gmx.de> writes:
>>
>> Try adding uhid_load=3D"YES" to your /boot/loader.conf.  With that
>> added the module should be automatically loaded during the kernel
>> boot.
>>
>> As workaround I already have kld_list+=3D"uhid" in /etc/rc.conf.
>>
>> I hope you don't mean that literally, because /etc/rc.conf is a shell
>> script and +=3D is not valid shell syntax.  On the other hand, something
>> like
>>
>> kld_list=3D"${kld_list} uhid"
>>
>> Yes, you are right. I mean
>> sysrc kld_list+=3D"uhid"
>>
>>
>> One more correction. Via kld_list I need load ums(4), loading only
>> uhid(4) does not solve a problem.
>>
>
>
> You don't need to change kld_list. In fact, you should undo any changes
> you've made there. Undo everything in loader.conf you've done.
>
> This is a bug in the boot optimization stuff. Or rather, this exposes a
> long standing bug in the USB code where there's an asymmetry between the
> nomatch events and the bus tree it presents to devctl causing devmatch to
> fail when the nomatch events aren't present on boot.
>
> Just set hw.bus.devctl_nomatch_enabled=3D1 in /boot/loader.conf and reboo=
t.
> Or update to the change I'm about to make.
>
>
> Thanks for the detailed explanation, Warner. Interesting that on my syste=
m
> hw.bus.devctl_nomatch_enabled=3D1 is set by /etc/rc.d/devmatch but only
> explicit set it in /boot/loader.conf did the trick. That is why I think
> this sysctl don't work in my case.
>

Yea. That's the optimization. We don't start generating events until it is
one. Setting it in the bootloader causes all events to coke through.
Setting it in devmatch turns them on after we run devmatch the first time,
omitting all of the ones generated on boot.

Warner

>

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

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Sat, May 18, 2024, 9:22=E2=80=AFAM Oleksandr Kryvul=
ia &lt;<a href=3D"mailto:shuriku@shurik.kiev.ua">shuriku@shurik.kiev.ua</a>=
&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 =
0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

 =20
   =20
 =20
  <div>
    18.05.24 16:06, Warner Losh:<br>
    <blockquote type=3D"cite">
     =20
      <div dir=3D"ltr">
        <div dir=3D"auto">
          <div><br>
            <br>
            <div class=3D"gmail_quote">
              <div dir=3D"ltr" class=3D"gmail_attr">On Sat, May 18, 2024,
                6:51=E2=80=AFAM Oleksandr Kryvulia &lt;<a href=3D"mailto:sh=
uriku@shurik.kiev.ua" target=3D"_blank" rel=3D"noreferrer">shuriku@shurik.k=
iev.ua</a>&gt;
                wrote:<br>
              </div>
              <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex">
                <div> 18.05.24 12:59, Oleksandr Kryvulia:<br>
                  <blockquote type=3D"cite"> 18.05.24 12:55, Dag-Erling
                    Sm=C3=B8rgrav:<br>
                    <blockquote type=3D"cite">
                      <pre><pre>Oleksandr Kryvulia <a href=3D"mailto:shurik=
u@shurik.kiev.ua" rel=3D"noreferrer noreferrer" target=3D"_blank">&lt;shuri=
ku@shurik.kiev.ua&gt;</a> writes:
</pre><blockquote type=3D"cite" style=3D"color:#007cff"><pre>Gary Jennejohn=
 <a href=3D"mailto:garyj@gmx.de" rel=3D"noreferrer noreferrer" target=3D"_b=
lank">&lt;garyj@gmx.de&gt;</a> writes:
</pre><blockquote type=3D"cite" style=3D"color:#007cff"><pre>Try adding uhi=
d_load=3D&quot;YES&quot; to your /boot/loader.conf.  With that
added the module should be automatically loaded during the kernel
boot.
</pre></blockquote><pre>As workaround I already have kld_list+=3D&quot;uhid=
&quot; in /etc/rc.conf.
</pre></blockquote><pre>I hope you don&#39;t mean that literally, because /=
etc/rc.conf is a shell
script and +=3D is not valid shell syntax.  On the other hand, something
like

kld_list=3D&quot;${kld_list} uhid&quot;</pre></pre>
                    </blockquote>
                    Yes, you are right. I mean<br>
                    <span style=3D"font-family:monospace"><span style=3D"co=
lor:#000000;background-color:#ffffff">sysrc
                        kld_list+=3D&quot;uhid&quot;</span></span></blockqu=
ote>
                  <br>
                  One more correction. Via kld_list I need load ums(4),
                  loading only uhid(4) does not solve a problem.<br>
                </div>
              </blockquote>
            </div>
          </div>
          <div dir=3D"auto"><br>
          </div>
        </div>
        <div><br>
        </div>
        <div>You don&#39;t need to change kld_list. In fact, you should und=
o
          any changes you&#39;ve made there. Undo everything in loader.conf
          you&#39;ve done.<br>
        </div>
        <div><br>
        </div>
        <div>This is a bug in the boot optimization stuff. Or rather,
          this exposes a long standing bug in the USB code where there&#39;=
s
          an asymmetry between the nomatch events and the bus tree it
          presents to devctl causing devmatch to fail when the nomatch
          events aren&#39;t present on boot.</div>
        <div><br>
        </div>
        <div>Just set hw.bus.devctl_nomatch_enabled=3D1 in
          /boot/loader.conf and reboot. Or update to the change I&#39;m
          about to make.</div>
        <div><br>
        </div>
      </div>
    </blockquote>
    <br>
    <span lang=3D"en"><span><span>Thanks for the detailed explanation, Warn=
er.
          Interesting that on my system hw.bus.devctl_nomatch_enabled=3D1
          is set by /etc/rc.d/devmatch but only explicit set it in
          /boot/loader.conf did the trick. That is why I think this
          sysctl don&#39;t work in my case.<br></span></span></span></div><=
/blockquote></div></div><div dir=3D"auto"><br></div><div dir=3D"auto">Yea. =
That&#39;s the optimization. We don&#39;t start generating events until it =
is one. Setting it in the bootloader causes all events to coke through. Set=
ting it in devmatch turns them on after we run devmatch the first time, omi=
tting all of the ones generated on boot.</div><div dir=3D"auto"><br></div><=
div dir=3D"auto">Warner=C2=A0</div><div dir=3D"auto"><div class=3D"gmail_qu=
ote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex"><div><span lang=3D"en"><span><span>
        </span></span></span>
  </div>

</blockquote></div></div></div>

--000000000000164d230618bc3116--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfr6XMAtq-XDeCwnHs%2BGh=tmRR36C_AcXJwCfYXh0DH_xg>