--- /dev/null
+From 1bb0c66332babc5cbc4581d962da0b03af9f23e8 Mon Sep 17 00:00:00 2001
+From: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
+Date: Tue, 2 Feb 2021 20:27:42 +0530
+Subject: Bluetooth: hci_qca: check for SSR triggered flag while suspend
+
+From: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
+
+commit 1bb0c66332babc5cbc4581d962da0b03af9f23e8 upstream.
+
+QCA_IBS_DISABLED flag will be set after memorydump started from
+controller.Currently qca_suspend() is waiting for SSR to complete
+based on flag QCA_IBS_DISABLED.Added to check for QCA_SSR_TRIGGERED
+flag too.
+
+Fixes: 2be43abac5a8 ("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>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/bluetooth/hci_qca.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/bluetooth/hci_qca.c
++++ b/drivers/bluetooth/hci_qca.c
+@@ -2120,7 +2120,8 @@ static int __maybe_unused qca_suspend(st
+ !test_bit(QCA_SSR_TRIGGERED, &qca->flags))
+ return 0;
+
+- if (test_bit(QCA_IBS_DISABLED, &qca->flags)) {
++ if (test_bit(QCA_IBS_DISABLED, &qca->flags) ||
++ test_bit(QCA_SSR_TRIGGERED, &qca->flags)) {
+ wait_timeout = test_bit(QCA_SSR_TRIGGERED, &qca->flags) ?
+ IBS_DISABLE_SSR_TIMEOUT_MS :
+ FW_DOWNLOAD_TIMEOUT_MS;
--- /dev/null
+From 55c0bd77479b60ea29fd390faf4545cfb3a1d79e Mon Sep 17 00:00:00 2001
+From: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
+Date: Fri, 5 Feb 2021 21:07:16 +0530
+Subject: Bluetooth: hci_qca: Fixed issue during suspend
+
+From: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
+
+commit 55c0bd77479b60ea29fd390faf4545cfb3a1d79e upstream.
+
+If BT SoC is running with ROM FW then just return in
+qca_suspend function as ROM FW does not support
+in-band sleep.
+
+Fixes: 2be43abac5a8 ("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>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/bluetooth/hci_qca.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+--- a/drivers/bluetooth/hci_qca.c
++++ b/drivers/bluetooth/hci_qca.c
+@@ -77,7 +77,8 @@ enum qca_flags {
+ QCA_MEMDUMP_COLLECTION,
+ QCA_HW_ERROR_EVENT,
+ QCA_SSR_TRIGGERED,
+- QCA_BT_OFF
++ QCA_BT_OFF,
++ QCA_ROM_FW
+ };
+
+ enum qca_capabilities {
+@@ -1664,6 +1665,7 @@ static int qca_setup(struct hci_uart *hu
+ if (ret)
+ return ret;
+
++ clear_bit(QCA_ROM_FW, &qca->flags);
+ /* Patch downloading has to be done without IBS mode */
+ set_bit(QCA_IBS_DISABLED, &qca->flags);
+
+@@ -1722,12 +1724,14 @@ retry:
+ hu->hdev->cmd_timeout = qca_cmd_timeout;
+ } else if (ret == -ENOENT) {
+ /* No patch/nvm-config found, run with original fw/config */
++ set_bit(QCA_ROM_FW, &qca->flags);
+ ret = 0;
+ } else if (ret == -EAGAIN) {
+ /*
+ * Userspace firmware loader will return -EAGAIN in case no
+ * patch/nvm-config is found, so run with original fw/config.
+ */
++ set_bit(QCA_ROM_FW, &qca->flags);
+ ret = 0;
+ } else {
+ if (retries < MAX_INIT_RETRIES) {
+@@ -2112,6 +2116,12 @@ static int __maybe_unused qca_suspend(st
+
+ set_bit(QCA_SUSPENDING, &qca->flags);
+
++ /* if BT SoC is running with default firmware then it does not
++ * support in-band sleep
++ */
++ if (test_bit(QCA_ROM_FW, &qca->flags))
++ return 0;
++
+ /* During SSR after memory dump collection, controller will be
+ * powered off and then powered on.If controller is powered off
+ * during SSR then we should wait until SSR is completed.
--- /dev/null
+From ad3a9c0ec2d2baed936cfdd05870f9d1e1f40e0e Mon Sep 17 00:00:00 2001
+From: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
+Date: Wed, 30 Dec 2020 22:47:08 +0530
+Subject: Bluetooth: hci_qca: Wait for SSR completion during suspend
+
+From: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
+
+commit ad3a9c0ec2d2baed936cfdd05870f9d1e1f40e0e upstream.
+
+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: 2be43abac5a8 ("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>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/bluetooth/hci_qca.c | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+--- a/drivers/bluetooth/hci_qca.c
++++ b/drivers/bluetooth/hci_qca.c
+@@ -50,7 +50,8 @@
+ #define IBS_HOST_TX_IDLE_TIMEOUT_MS 2000
+ #define CMD_TRANS_TIMEOUT_MS 100
+ #define MEMDUMP_TIMEOUT_MS 8000
+-#define IBS_DISABLE_SSR_TIMEOUT_MS (MEMDUMP_TIMEOUT_MS + 1000)
++#define IBS_DISABLE_SSR_TIMEOUT_MS \
++ (MEMDUMP_TIMEOUT_MS + FW_DOWNLOAD_TIMEOUT_MS)
+ #define FW_DOWNLOAD_TIMEOUT_MS 3000
+
+ /* susclk rate */
+@@ -2111,7 +2112,12 @@ static int __maybe_unused qca_suspend(st
+
+ set_bit(QCA_SUSPENDING, &qca->flags);
+
+- if (test_bit(QCA_BT_OFF, &qca->flags))
++ /* During SSR after memory dump collection, controller will be
++ * powered off and then powered on.If controller is powered off
++ * during SSR then we should wait until SSR is completed.
++ */
++ if (test_bit(QCA_BT_OFF, &qca->flags) &&
++ !test_bit(QCA_SSR_TRIGGERED, &qca->flags))
+ return 0;
+
+ if (test_bit(QCA_IBS_DISABLED, &qca->flags)) {
+@@ -2121,7 +2127,7 @@ static int __maybe_unused qca_suspend(st
+
+ /* QCA_IBS_DISABLED flag is set to true, During FW download
+ * and during memory dump collection. It is reset to false,
+- * After FW download complete and after memory dump collections.
++ * After FW download complete.
+ */
+ wait_on_bit_timeout(&qca->flags, QCA_IBS_DISABLED,
+ TASK_UNINTERRUPTIBLE, msecs_to_jiffies(wait_timeout));
+@@ -2133,10 +2139,6 @@ static int __maybe_unused qca_suspend(st
+ }
+ }
+
+- /* After memory dump collection, Controller is powered off.*/
+- if (test_bit(QCA_BT_OFF, &qca->flags))
+- return 0;
+-
+ cancel_work_sync(&qca->ws_awake_device);
+ cancel_work_sync(&qca->ws_awake_rx);
+
net-mlx5-fix-missing-mutex_unlock-in-mlx5_fw_fatal_reporter_err_work.patch
revert-wifi-mac80211-fix-memory-leak-in-ieee80211_if_add.patch
soc-qcom-apr-make-qcom-protection-domain-optional-again.patch
+bluetooth-hci_qca-wait-for-ssr-completion-during-suspend.patch
+bluetooth-hci_qca-check-for-ssr-triggered-flag-while-suspend.patch
+bluetooth-hci_qca-fixed-issue-during-suspend.patch