linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend
@ 2021-02-05 15:37 Venkata Lakshmi Narayana Gubba
  2021-02-08 10:13 ` bgodavar
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Venkata Lakshmi Narayana Gubba @ 2021-02-05 15:37 UTC (permalink / raw)
  To: marcel, johan.hedberg
  Cc: mka, linux-kernel, linux-bluetooth, hemantg, linux-arm-msm,
	bgodavar, rjliao, hbandi, abhishekpandit,
	Venkata Lakshmi Narayana Gubba

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>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend
  2021-02-05 15:37 [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend Venkata Lakshmi Narayana Gubba
@ 2021-02-08 10:13 ` bgodavar
  2021-02-08 13:25 ` Kalle Valo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: bgodavar @ 2021-02-08 10:13 UTC (permalink / raw)
  To: Venkata Lakshmi Narayana Gubba, Kalle Valo
  Cc: marcel, johan.hedberg, mka, linux-kernel, linux-bluetooth,
	hemantg, linux-arm-msm, rjliao, hbandi, abhishekpandit

+ 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 <gubbaven@codeaurora.org>
> ---
>  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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend
  2021-02-05 15:37 [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend Venkata Lakshmi Narayana Gubba
  2021-02-08 10:13 ` bgodavar
@ 2021-02-08 13:25 ` Kalle Valo
  2021-02-08 13:55 ` Marcel Holtmann
  2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
  3 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2021-02-08 13:25 UTC (permalink / raw)
  To: Venkata Lakshmi Narayana Gubba
  Cc: marcel, johan.hedberg, mka, linux-kernel, linux-bluetooth,
	hemantg, linux-arm-msm, bgodavar, rjliao, hbandi, abhishekpandit

Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org> 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 <gubbaven@codeaurora.org>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend
  2021-02-05 15:37 [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend Venkata Lakshmi Narayana Gubba
  2021-02-08 10:13 ` bgodavar
  2021-02-08 13:25 ` Kalle Valo
@ 2021-02-08 13:55 ` Marcel Holtmann
  2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
  3 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2021-02-08 13:55 UTC (permalink / raw)
  To: Venkata Lakshmi Narayana Gubba
  Cc: Johan Hedberg, Matthias Kaehlcke, LKML,
	Bluetooth Kernel Mailing List, Hemantg, MSM,
	Balakrishna Godavarthi, Rocky Liao, hbandi, abhishekpandit

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 <gubbaven@codeaurora.org>
> ---
> drivers/bluetooth/hci_qca.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend
  2021-02-05 15:37 [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend Venkata Lakshmi Narayana Gubba
                   ` (2 preceding siblings ...)
  2021-02-08 13:55 ` Marcel Holtmann
@ 2021-03-01 19:59 ` patchwork-bot+linux-arm-msm
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2021-03-01 19:59 UTC (permalink / raw)
  To: Venkata Lakshmi Narayana Gubba; +Cc: linux-arm-msm

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

On Fri,  5 Feb 2021 21:07:16 +0530 you 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 <gubbaven@codeaurora.org>
> 
> [...]

Here is the summary with links:
  - [v1] Bluetooth: hci_qca:Fixed issue during suspend
    https://git.kernel.org/qcom/c/55c0bd77479b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-01 20:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 15:37 [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend Venkata Lakshmi Narayana Gubba
2021-02-08 10:13 ` bgodavar
2021-02-08 13:25 ` Kalle Valo
2021-02-08 13:55 ` Marcel Holtmann
2021-03-01 19:59 ` patchwork-bot+linux-arm-msm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).