From: Greg Kroah-Hartman Date: Sun, 22 Jan 2023 15:01:10 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v4.14.304~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=44e19025dd01823df731cb1f7564d73e8f7eeea2;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: bluetooth-hci_qca-check-for-ssr-triggered-flag-while-suspend.patch bluetooth-hci_qca-fixed-issue-during-suspend.patch bluetooth-hci_qca-wait-for-ssr-completion-during-suspend.patch --- diff --git a/queue-5.10/bluetooth-hci_qca-check-for-ssr-triggered-flag-while-suspend.patch b/queue-5.10/bluetooth-hci_qca-check-for-ssr-triggered-flag-while-suspend.patch new file mode 100644 index 00000000000..a610110ec12 --- /dev/null +++ b/queue-5.10/bluetooth-hci_qca-check-for-ssr-triggered-flag-while-suspend.patch @@ -0,0 +1,34 @@ +From 1bb0c66332babc5cbc4581d962da0b03af9f23e8 Mon Sep 17 00:00:00 2001 +From: Venkata Lakshmi Narayana Gubba +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 + +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 +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + 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; diff --git a/queue-5.10/bluetooth-hci_qca-fixed-issue-during-suspend.patch b/queue-5.10/bluetooth-hci_qca-fixed-issue-during-suspend.patch new file mode 100644 index 00000000000..370d19d518d --- /dev/null +++ b/queue-5.10/bluetooth-hci_qca-fixed-issue-during-suspend.patch @@ -0,0 +1,69 @@ +From 55c0bd77479b60ea29fd390faf4545cfb3a1d79e Mon Sep 17 00:00:00 2001 +From: Venkata Lakshmi Narayana Gubba +Date: Fri, 5 Feb 2021 21:07:16 +0530 +Subject: Bluetooth: hci_qca: Fixed issue during suspend + +From: Venkata Lakshmi Narayana Gubba + +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 +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + 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. diff --git a/queue-5.10/bluetooth-hci_qca-wait-for-ssr-completion-during-suspend.patch b/queue-5.10/bluetooth-hci_qca-wait-for-ssr-completion-during-suspend.patch new file mode 100644 index 00000000000..93719cb1b37 --- /dev/null +++ b/queue-5.10/bluetooth-hci_qca-wait-for-ssr-completion-during-suspend.patch @@ -0,0 +1,68 @@ +From ad3a9c0ec2d2baed936cfdd05870f9d1e1f40e0e Mon Sep 17 00:00:00 2001 +From: Venkata Lakshmi Narayana Gubba +Date: Wed, 30 Dec 2020 22:47:08 +0530 +Subject: Bluetooth: hci_qca: Wait for SSR completion during suspend + +From: Venkata Lakshmi Narayana Gubba + +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 +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + 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); + diff --git a/queue-5.10/series b/queue-5.10/series index 5bb2dd78e9d..820d79ce66a 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -93,3 +93,6 @@ net-ulp-use-consistent-error-code-when-blocking-ulp.patch 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