Bug 279953

Summary: If both usbhid entries used in /boot/loader.conf, keyboard gets frozen when booted in single user mode
Product: Base System Reporter: Yusuf Yaman <nxjoseph>
Component: usbAssignee: freebsd-usb (Nobody) <usb>
Status: Closed Works As Intended    
Severity: Affects Only Me CC: imp, manu, mohammad, nxjoseph
Priority: ---    
Version: 14.1-RELEASE   
Hardware: Any   
OS: Any   

Description Yusuf Yaman 2024-06-24 17:32:02 UTC
Hi. I had these entries in /boot/loader.conf:

usbhid_load="YES"
hw.usb.usbhid.enable="1"

Using both of them at the same time causes keyboard to froze when booted in single-user mode. If you only use hw.usb.usbhid.enable="1", keyboard's multimedia keys keep working and keyboard doesn't freeze. I think that usbhid_load is totally useless here and causes issues.
Comment 1 Yusuf Yaman 2024-06-24 17:55:06 UTC
I wanted to test the issue more and used hw.usb.usbhid.enable="1" variable in /etc/sysctl.conf instead of in /boot/loader.conf and freezing issue didn't occur.

Now my /boot/loader.conf has this:

usbhid_load="YES"

and my /etc/sysctl.conf has this:

hw.usb.usbhid.enable=1


usbhid's man page says that the hw.usb.usbhid.enable variable can be used either in /boot/loader.conf or in /etc/sysctl.conf but using it in /boot/loader.conf causes freezing issue.
Comment 2 Warner Losh freebsd_committer freebsd_triage 2024-06-28 17:59:07 UTC
Cc'd Manu to look at. He can rope more people in.
Comment 3 Emmanuel Vadot freebsd_committer freebsd_triage 2024-07-01 07:55:40 UTC
This is expected.

With usbhid loaded and the sysctl set to 1 the ukbd(4) driver will have no chance to attach and GENERIC doesn't have hkbd(4).
Which is one of the reason I did https://reviews.freebsd.org/D45658

Until then you can add hkbd_load="YES" to loader.conf to "fix" this issue.
Comment 4 Yusuf Yaman 2024-07-01 10:31:21 UTC
> Until then you can add hkbd_load="YES" to loader.conf to "fix" this issue.

Thanks, I removed sysctl variable and used both entries about usbhid in /boot/loader.conf and added hkbd_load="YES" to /boot/loader.conf and it didn't freeze.

Have a good one.