RES: RES: RES: usb mouse not work on boot

2024-05-20 Thread Ivan Quitschal


> -Mensagem original-
> De: owner-freebsd-curr...@freebsd.org  curr...@freebsd.org> Em nome de Dag-Erling Smørgrav
> Enviada em: segunda-feira, 20 de maio de 2024 06:01
> Para: Ivan Quitschal 
> Cc: Vladimir Kondratyev ; Warner Losh
> ; Oleksandr Kryvulia ; FreeBSD
> Current 
> Assunto: Re: RES: RES: usb mouse not work on boot
> 
> Ivan Quitschal  writes:
> > > Ivan Quitschal  writes:
> > > > 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_hw, HQ_HID_IGNORE))
> > > > return (ENXIO);
> > > > +// return (BUS_PROBE_GENERIC + 1);
> > > > return (BUS_PROBE_DEFAULT + 1);  }
> > > You realize this diff does nothing at all, right?
> > Yeap, i also said it worked in 14-current old code only ,and has more
> > than 2 years already
> 
> No, I mean all this does is add a comment.  It has no effect on the code.
> 
> DES
> --
> Dag-Erling Smørgrav - d...@freebsd.org


Oh ok,, sorry

But actually it did change one return for another 

Usbhid.ko used to return this 
return (BUS_PROBE_GENERIC + 1);

and ums.ko used to take place instead , messing up our multimedia kbds and all
Was a priority issue when it shouldn’t matter

Then Vladmir changed to this
return (BUS_PROBE_DEFAULT + 1);  

and everything went to "voil" 


sorry for the miss communication
regards

tzk


Re: RES: RES: usb mouse not work on boot

2024-05-20 Thread Dag-Erling Smørgrav
Ivan Quitschal  writes:
> > Ivan Quitschal  writes:
> > > 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_hw, HQ_HID_IGNORE))
> > > return (ENXIO);
> > > +// return (BUS_PROBE_GENERIC + 1);
> > > return (BUS_PROBE_DEFAULT + 1);
> > >  }
> > You realize this diff does nothing at all, right?
> Yeap, i also said it worked in 14-current old code only ,and has more
> than 2 years already

No, I mean all this does is add a comment.  It has no effect on the
code.

DES
-- 
Dag-Erling Smørgrav - d...@freebsd.org



RES: RES: usb mouse not work on boot

2024-05-19 Thread Ivan Quitschal
Hans participated on that, and in that one too,  he was the last person I spoke 
on this forum, then I found out the tragic news, then I lost some interest, not 
about bsd, bot about those things I remember he was directly involved , like 
that one for example .. 

but yes I know its not a proper patch , he told me that too .. with all the 
9 and such ...

last usb thing I spoke about on this list
https://lists.freebsd.org/archives/freebsd-current/2022-September/002580.html
so please 
not necessary


Thanks
tzk


> -Mensagem original-
> De: owner-freebsd-curr...@freebsd.org  curr...@freebsd.org> Em nome de Ivan Quitschal
> Enviada em: domingo, 19 de maio de 2024 19:49
> Para: Dag-Erling Smørgrav 
> Cc: Vladimir Kondratyev ; Warner Losh
> ; Oleksandr Kryvulia ; FreeBSD
> Current 
> Assunto: RES: RES: usb mouse not work on boot
> 
> Yeap, i also said it worked in 14-current old code only ,and has more than  2 
> years
> already
> 
> Only point was whether freebsd had
> this
> return (BUS_PROBE_DEFAULT + 1); }
> or that
> return (BUS_PROBE_GENERIC + 1);
> 
> glad we have the first one , aka the right return
> 
> We have an entire email chain about this day back in the day august 2022 don’t
> remember correctly
> 
> 
> 
> > -Mensagem original-
> > De: Dag-Erling Smørgrav  Enviada em: domingo, 19 de
> > maio de 2024 08:04
> > Para: Ivan Quitschal 
> > Cc: Vladimir Kondratyev ; Warner Losh
> > ; Oleksandr Kryvulia ; FreeBSD
> > Current 
> > Assunto: Re: RES: usb mouse not work on boot
> >
> > Ivan Quitschal  writes:
> > > 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_hw, HQ_HID_IGNORE))
> > > return (ENXIO);
> > > +// return (BUS_PROBE_GENERIC + 1);
> > > return (BUS_PROBE_DEFAULT + 1); }
> >
> > You realize this diff does nothing at all, right?
> >
> > DES
> > --
> > Dag-Erling Smørgrav - d...@freebsd.org


RES: RES: usb mouse not work on boot

2024-05-19 Thread Ivan Quitschal
Yeap, i also said it worked in 14-current old code only ,and has more than  2 
years already 

