Bluetooth RPA timeout related intialisation failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

After upgrading to a 5.10-rc3 kernel (from a 5.4 kernel), I have found
bluetooth was not working on our board.

/sys/class/bluetooth/hci0 existed but the userland tools weren't able
to find the HCI, presumably because it had the HCI_SETUP bit still set
due to the error occuring, described immediately below.

I have traced that to an error being reported by the HCI hardware with
bluetooth code code of 0x1a (translated to errno -EPROTONOSUPPORT)
during a call to __hci_req_sync() with function hci_init3_req() in
__hci_init().

In the hci_init3_req() following commit b2cc23398e81 (Bluetooth:
Enable RPA Timeout), the code checks that the locally supported
command byte 35 has bit 6 set (mask of 0x40) before sending
HCI_OP_LE_SET_RPA_TIMEOUT.

Reverting this commit made bluetooth work again.

I tried looking at the Bluetooth spec (revision date 2019-12-31), and
on page 1921 it states that byte 35, bit 6 is indicating support for
HCI_LE_Set_PHY. On that same byte, bit 2 (so mask 0x04, indicates
support for HCI_LE_Set_Resolvable_Private_Address_Timeout, which seems
to be the appropriate bit for HCI_OP_LE_SET_RPA_TIMEOUT.

My HCI reports 0xf8 at byte 35 of the hdev->commands array, meaning
that HCI_LE_Set_PHY is set, but not
HCI_LE_Set_Resolvable_Private_Address_Timeout.

Changing the mask from 0x40 to 0x04 made bluetooth work again as well.

Am I correct in thinking that the commit mentioned above had the mask
wrong?

I can send a proper patch if my theory ends up being proven correct.

Best regards,

-- 
Nicolas Schichan



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux