public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Fix SSR(SubSystem Restart) issues caused by BT_EN being pulled up by hardware
@ 2025-08-13  3:35 Shuai Zhang
  2025-08-13  3:35 ` [PATCH v3 1/4] driver: bluetooth: hci_qca: fix ssr fail when BT_EN is pulled up by hw Shuai Zhang
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Shuai Zhang @ 2025-08-13  3:35 UTC (permalink / raw)
  To: linux-bluetooth, linux-arm-msm; +Cc: quic_bt, Shuai Zhang, linux-kernel

This patch series addresses issues encountered during SSR when
the BT_EN pin is pulled up by hardware. The main issues fixed are:

1. Timeout when sending reset command.
2. IBS state of host and controller not being synchronized.
3. Multiple triggers of SSR generating only one coredump file.
4. SSR process failed due to tx_idle_timer timeout

Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
---
To: Marcel Holtmann <marcel@holtmann.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: quic_bt@quicinc.com

---
Changes in v2:
- Update commit messages.
- Add version number.
- Add new change 4/4 patch to fix Idle_timer timeout.
- Link to v1/2: https://lore.kernel.org/all/20250715051618.724475-1-quic_shuaz@quicinc.com/
---

Shuai Zhang (4):
  driver: bluetooth: hci_qca: fix ssr fail when BT_EN is pulled up by hw
  driver: bluetooth: hci_qca: fix host IBS state after SSR
  driver: bluetooth: hci_qca: Multiple triggers of SSR only generate one
    coredump file
  driver: bluetooth: hci_qca: SSR(SubSystem Restart)process failed due
    to tx_idle_timer timeout

 drivers/bluetooth/hci_qca.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH v4 1/4] driver: bluetooth: hci_qca: fix ssr fail when BT_EN is pulled up by hw
@ 2025-08-14 12:47 Shuai Zhang
  2025-08-14 13:28 ` Fix SSR(SubSystem Restart) issues caused by BT_EN being pulled up by hardware bluez.test.bot
  0 siblings, 1 reply; 16+ messages in thread
From: Shuai Zhang @ 2025-08-14 12:47 UTC (permalink / raw)
  To: linux-bluetooth, linux-arm-msm; +Cc: quic_bt, Shuai Zhang

When the host actively triggers SSR and collects coredump data,
the Bluetooth stack sends a reset command to the controller. However,due
to the inability to clear the QCA_SSR_TRIGGERED and QCA_IBS_DISABLED bits,
the reset command times out.

For the purpose of HCI_QUIRK_NON_PERSISTENT_SETUP, please refer to
commit: 740011cfe94859df8d05f5400d589a8693b095e7.

The change is placed under if (!HCI_QUIRK_NON_PERSISTENT_SETUP)
because this quirk is associated with BT_EN, and can be used to
determine whether BT_EN is present in the device tree (DTS).

Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
---
 drivers/bluetooth/hci_qca.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 4e56782b0..91009c6a7 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1653,6 +1653,20 @@ static void qca_hw_error(struct hci_dev *hdev, u8 code)
 		skb_queue_purge(&qca->rx_memdump_q);
 	}
 
