* [PATCH v2 0/1] Bluetooth: hci_qca: Cleanup on all setup failures
@ 2025-12-26 10:27 jinwli
2025-12-26 10:27 ` [PATCH v2 1/1] " jinwli
0 siblings, 1 reply; 2+ messages in thread
From: jinwli @ 2025-12-26 10:27 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 setup process previously combined error handling and retry gating
under one condition. As a result, the final failed attempt exited
without performing cleanup.
Update the failure path to always perform power and port cleanup on
setup failure, and reopen the port only when retrying.
changes v2:
- Only reopen the serdev port when retrying.
- Return on the final failure.
- Update commit.
- Link to v1
https://lore.kernel.org/all/20251222123824.3000167-1-jinwang.li@oss.qualcomm.com/
jinwli (1):
Bluetooth: hci_qca: Cleanup on all setup failures
drivers/bluetooth/hci_qca.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v2 1/1] Bluetooth: hci_qca: Cleanup on all setup failures
2025-12-26 10:27 [PATCH v2 0/1] Bluetooth: hci_qca: Cleanup on all setup failures jinwli
@ 2025-12-26 10:27 ` jinwli
0 siblings, 0 replies; 2+ messages in thread
From: jinwli @ 2025-12-26 10:27 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 setup process previously combined error handling and retry gating
under one condition. As a result, the final failed attempt exited
without performing cleanup.
Update the failure path to always perform power and port cleanup on
setup failure, and reopen the port only when retrying.
Signed-off-by: jinwli <jinwang.li@oss.qualcomm.com>
---
drivers/bluetooth/hci_qca.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 1d3b62579..ca61e0afc 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -2026,19 +2026,24 @@ static int qca_setup(struct hci_uart *hu)
}
out:
- if (ret && retries < MAX_INIT_RETRIES) {
- bt_dev_warn(hdev, "Retry BT power ON:%d", retries);
+ if (ret) {
qca_power_shutdown(hu);
- if (hu->serdev) {
+ 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;
+
+ if (retries < MAX_INIT_RETRIES) {
+ bt_dev_warn(hdev, "Retry BT power ON:%d", retries);
+ if (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;
+ return ret;
}
/* Setup bdaddr */
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-26 10:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-26 10:27 [PATCH v2 0/1] Bluetooth: hci_qca: Cleanup on all setup failures jinwli
2025-12-26 10:27 ` [PATCH v2 1/1] " jinwli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®