Skip to content

Commit ad3a9c0

Browse files
Venkata Lakshmi Narayana Gubbaholtmann
authored andcommitted
Bluetooth: hci_qca: Wait for SSR completion during suspend
During SSR after memory dump collection,BT controller will be powered off, powered on and then FW will be downloaded.During suspend if BT controller is powered off due to SSR then we should wait until SSR is completed and then suspend. Fixes: 2be43ab ("Bluetooth: hci_qca: Wait for timeout during suspend") Signed-off-by: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent 71f8e70 commit ad3a9c0

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
#define IBS_HOST_TX_IDLE_TIMEOUT_MS 2000
5151
#define CMD_TRANS_TIMEOUT_MS 100
5252
#define MEMDUMP_TIMEOUT_MS 8000
53-
#define IBS_DISABLE_SSR_TIMEOUT_MS (MEMDUMP_TIMEOUT_MS + 1000)
53+
#define IBS_DISABLE_SSR_TIMEOUT_MS \
54+
(MEMDUMP_TIMEOUT_MS + FW_DOWNLOAD_TIMEOUT_MS)
5455
#define FW_DOWNLOAD_TIMEOUT_MS 3000
5556

5657
/* susclk rate */
@@ -2102,7 +2103,12 @@ static int __maybe_unused qca_suspend(struct device *dev)
21022103

21032104
set_bit(QCA_SUSPENDING, &qca->flags);
21042105

2105-
if (test_bit(QCA_BT_OFF, &qca->flags))
2106+
/* During SSR after memory dump collection, controller will be
2107+
* powered off and then powered on.If controller is powered off
2108+
* during SSR then we should wait until SSR is completed.
2109+
*/
2110+
if (test_bit(QCA_BT_OFF, &qca->flags) &&
2111+
!test_bit(QCA_SSR_TRIGGERED, &qca->flags))
21062112
return 0;
21072113

21082114
if (test_bit(QCA_IBS_DISABLED, &qca->flags)) {
@@ -2112,7 +2118,7 @@ static int __maybe_unused qca_suspend(struct device *dev)
21122118

21132119
/* QCA_IBS_DISABLED flag is set to true, During FW download
21142120
* and during memory dump collection. It is reset to false,
2115-
* After FW download complete and after memory dump collections.
2121+
* After FW download complete.
21162122
*/
21172123
wait_on_bit_timeout(&qca->flags, QCA_IBS_DISABLED,
21182124
TASK_UNINTERRUPTIBLE, msecs_to_jiffies(wait_timeout));
@@ -2124,10 +2130,6 @@ static int __maybe_unused qca_suspend(struct device *dev)
21242130
}
21252131
}
21262132

2127-
/* After memory dump collection, Controller is powered off.*/
2128-
if (test_bit(QCA_BT_OFF, &qca->flags))
2129-
return 0;
2130-
21312133
cancel_work_sync(&qca->ws_awake_device);
21322134
cancel_work_sync(&qca->ws_awake_rx);
21332135

0 commit comments

Comments
 (0)