Intel bluetooth adapter doesn't attach to fedora 39 qubes

It looks like my bluetooth adapter is disconnected before the firmware gets a chance to download. Dmesg:

[ 2057.053926] vhci_hcd vhci_hcd.0: pdev(0) rhport(1) sockfd(0)
[ 2057.053944] vhci_hcd vhci_hcd.0: devid(262156) speed(2) speed_str(full-speed)
[ 2057.054033] vhci_hcd vhci_hcd.0: Device attached
[ 2057.224024] vhci_hcd: vhci_device speed not set
[ 2057.276057] usb 2-2: new full-speed USB device number 9 using vhci_hcd
[ 2057.338081] vhci_hcd: vhci_device speed not set
[ 2057.390261] usb 2-2: SetAddress Request (9) to port 1
[ 2057.416459] usb 2-2: New USB device found, idVendor=8087, idProduct=0026, bcdDevice= 0.02
[ 2057.416529] usb 2-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2057.435539] Bluetooth: hci0: Firmware timestamp 2024.8 buildtype 1 build 79483
[ 2057.487555] Bluetooth: hci0: Found device firmware: intel/ibt-0040-4150.sfi
[ 2057.487584] Bluetooth: hci0: Boot Address: 0x100800
[ 2057.487594] Bluetooth: hci0: Firmware Version: 46-14.24
[ 2057.493734] vhci_hcd: connection closed
[ 2057.493795] vhci_hcd: stop threads
[ 2057.493815] vhci_hcd: release socket
[ 2057.493845] vhci_hcd: disconnect device
[ 2057.494049] usb 2-2: USB disconnect, device number 9
[ 2057.494122] Bluetooth: hci0: FW download error recovery failed (-19)
[ 2057.494209] Bluetooth: hci0: sending frame failed (-19)
[ 2057.494222] Bluetooth: hci0: Reading supported features failed (-19)
[ 2057.494235] Bluetooth: hci0: Error reading debug features
[ 2057.494252] Bluetooth: hci0: sending frame failed (-19)
[ 2057.494264] Bluetooth: hci0: Failed to read MSFT supported features (-19)

It works with older fedoras. It works with other devices. All use the same qubes kernel 6.6.29-1.qubes.fc37.x86_64.

Run this command in sys-usb terminal:

sudo journalctl -f -n0

Try to attache your USB Bluetooth controller to some fedora 39 based qube.
Check the sys-usb log to see if there are any errors related to usbip.

Also try to use fedora 39 template for both sys-usb and qube to which you’re attaching the device, Maybe it’s some issue with debian template for sys-usb and fedora template for qube to which you’re attaching the device.

Ok, I ran the command and this is what I got related to the usbip:

Immediately after systemd Stopped target bluetooth.target - Bluetooth.

May 29 12:42:30 sys-usb kernel: usbip-host 4-10: endpoint 0 is stalled
May 29 12:42:30 sys-usb kernel: usbip-host 4-10: endpoint 0 is stalled
May 29 12:42:30 sys-usb kernel: usbip-host 4-10: endpoint 0 is stalled
May 29 12:42:30 sys-usb kernel: usbip-host 4-10: USB disconnect, device number 6
May 29 12:42:30 sys-usb kernel: usbip-host 4-10: device removed?
May 29 12:42:30 sys-usb kernel: usbip-host 4-10: device removed?
May 29 12:42:30 sys-usb kernel: usbip-host 4-10: submit_urb error, -19
May 29 12:42:30 sys-usb kernel: usbip-host 4-10: device removed?
May 29 12:42:30 sys-usb kernel: usbip-host 4-10: lock for reset
May 29 12:42:31 sys-usb kernel: usb 4-10: new full-speed USB device number 7 using xhci_hcd
May 29 12:42:31 sys-usb kernel: usb 4-10: New USB device found, idVendor=8087, idProduct=0026, bcdDevice= 0.02
May 29 12:42:31 sys-usb kernel: usb 4-10: New USB device strings: Mfr=0, Product=0, SerialNumber=0
May 29 12:42:31 sys-usb kernel: Bluetooth: hci0: Device revision is 2
May 29 12:42:31 sys-usb kernel: Bluetooth: hci0: Secure boot is enabled
May 29 12:42:31 sys-usb kernel: Bluetooth: hci0: OTP lock is enabled
May 29 12:42:31 sys-usb kernel: Bluetooth: hci0: API lock is enabled
May 29 12:42:31 sys-usb kernel: Bluetooth: hci0: Debug lock is disabled
May 29 12:42:31 sys-usb kernel: Bluetooth: hci0: Minimum firmware build 1 week 10 2014
May 29 12:42:31 sys-usb kernel: Bluetooth: hci0: Bootloader timestamp 2019.40 buildtype 1 build 38
May 29 12:42:31 sys-usb kernel: Bluetooth: hci0: Found device firmware: intel/ibt-0040-4150.sfi
May 29 12:42:31 sys-usb kernel: Bluetooth: hci0: Boot Address: 0x100800
May 29 12:42:31 sys-usb kernel: Bluetooth: hci0: Firmware Version: 123-8.24
May 29 12:42:31 sys-usb systemd[1154]: Reached target bluetooth.target - Bluetooth.
May 29 12:42:31 sys-usb systemd[1]: Reached target bluetooth.target - Bluetooth Support.
May 29 12:42:31 sys-usb systemd[819]: Reached target bluetooth.target - Bluetooth.
May 29 12:42:31 sys-usb qubes.USB+4-10-disp4236[1619]: /usr/lib/qubes/usb-export: line 148: /sys/bus/usb/devices/4-10/usbip_status: No such file or directory
May 29 12:42:31 sys-usb qubes.USB+4-10-disp4236[1619]: Failed to remove qubesdb-write
May 29 12:42:31 sys-usb qubes.USB+4-10-disp4236[1619]: Failed to remove

It is also weird that it fails to detect that the device was successfully removed. Once while gathering these logs my sys-usb shut itself down upon trying to attach the device.

I noticed that it does not work with debian qubes, thanks to you.

My template for sys-usb is fedora 38. I am off to prepare the new template.

Did you try to use debian template for both qubes?
My guess is that there could be some incompatibility due to different usbip or some other package version and the package with newer version in fedora-39 template is having some issues with older package version in debian or fedora-38 template.

I tried fedora 39 for both sys-usb and a target system. It doesn’t work. Will try debian next.

I ran some tests. Looks like your guess is right, or something similar prevents it from working properly.

sys-usb target system result
fedora 38 fedora 38 :heavy_check_mark:
fedora 38 fedora 39 :x:
fedora 38 debian 12 :x:
fedora 39 fedora 38 :x:
fedora 39 fedora 39 :heavy_check_mark:
fedora 39 debian 12 :x:
debian 12 fedora 38 :x:
debian 12 fedora 39 :x:
debian 12 debian 12 :heavy_check_mark:

It seems like a possible solution may be to try and install the same versions of the packages related to the bluetooth adapter on all systems, starting from the usbip. But shouldn’t it work with different packages out of the box? Is there a way to trace what makes usbip-host log the submit_urb error, -19?

I think you should report this bug on github so devs can look into this: