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>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Sat, May 18, 2024, 9:22 AM Oleksandr Kryvulia <shuriku@shurik.kiev.ua>
wrote:

> 18.05.24 16:06, Warner Losh:
>
>
>
> On Sat, May 18, 2024, 6:51 AM Oleksandr Kryvulia <shuriku@shurik.kiev.ua>
> wrote:
>
>> 18.05.24 12:59, Oleksandr Kryvulia:
>>
>> 18.05.24 12:55, Dag-Erling Smørgrav:
>>
>> Oleksandr Kryvulia <shuriku@shurik.kiev.ua> <shuriku@shurik.kiev.ua> writes:
>>
>> Gary Jennejohn <garyj@gmx.de> <garyj@gmx.de> writes:
>>
>> Try adding uhid_load="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+="uhid" in /etc/rc.conf.
>>
>> I hope you don't mean that literally, because /etc/rc.conf is a shell
>> script and += is not valid shell syntax.  On the other hand, something
>> like
>>
>> kld_list="${kld_list} uhid"
>>
>> Yes, you are right. I mean
>> sysrc kld_list+="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=1 in /boot/loader.conf and reboot.
> Or update to the change I'm about to make.
>
>
> Thanks for the detailed explanation, Warner. Interesting that on my system
> hw.bus.devctl_nomatch_enabled=1 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

>

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

  
    
  
  <div>
    18.05.24 16:06, Warner Losh:<br>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div dir="auto">
          <div><br>
            <br>
            <div class="gmail_quote">
              <div dir="ltr" class="gmail_attr">On Sat, May 18, 2024,
                6:51 AM Oleksandr Kryvulia &lt;<a href="mailto:shuriku@shurik.kiev.ua" target="_blank" rel="noreferrer">shuriku@shurik.kiev.ua</a>&gt;
                wrote:<br>
              </div>
              <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div> 18.05.24 12:59, Oleksandr Kryvulia:<br>
                  <blockquote type="cite"> 18.05.24 12:55, Dag-Erling
                    Smørgrav:<br>
                    <blockquote type="cite">
                      <pre><pre>Oleksandr Kryvulia <a href="mailto:shuriku@shurik.kiev.ua" rel="noreferrer noreferrer" target="_blank">&lt;shuriku@shurik.kiev.ua&gt;</a> writes:
</pre><blockquote type="cite" style="color:#007cff"><pre>Gary Jennejohn <a href="mailto:garyj@gmx.de" rel="noreferrer noreferrer" target="_blank">&lt;garyj@gmx.de&gt;</a> writes:
</pre><blockquote type="cite" style="color:#007cff"><pre>Try adding uhid_load=&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+=&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 += is not valid shell syntax.  On the other hand, something
like

kld_list=&quot;${kld_list} uhid&quot;</pre></pre>
                    </blockquote>
                    Yes, you are right. I mean<br>
                    <span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff">sysrc
                        kld_list+=&quot;uhid&quot;</span></span></blockquote>
                  <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="auto"><br>
          </div>
        </div>
        <div><br>
        </div>
        <div>You don&#39;t need to change kld_list. In fact, you should undo
          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=1 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="en"><span><span>Thanks for the detailed explanation, Warner.
          Interesting that on my system hw.bus.devctl_nomatch_enabled=1
          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="auto"><br></div><div dir="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. Setting it in devmatch turns them on after we run devmatch the first time, omitting all of the ones generated on boot.</div><div dir="auto"><br></div><div dir="auto">Warner </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><span lang="en"><span><span>
        </span></span></span>
  </div>

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

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