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>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Sat, May 18, 2024 at 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.
>
Also, in this case, kld_list is a terrible place to load the files. You're
better off loading them with xxx_load=YES 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
[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 18, 2024 at 6:51 AM Oleksandr Kryvulia <<a href="mailto:shuriku@shurik.kiev.ua">shuriku@shurik.kiev.ua</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<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" target="_blank"><shuriku@shurik.kiev.ua></a> writes:
</pre><blockquote type="cite" style="color:rgb(0,124,255)"><pre>Gary Jennejohn <a href="mailto:garyj@gmx.de" target="_blank"><garyj@gmx.de></a> writes:
</pre><blockquote type="cite" style="color:rgb(0,124,255)"><pre>Try adding uhid_load="YES" 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+="uhid" in /etc/rc.conf.
</pre></blockquote><pre>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"</pre></pre>
</blockquote>
Yes, you are right. I mean<br>
<span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">sysrc
kld_list+="uhid"</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. You're better off loading them with xxx_load=YES 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).<br></div><div><br></div><div>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.<br></div><div><br></div>Warner<br></div></div>
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqidBvNz-QU-yeaDNYifvmVjVPCijqr3eMUWsediokbcQ>
