All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] FROMLIST: driver: bluetooth: hci_qca: Always perform cleanup on every setup failure
@ 2025-12-22 12:38 jinwli
  2025-12-22 13:52 ` [v1] " bluez.test.bot
  2025-12-29 13:02 ` [PATCH v1] " Konrad Dybcio
  0 siblings, 2 replies; 3+ messages in thread
From: jinwli @ 2025-12-22 12:38 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: linux-bluetooth, linux-kernel, linux-arm-msm, cheng.jiang,
	quic_chezhou, wei.deng, shuai.zhang, mengshi.wu, jinwang.li

The retry logic in qca_setup combined error handling and
retry gating under a single condition. This caused the final failed
attempt (when retries reached MAX_INIT_RETRIES) to return without
performing cleanup.

So only jumping to retry when there is a error and retries have not
reached MAX_INIT_RETRIES.

Signed-off-by: jinwli <jinwang.li@oss.qualcomm.com>
---
 drivers/bluetooth/hci_qca.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 1d3b62579..b695577f8 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -2026,7 +2026,7 @@ static int qca_setup(struct hci_uart *hu)
 	}
 
 out:
-	if (ret && retries < MAX_INIT_RETRIES) {
+	if (ret) {
 		bt_dev_warn(hdev, "Retry BT power ON:%d", retries);
 		qca_power_shutdown(hu);
 		if (hu->serdev) {
@@ -2037,8 +2037,10 @@ static int qca_setup(struct hci_uart *hu)
 				return ret;
 			}
 		}
-		retries++;
-		goto retry;
+		if (retries < MAX_INIT_RETRIES) {
+			retries++;
+			goto retry;
+		}
 	}
 
 	/* Setup bdaddr */
-- 
2.34.1


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

end of thread, other threads:[~2025-12-29 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 12:38 [PATCH v1] FROMLIST: driver: bluetooth: hci_qca: Always perform cleanup on every setup failure jinwli
2025-12-22 13:52 ` [v1] " bluez.test.bot
2025-12-29 13:02 ` [PATCH v1] " Konrad Dybcio

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.