Subject: [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend

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 <[email protected]>
---
drivers/bluetooth/hci_qca.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index ff2fb68..de36af6 100644
--- 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);

@@ -1721,12 +1723,14 @@ static int qca_setup(struct hci_uart *hu)
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;
}

@@ -2103,6 +2107,12 @@ static int __maybe_unused qca_suspend(struct device *dev)

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.
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


2021-02-06 02:46:17

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v1] Bluetooth: hci_qca:Fixed issue during suspend

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=429045

---Test result---

##############################
Test: CheckPatch - FAIL
Bluetooth: hci_qca:Fixed issue during suspend
WARNING: Unknown commit id '2be43abac5a8', maybe rebased or not pulled?
#10:
Fixes: 2be43abac5a8 ("Bluetooth: hci_qca: Wait for timeout during suspend")

total: 0 errors, 1 warnings, 42 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

"[PATCH] Bluetooth: hci_qca:Fixed issue during suspend" has style problems, please review.

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: CheckGitLint - PASS


##############################
Test: CheckBuildK - PASS


##############################
Test: CheckTestRunner: Setup - PASS


##############################
Test: CheckTestRunner: l2cap-tester - PASS
Total: 40, Passed: 34 (85.0%), Failed: 0, Not Run: 6

##############################
Test: CheckTestRunner: bnep-tester - PASS
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: mgmt-tester - PASS
Total: 416, Passed: 402 (96.6%), Failed: 0, Not Run: 14

##############################
Test: CheckTestRunner: rfcomm-tester - PASS
Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: sco-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: smp-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: userchan-tester - PASS
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0



---
Regards,
Linux Bluetooth


Attachments:
l2cap-tester.log (42.33 kB)
bnep-tester.log (3.45 kB)
mgmt-tester.log (533.87 kB)
rfcomm-tester.log (11.38 kB)
sco-tester.log (9.66 kB)
smp-tester.log (11.52 kB)
userchan-tester.log (5.30 kB)
Download all attachments

2021-02-08 10:19:33

by Balakrishna Godavarthi

[permalink] [raw]
Subject: Re: [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend

+ Kalle Valo for +1T

On 2021-02-05 21:07, Venkata Lakshmi Narayana Gubba wrote:
> 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 <[email protected]>
> ---
> drivers/bluetooth/hci_qca.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index ff2fb68..de36af6 100644
> --- 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);
>
> @@ -1721,12 +1723,14 @@ static int qca_setup(struct hci_uart *hu)
> 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;
> }
>
> @@ -2103,6 +2107,12 @@ static int __maybe_unused qca_suspend(struct
> device *dev)
>
> 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.

2021-02-08 13:31:51

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend

Venkata Lakshmi Narayana Gubba <[email protected]> writes:

> 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 <[email protected]>

This patch does not apply neither to v5.11-rc7 or v5.11-rc5. What tree
did you use as the baseline?

$ patch -p1 < raw
patching file drivers/bluetooth/hci_qca.c
Hunk #1 succeeded at 76 (offset -1 lines).
Hunk #2 succeeded at 1662 (offset -3 lines).
Hunk #3 succeeded at 1720 (offset -3 lines).
Hunk #4 FAILED at 2107.
1 out of 4 hunks FAILED -- saving rejects to file
drivers/bluetooth/hci_qca.c.rej

$ git am -s -3 raw
Applying: Bluetooth: hci_qca:Fixed issue during suspend
error: sha1 information is lacking or useless
(drivers/bluetooth/hci_qca.c).
error: could not build fake ancestor
Patch failed at 0001 Bluetooth: hci_qca:Fixed issue during suspend

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2021-02-08 13:58:43

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend

Hi Venkata,

> 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 <[email protected]>
> ---
> drivers/bluetooth/hci_qca.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel