linux-stable/drivers/bluetooth
Johan Hovold 77f45cca8b Bluetooth: qca: fix device-address endianness
The WCN6855 firmware on the Lenovo ThinkPad X13s expects the Bluetooth
device address in big-endian order when setting it using the
EDL_WRITE_BD_ADDR_OPCODE command.

Presumably, this is the case for all non-ROME devices which all use the
EDL_WRITE_BD_ADDR_OPCODE command for this (unlike the ROME devices which
use a different command and expect the address in little-endian order).

Reverse the little-endian address before setting it to make sure that
the address can be configured using tools like btmgmt or using the
'local-bd-address' devicetree property.

Note that this can potentially break systems with boot firmware which
has started relying on the broken behaviour and is incorrectly passing
the address via devicetree in big-endian order.

The only device affected by this should be the WCN3991 used in some
Chromebooks. As ChromeOS updates the kernel and devicetree in lockstep,
the new 'qcom,local-bd-address-broken' property can be used to determine
if the firmware is buggy so that the underlying driver bug can be fixed
without breaking backwards compatibility.

Set the HCI_QUIRK_BDADDR_PROPERTY_BROKEN quirk for such platforms so
that the address is reversed when parsing the address property.

Fixes: 5c0a1001c8 ("Bluetooth: hci_qca: Add helper to set device address")
Cc: stable@vger.kernel.org      # 5.1
Cc: Balakrishna Godavarthi <quic_bgodavar@quicinc.com>
Cc: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Nikita Travkin <nikita@trvn.ru> # sc7180
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-03-29 09:48:37 -04:00
..
ath3k.c
bcm203x.c
bfusb.c
bluecard_cs.c
bpa10x.c
bt3c_cs.c
btbcm.c Bluetooth: btbcm: Use devm_kstrdup() 2024-03-06 17:24:06 -05:00
btbcm.h
btintel.c Bluetooth: btintel: Fixe build regression 2024-03-06 17:26:10 -05:00
btintel.h Bluetooth: btintel: Print firmware SHA1 2023-12-22 12:55:56 -05:00
btmrvl_debugfs.c
btmrvl_drv.h
btmrvl_main.c
btmrvl_sdio.c
btmrvl_sdio.h
btmtk.c Bluetooth: btmtk: Add MODULE_FIRMWARE() for MT7922 2024-03-06 17:27:11 -05:00
btmtk.h Bluetooth: btmtk: Add MODULE_FIRMWARE() for MT7922 2024-03-06 17:27:11 -05:00
btmtksdio.c Bluetooth: btmtksdio: enable bluetooth wakeup in system suspend 2023-10-23 11:04:51 -07:00
btmtkuart.c treewide, serdev: change receive_buf() return type to size_t 2024-01-27 18:13:53 -08:00
btnxpuart.c TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
btqca.c Bluetooth: qca: fix device-address endianness 2024-03-29 09:48:37 -04:00
btqca.h Bluetooth: qca: add support for QCA2066 2023-10-23 10:59:46 -07:00
btqcomsmd.c
btrsi.c
btrtl.c Bluetooth: btrtl: Add the support for RTL8852BT/RTL8852BE-VT 2024-03-06 17:22:36 -05:00
btrtl.h Bluetooth: btrtl: Add Realtek devcoredump support 2023-08-11 11:35:14 -07:00
btsdio.c
btusb.c Bluetooth: Add new quirk for broken read key length on ATS2851 2024-03-06 17:27:14 -05:00
dtl1_cs.c
h4_recv.h
hci_ag6xx.c
hci_ath.c
hci_bcm.c
hci_bcm4377.c Bluetooth: hci_bcm4377: do not mark valid bd_addr as invalid 2024-02-28 09:39:44 -05:00
hci_bcsp.c
hci_h4.c
hci_h5.c Bluetooth: btrtl: fix out of bounds memory access 2024-03-06 17:26:21 -05:00
hci_intel.c
hci_ldisc.c TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
hci_ll.c
hci_mrvl.c
hci_nokia.c Bluetooth: nokia: fix value check in nokia_bluetooth_serdev_probe() 2023-08-11 11:50:41 -07:00
hci_qca.c Bluetooth: qca: fix device-address endianness 2024-03-29 09:48:37 -04:00
hci_serdev.c TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
hci_uart.h Bluetooth: hci_h5: Add ability to allocate memory for private data 2024-03-06 17:26:21 -05:00
hci_vhci.c Bluetooth: Fix deadlock in vhci_send_frame 2023-12-15 11:29:16 -05:00
Kconfig
Makefile
virtio_bt.c