From nobody Sat May 18 15:33:24 2024 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VhSXg6SNTz5L1nC for ; Sat, 18 May 2024 15:33:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VhSXg4Ztnz46DN for ; Sat, 18 May 2024 15:33:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-52327368e59so3227883e87.1 for ; Sat, 18 May 2024 08:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1716046417; x=1716651217; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=19HpvNlJjZ4YP9MnED6UZ4Zercmn5ysyoF//abd6ILs=; b=QKASBaLpXO8TdKuP3+2Feu7zqq2RncBFz848fZ2VuRtgfaLGi35ZnZO5jPHK3sUKdO G5bk7Hy27zNj4sX6qFCmDhBNCwIDwVc6Q5ixHEf5czPJyPDGzWG6jhmDX1G8cEPlg9HC BwpIbW938Zuruo8Xy8RRs8BDfIO5x3simm3QQriPv+GmieMjMsrcbIZgqLteLok8gVAd U3cRIsnSTjdap4DHlhXvS5EVLBJUmdg8oejKRrtJQhKUspP5/IUUsyH1ErVJPNKOys88 HkjLwHK15vKBkpdm7Q2eit5A8/J+To2wBbdNJcC35hZgDlToMzgKikkm8k+3/em9s1eQ zFsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716046417; x=1716651217; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=19HpvNlJjZ4YP9MnED6UZ4Zercmn5ysyoF//abd6ILs=; b=AisEAvuT93aRq9VCiCwtTNfGf66PZdnMcPzE9FCcbLvCZYPD+tNuAhDz4JI9GwIEmj pl0itEBdUtcs75jlDrTC1MUs3bi6QXhFL3BoUh2PZk2xVck1MOrKhpiCH0ly5X3C53Fr tox7cEQSFcLskoW3vxyvaHe3gZ3Dp1OXrvEzQ9mXnplwzTdD3WKgsmU1e5oyNyoehSt5 SPtI0KhNGvpveZY6PRm61NoeQ5cNtgYMBOLEUS5JIcIH7QDgCnB/D2/6XtKxHFPTzFHv 6wnSCmA59KXQ2AOK4eWskV6vpfoKKVisFJ1SfqAQak0QjHcniZfU7vM04AvNqQoCIv/j a5OA== X-Gm-Message-State: AOJu0Ywu+T23Ez9eHAlTvtPQtSxxaM50cEtF2UxfrzOrQAWmENeXZg7+ ADgM8HEGM2kFEUi15ltVkvN1o7XECe/tmQti7wUpBdNCgJK6B1+bZGLx+P7bpxhDXXnZhzbes80 2I26QYaNBk2ofe3fRa6ButuJxCxBMSBhMlsG3vzXSjTvMHI2u X-Google-Smtp-Source: AGHT+IE8V399PE+bqi2RnxnLHw86b20y4wwJLpRJA1tzB78HHigHBj4Ym7xbPgYKTwEvI/PMbE/4JrpIQCGKWRXdS9M= X-Received: by 2002:a05:6512:3a8a:b0:51f:4c53:8e4c with SMTP id 2adb3069b0e04-5220fd785f3mr20611383e87.33.1716046416718; Sat, 18 May 2024 08:33:36 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: <20240518092649.6430ad53@ernst.home> <86ttivwikf.fsf@ltc.des.dev> <34a397ef-ca2d-4e04-9066-3cf8a0c48616@shurik.kiev.ua> In-Reply-To: From: Warner Losh Date: Sat, 18 May 2024 09:33:24 -0600 Message-ID: Subject: Re: usb mouse not work on boot To: Oleksandr Kryvulia Cc: FreeBSD Current Content-Type: multipart/alternative; boundary="000000000000164d230618bc3116" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4VhSXg4Ztnz46DN --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 wrote: > 18.05.24 16:06, Warner Losh: > > > > On Sat, May 18, 2024, 6:51=E2=80=AFAM Oleksandr Kryvulia > wrote: > >> 18.05.24 12:59, Oleksandr Kryvulia: >> >> 18.05.24 12:55, Dag-Erling Sm=C3=B8rgrav: >> >> Oleksandr Kryvulia wri= tes: >> >> Gary Jennejohn 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


On Sat, May 18, 2024, 9:22=E2=80=AFAM Oleksandr Kryvul= ia <shuriku@shurik.kiev.ua= > wrote:
=20 =20 =20
18.05.24 16:06, Warner Losh:
=20


On Sat, May 18, 2024, 6:51=E2=80=AFAM Oleksandr Kryvulia <shuriku@shurik.k= iev.ua> wrote:
18.05.24 12:59, Oleksandr Kryvulia:
18.05.24 12:55, Dag-Erling Sm=C3=B8rgrav:
Oleksandr Kryvulia <shuri=
ku@shurik.kiev.ua> writes:
Gary Jennejohn=
 <garyj@gmx.de> writes:
Try adding uhi=
d_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 und= o 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 reboot. Or update to the change I'm about to make.


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't work in my case.
<= /blockquote>

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. 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 dir=3D"auto">Warner=C2=A0
--000000000000164d230618bc3116--