* [PATCH] Bluetooth: hci_sync: fix BR/EDR wakeup bug
@ 2023-11-27 9:05 15013537245
2023-11-27 14:00 ` Luiz Augusto von Dentz
2023-11-27 15:08 ` Paul Menzel
0 siblings, 2 replies; 7+ messages in thread
From: 15013537245 @ 2023-11-27 9:05 UTC (permalink / raw)
To: marcel, johan.hedberg, luiz.dentz
Cc: linux-bluetooth, linux-kernel, clancy.shang
From: "clancy.shang" <clancy.shang@quectel.com>
Steam deck in suspending state, but bt controller send hci
mode change event to host. cause Steam Deck can't into sleep.
Signed-off-by: clancy.shang <clancy.shang@quectel.com>
---
net/bluetooth/hci_sync.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index a15ab0b874a9..a26a58cb2c38 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3800,12 +3800,14 @@ static int hci_set_event_mask_sync(struct hci_dev *hdev)
if (lmp_bredr_capable(hdev)) {
events[4] |= 0x01; /* Flow Specification Complete */
- /* Don't set Disconnect Complete when suspended as that
- * would wakeup the host when disconnecting due to
- * suspend.
+ /* Don't set Disconnect Complete and mode change when
+ * suspended as that would wakeup the host when disconnecting
+ * due to suspend.
*/
- if (hdev->suspended)
+ if (hdev->suspended) {
events[0] &= 0xef;
+ events[2] &= 0xf7;
+ }
} else {
/* Use a different default for LE-only devices */
memset(events, 0, sizeof(events));
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: hci_sync: fix BR/EDR wakeup bug
2023-11-27 9:05 15013537245
@ 2023-11-27 14:00 ` Luiz Augusto von Dentz
2023-11-27 15:08 ` Paul Menzel
1 sibling, 0 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2023-11-27 14:00 UTC (permalink / raw)
To: 15013537245
Cc: marcel, johan.hedberg, linux-bluetooth, linux-kernel,
clancy.shang
Hi,
On Mon, Nov 27, 2023 at 4:06 AM <15013537245@163.com> wrote:
>
> From: "clancy.shang" <clancy.shang@quectel.com>
>
> Steam deck in suspending state, but bt controller send hci
> mode change event to host. cause Steam Deck can't into sleep.
It probably makes sense to add the btmon trace showing the issue.
> Signed-off-by: clancy.shang <clancy.shang@quectel.com>
> ---
> net/bluetooth/hci_sync.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index a15ab0b874a9..a26a58cb2c38 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -3800,12 +3800,14 @@ static int hci_set_event_mask_sync(struct hci_dev *hdev)
> if (lmp_bredr_capable(hdev)) {
> events[4] |= 0x01; /* Flow Specification Complete */
>
> - /* Don't set Disconnect Complete when suspended as that
> - * would wakeup the host when disconnecting due to
> - * suspend.
> + /* Don't set Disconnect Complete and mode change when
> + * suspended as that would wakeup the host when disconnecting
> + * due to suspend.
> */
> - if (hdev->suspended)
> + if (hdev->suspended) {
> events[0] &= 0xef;
> + events[2] &= 0xf7;
> + }
> } else {
> /* Use a different default for LE-only devices */
> memset(events, 0, sizeof(events));
> --
> 2.25.1
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: hci_sync: fix BR/EDR wakeup bug
2023-11-27 9:05 15013537245
2023-11-27 14:00 ` Luiz Augusto von Dentz
@ 2023-11-27 15:08 ` Paul Menzel
1 sibling, 0 replies; 7+ messages in thread
From: Paul Menzel @ 2023-11-27 15:08 UTC (permalink / raw)
To: 15013537245
Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth, linux-kernel,
Clancy Shang
Dear Clancy,
Thank you for the patch.
Am 27.11.23 um 10:05 schrieb 15013537245@163.com:
> From: "clancy.shang" <clancy.shang@quectel.com>
It’d be great, if you spelled your name “Clancy Shang”.
$ git config --global user.name "Clancy Shang"
$ git commit -s --amend --author="Clancy Shang
<clancy.shang@quectel.com>"
> Steam deck in suspending state, but bt controller send hci
> mode change event to host. cause Steam Deck can't into sleep.
Could you please elaborate on the fix little more, for example, mention
the mode change (0xf7).
> Signed-off-by: clancy.shang <clancy.shang@quectel.com>
> ---
> net/bluetooth/hci_sync.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index a15ab0b874a9..a26a58cb2c38 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -3800,12 +3800,14 @@ static int hci_set_event_mask_sync(struct hci_dev *hdev)
> if (lmp_bredr_capable(hdev)) {
> events[4] |= 0x01; /* Flow Specification Complete */
>
> - /* Don't set Disconnect Complete when suspended as that
> - * would wakeup the host when disconnecting due to
> - * suspend.
> + /* Don't set Disconnect Complete and mode change when
> + * suspended as that would wakeup the host when disconnecting
> + * due to suspend.
> */
> - if (hdev->suspended)
> + if (hdev->suspended) {
> events[0] &= 0xef;
> + events[2] &= 0xf7;
> + }
> } else {
> /* Use a different default for LE-only devices */
> memset(events, 0, sizeof(events));
Kind regards,
Paul Menzel
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Bluetooth: hci_sync: fix BR/EDR wakeup bug
@ 2023-12-05 2:41 15013537245
0 siblings, 0 replies; 7+ messages in thread
From: 15013537245 @ 2023-12-05 2:41 UTC (permalink / raw)
To: marcel, johan.hedberg, luiz.dentz
Cc: linux-bluetooth, linux-kernel, zhongjun.yu, Clancy Shang
From: Clancy Shang <clancy.shang@quectel.com>
when Bluetooth set the event mask and enter suspend, the controller
has hci mode change event comming,it cause controller can not enter
sleep mode. so it should to set the hci mode change event mask before
enter suspend
Signed-off-by: Clancy Shang <clancy.shang@quectel.com>
---
net/bluetooth/hci_sync.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index a15ab0b874a9..a26a58cb2c38 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3800,12 +3800,14 @@ static int hci_set_event_mask_sync(struct hci_dev *hdev)
if (lmp_bredr_capable(hdev)) {
events[4] |= 0x01; /* Flow Specification Complete */
- /* Don't set Disconnect Complete when suspended as that
- * would wakeup the host when disconnecting due to
- * suspend.
+ /* Don't set Disconnect Complete and mode change when
+ * suspended as that would wakeup the host when disconnecting
+ * due to suspend.
*/
- if (hdev->suspended)
+ if (hdev->suspended) {
events[0] &= 0xef;
+ events[2] &= 0xf7;
+ }
} else {
/* Use a different default for LE-only devices */
memset(events, 0, sizeof(events));
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] Bluetooth: hci_sync: fix BR/EDR wakeup bug
@ 2023-12-14 9:22 15013537245
0 siblings, 0 replies; 7+ messages in thread
From: 15013537245 @ 2023-12-14 9:22 UTC (permalink / raw)
To: marcel, johan.hedberg, luiz.dentz
Cc: linux-bluetooth, linux-kernel, zhongjun.yu, Clancy Shang
From: Clancy Shang <clancy.shang@quectel.com>
when Bluetooth set the event mask and enter suspend, the controller
has hci mode change event comming,it cause controller can not enter
sleep mode. so it should to set the hci mode change event mask before
enter suspend
Signed-off-by: Clancy Shang <clancy.shang@quectel.com>
---
net/bluetooth/hci_sync.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index a15ab0b874a9..a26a58cb2c38 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3800,12 +3800,14 @@ static int hci_set_event_mask_sync(struct hci_dev *hdev)
if (lmp_bredr_capable(hdev)) {
events[4] |= 0x01; /* Flow Specification Complete */
- /* Don't set Disconnect Complete when suspended as that
- * would wakeup the host when disconnecting due to
- * suspend.
+ /* Don't set Disconnect Complete and mode change when
+ * suspended as that would wakeup the host when disconnecting
+ * due to suspend.
*/
- if (hdev->suspended)
+ if (hdev->suspended) {
events[0] &= 0xef;
+ events[2] &= 0xf7;
+ }
} else {
/* Use a different default for LE-only devices */
memset(events, 0, sizeof(events));
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] Bluetooth: hci_sync: fix BR/EDR wakeup bug
@ 2023-12-18 10:24 15013537245
2023-12-19 18:28 ` patchwork-bot+bluetooth
0 siblings, 1 reply; 7+ messages in thread
From: 15013537245 @ 2023-12-18 10:24 UTC (permalink / raw)
To: marcel, johan.hedberg, luiz.dentz
Cc: linux-bluetooth, linux-kernel, zhongjun.yu, clancy shang
From: clancy shang <clancy.shang@quectel.com>
when Bluetooth set the event mask and enter suspend, the controller
has hci mode change event coming, it cause controller can not enter
sleep mode. so it should to set the hci mode change event mask before
enter suspend.
Signed-off-by: clancy shang <clancy.shang@quectel.com>
---
net/bluetooth/hci_sync.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index d85a7091a116..97284d9b2a2e 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3800,12 +3800,14 @@ static int hci_set_event_mask_sync(struct hci_dev *hdev)
if (lmp_bredr_capable(hdev)) {
events[4] |= 0x01; /* Flow Specification Complete */
- /* Don't set Disconnect Complete when suspended as that
- * would wakeup the host when disconnecting due to
- * suspend.
+ /* Don't set Disconnect Complete and mode change when
+ * suspended as that would wakeup the host when disconnecting
+ * due to suspend.
*/
- if (hdev->suspended)
+ if (hdev->suspended) {
events[0] &= 0xef;
+ events[2] &= 0xf7;
+ }
} else {
/* Use a different default for LE-only devices */
memset(events, 0, sizeof(events));
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: hci_sync: fix BR/EDR wakeup bug
2023-12-18 10:24 [PATCH] Bluetooth: hci_sync: fix BR/EDR wakeup bug 15013537245
@ 2023-12-19 18:28 ` patchwork-bot+bluetooth
0 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+bluetooth @ 2023-12-19 18:28 UTC (permalink / raw)
To: None
Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth, linux-kernel,
zhongjun.yu, clancy.shang
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Mon, 18 Dec 2023 18:24:17 +0800 you wrote:
> From: clancy shang <clancy.shang@quectel.com>
>
> when Bluetooth set the event mask and enter suspend, the controller
> has hci mode change event coming, it cause controller can not enter
> sleep mode. so it should to set the hci mode change event mask before
> enter suspend.
>
> [...]
Here is the summary with links:
- Bluetooth: hci_sync: fix BR/EDR wakeup bug
https://git.kernel.org/bluetooth/bluetooth-next/c/1e961bd261a6
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] 7+ messages in thread
end of thread, other threads:[~2023-12-19 18:28 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-18 10:24 [PATCH] Bluetooth: hci_sync: fix BR/EDR wakeup bug 15013537245
2023-12-19 18:28 ` patchwork-bot+bluetooth
-- strict thread matches above, loose matches on Subject: below --
2023-12-14 9:22 15013537245
2023-12-05 2:41 15013537245
2023-11-27 9:05 15013537245
2023-11-27 14:00 ` Luiz Augusto von Dentz
2023-11-27 15:08 ` Paul Menzel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox