linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Resend v1] Bluetooth: hci_qca: Enhance retry logic in qca_setup
@ 2020-11-11  5:14 Balakrishna Godavarthi
  2020-11-11  9:53 ` Marcel Holtmann
  2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  0 siblings, 2 replies; 3+ messages in thread
From: Balakrishna Godavarthi @ 2020-11-11  5:14 UTC (permalink / raw)
  To: marcel, johan.hedberg
  Cc: mka, linux-kernel, linux-bluetooth, hemantg, linux-arm-msm,
	bgodavar, abhishekpandit, seanpaul, gubbaven, rjliao

Currently driver only retries to download FW if FW downloading
is failed. Sometimes observed command timeout for version request
command, if this happen on some platforms during boot time, then
a reboot is needed to turn ON BT. Instead to avoid a reboot, now
extended retry logic for version request command too.

Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
---
 drivers/bluetooth/hci_qca.c | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 2d3f1f1..1c9a2d46 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1672,7 +1672,7 @@ static int qca_setup(struct hci_uart *hu)
 retry:
 	ret = qca_power_on(hdev);
 	if (ret)
-		return ret;
+		goto out;
 
 	clear_bit(QCA_SSR_TRIGGERED, &qca->flags);
 
@@ -1681,7 +1681,7 @@ static int qca_setup(struct hci_uart *hu)
 
 		ret = qca_read_soc_version(hdev, &soc_ver, soc_type);
 		if (ret)
-			return ret;
+			goto out;
 	} else {
 		qca_set_speed(hu, QCA_INIT_SPEED);
 	}
@@ -1691,7 +1691,7 @@ static int qca_setup(struct hci_uart *hu)
 	if (speed) {
 		ret = qca_set_speed(hu, QCA_OPER_SPEED);
 		if (ret)
-			return ret;
+			goto out;
 
 		qca_baudrate = qca_get_baudrate_value(speed);
 	}
@@ -1700,7 +1700,7 @@ static int qca_setup(struct hci_uart *hu)
 		/* Get QCA version information */
 		ret = qca_read_soc_version(hdev, &soc_ver, soc_type);
 		if (ret)
-			return ret;
+			goto out;
 	}
 
 	bt_dev_info(hdev, "QCA controller version 0x%08x", soc_ver);
@@ -1721,20 +1721,22 @@ static int qca_setup(struct hci_uart *hu)
 		 * patch/nvm-config is found, so run with original fw/config.
 		 */
 		ret = 0;
-	} else {
-		if (retries < MAX_INIT_RETRIES) {
-			qca_power_shutdown(hu);
-			if (hu->serdev) {
-				serdev_device_close(hu->serdev);
-				ret = serdev_device_open(hu->serdev);
-				if (ret) {
-					bt_dev_err(hdev, "failed to open port");
-					return ret;
-				}
+	}
+
+out:
+	if (ret && retries < MAX_INIT_RETRIES) {
+		bt_dev_warn(hdev, "Retry BT power ON:%d", retries);
+		qca_power_shutdown(hu);
+		if (hu->serdev) {
+			serdev_device_close(hu->serdev);
+			ret = serdev_device_open(hu->serdev);
+			if (ret) {
+				bt_dev_err(hdev, "failed to open port");
+				return ret;
 			}
-			retries++;
-			goto retry;
 		}
+		retries++;
+		goto retry;
 	}
 
 	/* Setup bdaddr */
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Resend v1] Bluetooth: hci_qca: Enhance retry logic in qca_setup
  2020-11-11  5:14 [Resend v1] Bluetooth: hci_qca: Enhance retry logic in qca_setup Balakrishna Godavarthi
@ 2020-11-11  9:53 ` Marcel Holtmann
  2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2020-11-11  9:53 UTC (permalink / raw)
  To: Balakrishna Godavarthi
  Cc: Johan Hedberg, Matthias Kaehlcke, open list, linux-bluetooth,
	Hemantg, MSM, Abhishek Pandit-Subedi, seanpaul,
	Venkata Lakshmi Narayana Gubba, rjliao

Hi Balakrishna,

> Currently driver only retries to download FW if FW downloading
> is failed. Sometimes observed command timeout for version request
> command, if this happen on some platforms during boot time, then
> a reboot is needed to turn ON BT. Instead to avoid a reboot, now
> extended retry logic for version request command too.
> 
> Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> ---
> drivers/bluetooth/hci_qca.c | 34 ++++++++++++++++++----------------
> 1 file changed, 18 insertions(+), 16 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Resend v1] Bluetooth: hci_qca: Enhance retry logic in qca_setup
  2020-11-11  5:14 [Resend v1] Bluetooth: hci_qca: Enhance retry logic in qca_setup Balakrishna Godavarthi
  2020-11-11  9:53 ` Marcel Holtmann
@ 2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2020-12-29 20:15 UTC (permalink / raw)
  To: Balakrishna Godavarthi; +Cc: linux-arm-msm

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

On Wed, 11 Nov 2020 10:44:13 +0530 you wrote:
> Currently driver only retries to download FW if FW downloading
> is failed. Sometimes observed command timeout for version request
> command, if this happen on some platforms during boot time, then
> a reboot is needed to turn ON BT. Instead to avoid a reboot, now
> extended retry logic for version request command too.
> 
> Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> 
> [...]

Here is the summary with links:
  - [Resend,v1] Bluetooth: hci_qca: Enhance retry logic in qca_setup
    https://git.kernel.org/qcom/c/9e80587aba4c

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-29 20:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-11  5:14 [Resend v1] Bluetooth: hci_qca: Enhance retry logic in qca_setup Balakrishna Godavarthi
2020-11-11  9:53 ` Marcel Holtmann
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).