[Bug 282920] usbhid: qemu Keyboard doesn't work with qemu-xhci

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 22 Nov 2024 13:48:00 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282920

            Bug ID: 282920
           Summary: usbhid: qemu Keyboard doesn't work with qemu-xhci
           Product: Base System
           Version: 15.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: manu@freebsd.org

It seems that usbhid doesn't like qemu keyboard when using qemu-xhci (it works
with usb-ehci).
How to reproduce :
Start a VM with 
qemu-system-x86_64 -hda diskimage -device qemu-xhci -device usb-kdb -serial
stdio
The keyboard is unresponsive.
diskimage is simply FreeBSD-15.0-CURRENT-amd64-ufs.raw with usbhid_enable set
to 1 in the kernel (It's probably the same with original image with the tunable
set, will test later).
Recompiling a kernel with options USB_DEBUG and setting it to 15 gives :

ugen0.2: <QEMU QEMU USB Keyboard> at usbus0
usbhid_probe: 
usbhid_probe: 
usbhid0 on uhub0
usbhid_attach: sc=0xfffff80003412800
usbhid0: <QEMU QEMU USB Keyboard, class 0/0, rev 2.00/0.00, addr 1> on usbus0
hidbus0: <HID bus> on usbhid0
hkbd0: <QEMU QEMU USB Keyboard> on hidbus0
usbhid_ctrl_callback: error=USB_ERR_SHORT_XFER
usbhid_sync_xfer: USB IO error:5
usbhid_ctrl_callback: error=USB_ERR_SHORT_XFER
usbhid_sync_xfer: USB IO error:5
kbd2 at hkbd0
Dual Console: Video Primary, Serial Secondary

For each keypress on the keyboard I also have :

usbhid_intr_in_callback: transferred!
usbhid_intr_in_callback: transferred!

Let me know if anything else is needed

-- 
You are receiving this mail because:
You are the assignee for the bug.