Skip to content

Commit

Permalink
Bluetooth: btusb: Improve stability for QCA devices
Browse files Browse the repository at this point in the history
WCN6855 2.1 will reset to apply firmware downloaded, so wait
a moment for reset done then go ahead to improve stability.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
zijun-hu authored and holtmann committed Mar 4, 2022
1 parent 467e98c commit 599ece4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/bluetooth/btusb.c
Expand Up @@ -2999,6 +2999,7 @@ static int btusb_set_bdaddr_wcn6855(struct hci_dev *hdev,
#define QCA_PATCH_UPDATED 0x80
#define QCA_DFU_TIMEOUT 3000
#define QCA_FLAG_MULTI_NVM 0x80
#define QCA_BT_RESET_WAIT_MS 100

#define WCN6855_2_0_RAM_VERSION_GF 0x400c1200
#define WCN6855_2_1_RAM_VERSION_GF 0x400c1211
Expand Down Expand Up @@ -3325,6 +3326,13 @@ static int btusb_setup_qca(struct hci_dev *hdev)
err = btusb_setup_qca_load_nvm(hdev, &ver, info);
if (err < 0)
return err;

/* WCN6855 2.1 will reset to apply firmware downloaded here, so
* wait ~100ms for reset Done then go ahead, otherwise, it maybe
* cause potential enable failure.
*/
if (info->rom_version == 0x00130201)
msleep(QCA_BT_RESET_WAIT_MS);
}

return 0;
Expand Down

0 comments on commit 599ece4

Please sign in to comment.