Date: Sat, 18 May 2024 16:29:39 +0000 From: Ivan Quitschal <tezeka@hotmail.com> To: Vladimir Kondratyev <vladimir@kondratyev.su>, Warner Losh <imp@bsdimp.com>, Oleksandr Kryvulia <shuriku@shurik.kiev.ua> Cc: FreeBSD Current <freebsd-current@freebsd.org> Subject: RES: usb mouse not work on boot Message-ID: <CPWP152MB79211F6DC95232F99BC66D26CBEF2@CPWP152MB7921.LAMP152.PROD.OUTLOOK.COM> In-Reply-To: <CANCZdfr6XMAtq-XDeCwnHs%2BGh=tmRR36C_AcXJwCfYXh0DH_xg@mail.gmail.com> 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> <CANCZdfr6XMAtq-XDeCwnHs%2BGh=tmRR36C_AcXJwCfYXh0DH_xg@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
Hi Warner / WBR / Oleksandr
Im not sure if that’s the case with this uhid.ko, but you guys remember I had a priority issue with this module and Vladimir made me a patch to fix the attach priority?
Warner, was it fixed since then?
Let me show the patch I use to this very day important line is this, the patch might be wrong , because im still on 14-current
+// return (BUS_PROBE_GENERIC + 1);
return (BUS_PROBE_DEFAULT + 1);
diff --git a/sys/dev/usb/input/usbhid.c b/sys/dev/usb/input/usbhid.c
index 174e1c28ae96..7b19d713c943 100644
--- a/sys/dev/usb/input/usbhid.c
+++ b/sys/dev/usb/input/usbhid.c
@@ -802,6 +802,7 @@ usbhid_probe(device_t dev)
if (hid_test_quirk(&sc->sc_hw, HQ_HID_IGNORE))
return (ENXIO);
+// return (BUS_PROBE_GENERIC + 1);
return (BUS_PROBE_DEFAULT + 1);
}
Thanks
--tzk
De: owner-freebsd-current@FreeBSD.org <owner-freebsd-current@FreeBSD.org> Em nome de Warner Losh
Enviada em: sábado, 18 de maio de 2024 12:33
Para: Oleksandr Kryvulia <shuriku@shurik.kiev.ua>
Cc: FreeBSD Current <freebsd-current@freebsd.org>
Assunto: Re: usb mouse not work on boot
On Sat, May 18, 2024, 9:22 AM Oleksandr Kryvulia <shuriku@shurik.kiev.ua<mailto: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<mailto: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><mailto:shuriku@shurik.kiev.ua> writes:
Gary Jennejohn <garyj@gmx.de><mailto: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 --]
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"Pré-formatação HTML Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.Pr-formataoHTMLChar
{mso-style-name:"Pré-formatação HTML Char";
mso-style-priority:99;
mso-style-link:"Pré-formatação HTML";
font-family:"Consolas",serif;
mso-ligatures:none;
mso-fareast-language:PT-BR;}
span.EstiloDeEmail20
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="PT-BR" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">Hi Warner / WBR / Oleksandr<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">Im not sure if that’s the case with this
</span><span lang="EN-US" style="font-family:"Courier New";color:black;background:white">uhid.ko, but you guys remember I had a priority issue with this module and Vladimir made me a patch to fix the attach priority?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white">Warner, was it fixed since then?
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white">Let me show the patch I use to this very day important line is this, the patch might be wrong , because im still on 14-current<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white">+// return (BUS_PROBE_GENERIC + 1);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"> return (BUS_PROBE_DEFAULT + 1);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"><o:p> </o:p></span></p>
<div style="mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white">diff --git a/sys/dev/usb/input/usbhid.c b/sys/dev/usb/input/usbhid.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white">index 174e1c28ae96..7b19d713c943 100644<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white">--- a/sys/dev/usb/input/usbhid.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white">+++ b/sys/dev/usb/input/usbhid.c<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white">@@ -802,6 +802,7 @@ usbhid_probe(device_t dev)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"> if (hid_test_quirk(&sc->sc_hw, HQ_HID_IGNORE))<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"> return (ENXIO);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white">+// return (BUS_PROBE_GENERIC + 1);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white"> return (BUS_PROBE_DEFAULT + 1);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New";color:black;background:white">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">--tzk<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> owner-freebsd-current@FreeBSD.org <owner-freebsd-current@FreeBSD.org>
<b>Em nome de </b>Warner Losh<br>
<b>Enviada em:</b> sábado, 18 de maio de 2024 12:33<br>
<b>Para:</b> Oleksandr Kryvulia <shuriku@shurik.kiev.ua><br>
<b>Cc:</b> FreeBSD Current <freebsd-current@freebsd.org><br>
<b>Assunto:</b> Re: usb mouse not work on boot<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Sat, May 18, 2024, 9:22<span style="font-family:"Arial",sans-serif"> </span>AM Oleksandr Kryvulia <<a href="mailto:shuriku@shurik.kiev.ua">shuriku@shurik.kiev.ua</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">18.05.24 16:06, Warner Losh:<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Sat, May 18, 2024, 6:51<span style="font-family:"Arial",sans-serif"> </span>AM Oleksandr Kryvulia <<a href="mailto:shuriku@shurik.kiev.ua" target="_blank">shuriku@shurik.kiev.ua</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">18.05.24 12:59, Oleksandr Kryvulia:<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">18.05.24 12:55, Dag-Erling Smørgrav:<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Oleksandr Kryvulia <a href="mailto:shuriku@shurik.kiev.ua" target="_blank"><shuriku@shurik.kiev.ua></a> writes:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span style="color:#007CFF">Gary Jennejohn <a href="mailto:garyj@gmx.de" target="_blank"><garyj@gmx.de></a> writes:<o:p></o:p></span></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><span style="color:#007CFF">Try adding uhid_load="YES" to your /boot/loader.conf. With that<o:p></o:p></span></pre>
<pre><span style="color:#007CFF">added the module should be automatically loaded during the kernel<o:p></o:p></span></pre>
<pre><span style="color:#007CFF">boot.<o:p></o:p></span></pre>
</blockquote>
<pre><span style="color:#007CFF">As workaround I already have kld_list+="uhid" in /etc/rc.conf.<o:p></o:p></span></pre>
</blockquote>
<pre>I hope you don't mean that literally, because /etc/rc.conf is a shell<o:p></o:p></pre>
<pre>script and += is not valid shell syntax. On the other hand, something<o:p></o:p></pre>
<pre>like<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>kld_list="${kld_list} uhid"<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">Yes, you are right. I mean<br>
<span style="font-family:"Courier New";color:black;background:white">sysrc kld_list+="uhid"</span><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><br>
One more correction. Via kld_list I need load ums(4), loading only uhid(4) does not solve a problem.<o:p></o:p></p>
</div>
</blockquote>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Just set hw.bus.devctl_nomatch_enabled=1 in /boot/loader.conf and reboot. Or update to the change I'm about to make.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</blockquote>
<p class="MsoNormal"><br>
<span lang="EN">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.</span><o:p></o:p></p>
</div>
</blockquote>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Warner <o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CPWP152MB79211F6DC95232F99BC66D26CBEF2>
