diff mbox series

[1/1,SRU,OEM-5.14/OEM-5.17/Jammy/Unstable] Bluetooth: btusb: Improve stability for QCA devices

Message ID 20220401113252.2379213-2-vicamo.yang@canonical.com
State New
Headers show
Series WCN6856 BT keep in OFF state after coldboot system | expand

Commit Message

You-Sheng Yang April 1, 2022, 11:32 a.m. UTC
From: Zijun Hu <quic_zijuhu@quicinc.com>

BugLink: https://bugs.launchpad.net/bugs/1967067

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>
(cherry picked from commit 599ece4f8f073097904d411ee70280a2ec890ad3)
Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
---
 drivers/bluetooth/btusb.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Stefan Bader April 26, 2022, 8:05 a.m. UTC | #1
On 01.04.22 13:32, You-Sheng Yang wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1967067
> 
> 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>
> (cherry picked from commit 599ece4f8f073097904d411ee70280a2ec890ad3)
> Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>   drivers/bluetooth/btusb.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 27776b23a27f..5de98d3fd032 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -3232,6 +3232,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
> @@ -3558,6 +3559,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;
Kleber Sacilotto de Souza April 26, 2022, 9:21 a.m. UTC | #2
On 01.04.22 13:32, You-Sheng Yang wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1967067
> 
> 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>
> (cherry picked from commit 599ece4f8f073097904d411ee70280a2ec890ad3)
> Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

Thanks

> ---
>   drivers/bluetooth/btusb.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 27776b23a27f..5de98d3fd032 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -3232,6 +3232,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
> @@ -3558,6 +3559,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;
diff mbox series

Patch

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 27776b23a27f..5de98d3fd032 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3232,6 +3232,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
@@ -3558,6 +3559,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;