Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 May 2024 07:17:35 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Oleksandr Kryvulia <shuriku@shurik.kiev.ua>
Cc:        freebsd-current@freebsd.org
Subject:   Re: usb mouse not work on boot
Message-ID:  <CANCZdfqidBvNz-QU-yeaDNYifvmVjVPCijqr3eMUWsediokbcQ@mail.gmail.com>
In-Reply-To: <34a397ef-ca2d-4e04-9066-3cf8a0c48616@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>

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

On Sat, May 18, 2024 at 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> writ=
es:
>
> 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.
>

Also, in this case, kld_list is a terrible place to load the files. You're
better off loading them with xxx_load=3DYES in loader.conf. The reason is
that both uhid and ums will match your mouse. kld_list loads these in a
random order (effectively) and the first one to load will claim the device,
since there's no re-probe when the next one loads. You should never use it,
unless the module you're loading isn't supported by the boot loader (like
drm-kmod). The old advice was to put everything in kld_list and it would
speed up boot, but all the performance bugs in the boot loader have been
fixed by a combination of moving to UEFI (which is generally faster),
BIOSes with performance bugs disappearing 10 years ago and block caching
being added to the boot loader. It should almost always be empty or just
drm-mod these days (unless you somehow have special needs).

By adding uhid last to this list in this way, you're guaranteeing you'll
hit this bug because it's not after ums, and that things won't work.

Warner

--0000000000004da2a60618ba4ba5
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 Sat, May 18, 2024 at 6:51=E2=80=AF=
AM Oleksandr Kryvulia &lt;<a href=3D"mailto:shuriku@shurik.kiev.ua">shuriku=
@shurik.kiev.ua</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex"><u></u>

 =20
   =20
 =20
  <div>
    18.05.24 12:59, Oleksandr Kryvulia:<br>
    <blockquote type=3D"cite">
     =20
      18.05.24 12:55, Dag-Erling Sm=C3=B8rgrav:<br>
      <blockquote type=3D"cite">
        <pre><pre>Oleksandr Kryvulia <a href=3D"mailto:shuriku@shurik.kiev.=
ua" target=3D"_blank">&lt;shuriku@shurik.kiev.ua&gt;</a> writes:
</pre><blockquote type=3D"cite" style=3D"color:rgb(0,124,255)"><pre>Gary Je=
nnejohn <a href=3D"mailto:garyj@gmx.de" target=3D"_blank">&lt;garyj@gmx.de&=
gt;</a> writes:
</pre><blockquote type=3D"cite" style=3D"color:rgb(0,124,255)"><pre>Try add=
ing uhid_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"color:rgb(0,0,0)=
;background-color:rgb(255,255,255)">sysrc
          kld_list+=3D&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><br></div>=
<div>Also, in this case, kld_list is a terrible place to load the files. Yo=
u&#39;re better off loading them with xxx_load=3DYES in loader.conf. The re=
ason is that both uhid and ums will match your mouse. kld_list loads these =
in a random order (effectively) and the first one to load will claim the de=
vice, since there&#39;s no re-probe when the next one loads. You should nev=
er use it, unless the module you&#39;re loading isn&#39;t supported by the =
boot loader (like drm-kmod). The old advice was to put everything in kld_li=
st and it would speed up boot, but all the performance bugs in the boot loa=
der have been fixed by a combination of moving to UEFI (which is generally =
faster), BIOSes with performance bugs disappearing 10 years ago and block c=
aching being added to the boot loader. It should almost always be empty or =
just drm-mod these days (unless you somehow have special needs).<br></div><=
div><br></div><div>By adding uhid last to this list in this way, you&#39;re=
 guaranteeing you&#39;ll hit this bug because it&#39;s not after ums, and t=
hat things won&#39;t work.<br></div><div><br></div>Warner<br></div></div>

--0000000000004da2a60618ba4ba5--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqidBvNz-QU-yeaDNYifvmVjVPCijqr3eMUWsediokbcQ>