+	/*
+	 * If the BT chip's bt_en pin is connected to a 3.3V power supply via
+	 * hardware and always stays high, driver cannot control the bt_en pin.
+	 * As a result, during SSR(SubSystem Restart), QCA_SSR_TRIGGERED and
+	 * QCA_IBS_DISABLED flags cannot be cleared, which leads to a reset
+	 * command timeout.
+	 * Add an msleep delay to ensure controller completes the SSR process.
+	 */
+	if (!test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) {
+		clear_bit(QCA_SSR_TRIGGERED, &qca->flags);
+		clear_bit(QCA_IBS_DISABLED, &qca->flags);
+		msleep(50);
+	}
+
 	clear_bit(QCA_HW_ERROR_EVENT, &qca->flags);
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread
* [PATCH 1/4] driver: bluetooth: hci_qca: fix ssr fail when BT_EN is pulled up by hw
@ 2025-08-12 12:29 Shuai Zhang
  2025-08-12 13:26 ` Fix SSR(SubSystem Restart) issues caused by BT_EN being pulled up by hardware bluez.test.bot
  0 siblings, 1 reply; 16+ messages in thread
From: Shuai Zhang @ 2025-08-12 12:29 UTC (permalink / raw)
  To: linux-bluetooth, linux-arm-msm; +Cc: quic_bt, Shuai Zhang

When the host actively triggers SSR and collects coredump data,
the Bluetooth stack sends a reset command to the controller. However,due
to the inability to clear the QCA_SSR_TRIGGERED and QCA_IBS_DISABLED bits,
the reset command times out.

For the purpose of HCI_QUIRK_NON_PERSISTENT_SETUP, please refer to
commit: 740011cfe94859df8d05f5400d589a8693b095e7.

The change is placed under if (!HCI_QUIRK_NON_PERSISTENT_SETUP)
because this quirk is associated with BT_EN, and can be used to
determine whether BT_EN is present in the device tree (DTS).

Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
---
 drivers/bluetooth/hci_qca.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 4e56782b0..14b2d1bee 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -1653,6 +1653,19 @@ static void qca_hw_error(struct hci_dev *hdev, u8 code)
 		skb_queue_purge(&qca->rx_memdump_q);
 	}
 
+	/* If the BT chip's bt_en pin is always pulled high by a dedicated 3.3V
+	 * power supply via hardware the driver
+	 * cannot control the bt_en pin of the SoC chip, then during SSR,
+	 * the QCA_SSR_TRIGGERED and QCA_IBS_DISABLED bits cannot be cleared.
+	 * This leads to a reset command timeout failure.
+	 * Also, add msleep delay to wait for controller to complete SSR.
+	 */
+	if (!test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) {
+		clear_bit(QCA_SSR_TRIGGERED, &qca->flags);
+		clear_bit(QCA_IBS_DISABLED, &qca->flags);
+		msleep(50);
+	}
+
 	clear_bit(QCA_HW_ERROR_EVENT, &qca->flags);
 }
 
-- 
2.34.1


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

end of thread, other threads:[~2025-08-14 13:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13  3:35 [PATCH v3 0/4] Fix SSR(SubSystem Restart) issues caused by BT_EN being pulled up by hardware Shuai Zhang
2025-08-13  3:35 ` [PATCH v3 1/4] driver: bluetooth: hci_qca: fix ssr fail when BT_EN is pulled up by hw Shuai Zhang
2025-08-13  4:18   ` Fix SSR(SubSystem Restart) issues caused by BT_EN being pulled up by hardware bluez.test.bot
2025-08-13 11:05   ` [PATCH v3 1/4] driver: bluetooth: hci_qca: fix ssr fail when BT_EN is pulled up by hw Konrad Dybcio
2025-08-13 11:28     ` Shuai Zhang
2025-08-13 11:32       ` Konrad Dybcio
2025-08-14 11:41         ` Shuai Zhang
2025-08-13  3:35 ` [PATCH v3 2/4] driver: bluetooth: hci_qca: fix host IBS state after SSR Shuai Zhang
2025-08-13  3:35 ` [PATCH v3 3/4] driver: bluetooth: hci_qca: Multiple triggers of SSR only generate one coredump file Shuai Zhang
2025-08-13 11:11   ` Konrad Dybcio
2025-08-13 11:30     ` Shuai Zhang
2025-08-13  3:35 ` [PATCH v3 4/4] driver: bluetooth: hci_qca: SSR(SubSystem Restart)process failed due to tx_idle_timer timeout Shuai Zhang
2025-08-13 11:13   ` Konrad Dybcio
2025-08-14 11:52     ` Shuai Zhang
  -- strict thread matches above, loose matches on Subject: below --
2025-08-14 12:47 [PATCH v4 1/4] driver: bluetooth: hci_qca: fix ssr fail when BT_EN is pulled up by hw Shuai Zhang
2025-08-14 13:28 ` Fix SSR(SubSystem Restart) issues caused by BT_EN being pulled up by hardware bluez.test.bot
2025-08-12 12:29 [PATCH 1/4] driver: bluetooth: hci_qca: fix ssr fail when BT_EN is pulled up by hw Shuai Zhang
2025-08-12 13:26 ` Fix SSR(SubSystem Restart) issues caused by BT_EN being pulled up by hardware bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox