Skip to content

Commit 2195306

Browse files
Shuai Zhangche-jiang
authored andcommitted
FROMLIST: driver: bluetooth: hci_qca: fix ssr fail when BT_EN is consistently pulled up by hardware
If BT_EN is consistently pulled up by hardware, the QCA_SSR_TRIGGERED and QCA_IBS_DISABLED bits cannot be cleared by qca_setup during SSR. This leads to a failure to send commands due to the error state. To address this, clear QCA_SSR_TRIGGERED and QCA_IBS_DISABLED bits after the coredump collection is complete. Also, add a delay to wait for controller to complete SSR. Signed-off-by: Shuai Zhang <[email protected]> Link: https://lore.kernel.org/all/[email protected]/
1 parent 89be9a8 commit 2195306

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,6 +1653,23 @@ static void qca_hw_error(struct hci_dev *hdev, u8 code)
16531653
}
16541654

16551655
clear_bit(QCA_HW_ERROR_EVENT, &qca->flags);
1656+
1657+
/*
1658+
* If the SoC always enables the bt_en pin via hardware and the driver
1659+
* cannot control the bt_en pin of the SoC chip, then during SSR,
1660+
* the QCA_SSR_TRIGGERED and QCA_IBS_DISABLED bits cannot be cleared.
1661+
* This leads to a reset command timeout failure.
1662+
*
1663+
* To address this, clear QCA_SSR_TRIGGERED and QCA_IBS_DISABLED bits
1664+
* after the coredump collection is complete.
1665+
* Also, add msleep delay to wait for controller to complete SSR.
1666+
*/
1667+
if (!hci_test_quirk(hu->hdev, HCI_QUIRK_NON_PERSISTENT_SETUP)) {
1668+
clear_bit(QCA_SSR_TRIGGERED, &qca->flags);
1669+
clear_bit(QCA_IBS_DISABLED, &qca->flags);
1670+
qca->tx_ibs_state = HCI_IBS_TX_AWAKE;
1671+
msleep(50);
1672+
}
16561673
}
16571674

16581675
static void qca_reset(struct hci_dev *hdev)

0 commit comments

Comments
 (0)