If I boot FreeBSD on a framework laptop, then do a soft reboot, mountroot pauses for a couple of minutes until USB enumeration times out. During the first boot, ng_ubt is autoloaded and I see some errors: ubt_ctrl_write_callback:909: control transfer failed: USB_ERR_TIMEOUT ng_hci_process_command_timeout: ubt0hci - unable to complete HCI command OGF=0x3, OCF=0x3. Timeout On a subsequent boot, I get a hang, and the bluetooth device doesn't appear to get enumerated. The next boot after that is fine, but then the BT device shows up again and the next boot after _that_ hangs. So I guess we're not properly detaching the device. I believe this is also causing problems with S3 resume.
Setting devmatch_blocklist="ng_ubt" in rc.conf works around the problem. This also lets the laptop resume reliably. I'll try to dig into it further.
ng_ubt_intel is missing the device ID for this particular adapter. Adding it "fixes" the problem, but only because ng_ubt_intel then fails to probe the firmware version. It seems that newer devices return firmware version info in a TLV array, and ng_ubt_intel (and iwmbtfw) doesn't know about it. Dumping the returned TLV: 0000 00 10 04 10 04 40 00 11 04 10 04 40 00 12 04 00 |.....@.....@....| 0010 37 17 00 15 02 13 04 16 02 00 00 17 02 87 80 18 |7...............| 0020 02 32 00 1c 01 01 1d 02 28 13 1e 01 01 1f 04 26 |.2......(......&| 0030 00 00 00 27 01 00 28 01 01 29 01 00 2a 01 01 2b |...'..(..)..*..+| 0040 01 01 2c 01 00 2d 03 01 0a 0e 2e 01 00 2f 01 01 |..,..-......./..| 0050 30 06 20 6f 9c 09 7b f4 31 01 00 00 00 00 |0. o..{.1..... | Image type TLV: 1c 01 01, and apparently a value of 0x01 there means that the device is in boot loader mode. I'm not sure how much work it is to extend ng_ubt_intel to support this device. I'll try adding TLV parsing support and see how it goes. I wonder if ng_ubt_intel should match on all Intel bluetooth devices, otherwise we'll keep having to diagnose the same problem over and over again.
According to Linux driver sources, this device have different firmware downloading scheme called BTUSB_INTEL_NEWGEN in pre v5.15 btusb.c which we do not support: https://elixir.bootlin.com/linux/v5.14.21/source/drivers/bluetooth/btusb.c#L371
Also experiencing this problem. I worked around it by adding hw.usb.no_boot_wait=1 to /boot/loader.conf.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=b25ba58adc04ca475df1e8125d2a16a07d68b49d commit b25ba58adc04ca475df1e8125d2a16a07d68b49d Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-12-05 15:45:12 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-12-05 15:51:46 +0000 ng_ubt: Avoid attaching to several newer Intel controllers Like other Intel controllers, these require firmware to be loaded, and generic ng_ubt attach causes them to lock up until a power cycle. However, their firmware interface for querying version info and loading operational firmware is different from that implemented by ng_ubt_intel and iwmbtfw, so they are not usable yet. Just disable attach for now to avoid stalls during USB device enumeration. PR: 260161 Sponsored by: The FreeBSD Foundation MFC after: 1 week sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 7 +++++++ 1 file changed, 7 insertions(+)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d74c589ead91118a46370edc30f10e7d65ed2636 commit d74c589ead91118a46370edc30f10e7d65ed2636 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-12-05 15:45:12 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-12-13 13:26:19 +0000 ng_ubt: Avoid attaching to several newer Intel controllers Like other Intel controllers, these require firmware to be loaded, and generic ng_ubt attach causes them to lock up until a power cycle. However, their firmware interface for querying version info and loading operational firmware is different from that implemented by ng_ubt_intel and iwmbtfw, so they are not usable yet. Just disable attach for now to avoid stalls during USB device enumeration. PR: 260161 Sponsored by: The FreeBSD Foundation (cherry picked from commit b25ba58adc04ca475df1e8125d2a16a07d68b49d) sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 7 +++++++ 1 file changed, 7 insertions(+)
Work to support AX210 is in https://reviews.freebsd.org/D44861