[PATCH v3] Bluetooth: hci_qca: Wait for baudrate change event on WCN6750/6855/7850

From: Shuai Zhang

Date: Wed Dec 02 2026 - 21:43:45 EST


From: Cheng Jiang <cheng.jiang@xxxxxxxxxxxxxxxx>

The baudrate change command (0xfc48) is written straight to the UART, so
the HCI core does not track it. WCN6750, WCN6855 and WCN7850
answer it with a Command Complete event. The event arrives while the
first firmware download command is pending and ends up as:

Bluetooth: hci0: unexpected event for opcode 0xfc48

Handle these SoCs like WCN3990: drop the event in
qca_recv_event() and wait for it in qca_set_speed().

Getting the event also confirms that the controller really switched to
the new baudrate. Without the wait, a mismatch between host and
controller only shows up later as a firmware download timeout.

Signed-off-by: Cheng Jiang <cheng.jiang@xxxxxxxxxxxxxxxx>
Signed-off-by: Shuai Zhang <shuai.zhang@xxxxxxxxxxxxxxxx>
---
changes for v3
-- Drop QCC2072, it will be resubmitted once QCC2072 support is upstream
Link v2 https://lore.kernel.org/all/20261202131436.3448000-1-shuai.zhang@xxxxxxxxxxxxxxxx/
changes for v2
-- Change the commit author
Link v1 https://lore.kernel.org/all/20261202110933.2986272-1-shuai.zhang@xxxxxxxxxxxxxxxx/
---
drivers/bluetooth/hci_qca.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index b6d7d0120..5c65ae44a 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1229,7 +1229,10 @@ static int qca_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
* vendor command).
*/

- if (hdr->evt == HCI_EV_VENDOR)
+ /* Newer SoCs answer the baudrate change with a Command Complete
+ * instead of a vendor event. Drop it too.
+ */
+ if (hdr->evt == HCI_EV_VENDOR || hdr->evt == HCI_EV_CMD_COMPLETE)
complete(&qca->drop_ev_comp);

kfree_skb(skb);
@@ -1527,6 +1530,9 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)

switch (soc_type) {
case QCA_WCN3990:
+ case QCA_WCN6750:
+ case QCA_WCN6855:
+ case QCA_WCN7850:
reinit_completion(&qca->drop_ev_comp);
set_bit(QCA_DROP_VENDOR_EVENT, &qca->flags);
break;
@@ -1563,6 +1569,9 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)

switch (soc_type) {
case QCA_WCN3990:
+ case QCA_WCN6750:
+ case QCA_WCN6855:
+ case QCA_WCN7850:
/* Wait for the controller to send the vendor event
* for the baudrate change command.
*/
--
2.34.1