Only point was whether freebsd had 
this
return (BUS_PROBE_DEFAULT + 1); }
or that
return (BUS_PROBE_GENERIC + 1);

glad we have the first one , aka the right return 

We have an entire email chain about this day back in the day august 2022 don’t 
remember correctly



> -Mensagem original-
> De: Dag-Erling Smørgrav 
> Enviada em: domingo, 19 de maio de 2024 08:04
> Para: Ivan Quitschal 
> Cc: Vladimir Kondratyev ; Warner Losh
> ; Oleksandr Kryvulia ; FreeBSD
> Current 
> Assunto: Re: RES: usb mouse not work on boot
> 
> Ivan Quitschal  writes:
> > 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_hw, HQ_HID_IGNORE))
> > return (ENXIO);
> > +// return (BUS_PROBE_GENERIC + 1);
> > return (BUS_PROBE_DEFAULT + 1); }
> 
> You realize this diff does nothing at all, right?
> 
> DES
> --
> Dag-Erling Smørgrav - d...@freebsd.org


Re: RES: usb mouse not work on boot

2024-05-19 Thread Dag-Erling Smørgrav
Ivan Quitschal  writes:
> 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_hw, HQ_HID_IGNORE))
> return (ENXIO);
> +// return (BUS_PROBE_GENERIC + 1);
> return (BUS_PROBE_DEFAULT + 1);
> }

You realize this diff does nothing at all, right?

DES
-- 
Dag-Erling Smørgrav - d...@freebsd.org



Re: RES: RES: usb mouse not work on boot

2024-05-18 Thread Oleksandr Kryvulia

18.05.24 21:39, Ivan Quitschal:


Not sure, im on 14-current because of my synergy  insists on crashing  
after version synergy-1.14.0.4,3


But that’s pretty simple to check

Just do a
# grep ‘return (BUS_PROBE_’ /user/src/sys/dev/usb/input/usbhidc in 
your own kernel source tree to see what line is there




That's from my source tree:

root@thinkpad:/usr/src # grep 'return (BUS_PROBE_' 
/usr/src/sys/dev/usb/input/usbhid.c

   return (BUS_PROBE_DEFAULT + 1);

RES: RES: usb mouse not work on boot

2024-05-18 Thread Ivan Quitschal
Not sure, im on 14-current because of my synergy  insists on crashing  after 
version synergy-1.14.0.4,3
But that's pretty simple to check

Just do a
# grep 'return (BUS_PROBE_' /user/src/sys/dev/usb/input/usbhid.c in your own 
kernel source tree to see what line is there

Thanks

Ivan


De: owner-freebsd-curr...@freebsd.org  Em 
nome de Oleksandr Kryvulia
Enviada em: sábado, 18 de maio de 2024 15:29
Para: freebsd-current@freebsd.org
Assunto: Re: RES: usb mouse not work on boot

18.05.24 19:29, Ivan Quitschal:

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_hw, HQ_HID_IGNORE))
return (ENXIO);
+// return (BUS_PROBE_GENERIC + 1);
return (BUS_PROBE_DEFAULT + 1);
}


If I correctly understand this patch alredy in main with 
975407b1d8dcceac2b54e2c4df96aadec7dc4c3a



Re: RES: usb mouse not work on boot

2024-05-18 Thread Oleksandr Kryvulia

18.05.24 19:29, Ivan Quitschal:


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_hw, HQ_HID_IGNORE))

    return (ENXIO);

+// return (BUS_PROBE_GENERIC + 1);

    return (BUS_PROBE_DEFAULT + 1);

}



If I correctly understand this patch alredy in main with 
975407b1d8dcceac2b54e2c4df96aadec7dc4c3a


RES: usb mouse not work on boot

2024-05-18 Thread Ivan Quitschal
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_hw, HQ_HID_IGNORE))
return (ENXIO);
+// return (BUS_PROBE_GENERIC + 1);
return (BUS_PROBE_DEFAULT + 1);
}

Thanks

--tzk

De: owner-freebsd-curr...@freebsd.org  Em 
nome de Warner Losh
Enviada em: sábado, 18 de maio de 2024 12:33
Para: Oleksandr Kryvulia 
Cc: FreeBSD Current 
Assunto: Re: usb mouse not work on boot


On Sat, May 18, 2024, 9:22 AM Oleksandr Kryvulia 
mailto:shur...@shurik.kiev.ua>> wrote:
18.05.24 16:06, Warner Losh:


On Sat, May 18, 2024, 6:51 AM Oleksandr Kryvulia 
mailto:shur...@shurik.kiev.ua>> wrote:
18.05.24 12:59, Oleksandr Kryvulia:

18.05.24 12:55, Dag-Erling Smørgrav:


Oleksandr Kryvulia  
writes:

Gary Jennejohn  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