Skip to content

Commit

Permalink
Bluetooth: hci_bcm: do not mark valid bd_addr as invalid
Browse files Browse the repository at this point in the history
A recent commit restored the original (and still documented) semantics
for the HCI_QUIRK_USE_BDADDR_PROPERTY quirk so that the device address
is considered invalid unless an address is provided by firmware.

This specifically means that this flag must only be set for devices with
invalid addresses, but the Broadcom driver has so far been setting this
flag unconditionally.

Fortunately the driver already checks for invalid addresses during setup
and sets the HCI_QUIRK_INVALID_BDADDR flag. Use this flag to indicate
when the address can be overridden by firmware (long term, this should
probably just always be allowed).

Fixes: 6945795 ("Bluetooth: fix use-bdaddr-property quirk")
Reported-by: Marek Szyprowski <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]
Signed-off-by: Johan Hovold <[email protected]>
Tested-by: Marek Szyprowski <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
jhovold authored and kuba-moo committed Jun 29, 2023
1 parent 1728137 commit 56b7f32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/bluetooth/hci_bcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,8 @@ static int bcm_setup(struct hci_uart *hu)
* Allow the bootloader to set a valid address through the
* device tree.
*/
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hu->hdev->quirks);
if (test_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks))
set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hu->hdev->quirks);

if (!bcm_request_irq(bcm))
err = bcm_setup_sleep(hu);
Expand Down

0 comments on commit 56b7f32

Please sign in to comment.