diff mbox series

Bluetooth: hci_sync: fix BR/EDR wakeup bug

Message ID 20231127090545.117162-1-15013537245@163.com (mailing list archive)
State Superseded
Headers show
Series Bluetooth: hci_sync: fix BR/EDR wakeup bug | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/SubjectPrefix success Gitlint PASS
tedd_an/BuildKernel success BuildKernel PASS
tedd_an/CheckAllWarning success CheckAllWarning PASS
tedd_an/CheckSparse success CheckSparse PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/BuildKernel32 success BuildKernel32 PASS
tedd_an/TestRunnerSetup success TestRunnerSetup PASS
tedd_an/TestRunner_l2cap-tester success TestRunner PASS
tedd_an/TestRunner_iso-tester success TestRunner PASS
tedd_an/TestRunner_bnep-tester success TestRunner PASS
tedd_an/TestRunner_mgmt-tester success TestRunner PASS
tedd_an/TestRunner_rfcomm-tester success TestRunner PASS
tedd_an/TestRunner_sco-tester success TestRunner PASS
tedd_an/TestRunner_ioctl-tester success TestRunner PASS
tedd_an/TestRunner_mesh-tester success TestRunner PASS
tedd_an/TestRunner_smp-tester success TestRunner PASS
tedd_an/TestRunner_userchan-tester success TestRunner PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

15013537245@163.com Nov. 27, 2023, 9:05 a.m. UTC
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(-)

Comments

bluez.test.bot@gmail.com Nov. 27, 2023, 9:33 a.m. UTC | #1
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=804428

---Test result---

Test Summary:
CheckPatch                    PASS      0.64 seconds
GitLint                       PASS      0.45 seconds
SubjectPrefix                 PASS      0.40 seconds
BuildKernel                   PASS      29.36 seconds
CheckAllWarning               PASS      32.36 seconds
CheckSparse                   PASS      37.57 seconds
CheckSmatch                   PASS      102.41 seconds
BuildKernel32                 PASS      28.08 seconds
TestRunnerSetup               PASS      429.08 seconds
TestRunner_l2cap-tester       PASS      25.51 seconds
TestRunner_iso-tester         PASS      37.95 seconds
TestRunner_bnep-tester        PASS      7.16 seconds
TestRunner_mgmt-tester        PASS      163.31 seconds
TestRunner_rfcomm-tester      PASS      12.82 seconds
TestRunner_sco-tester         PASS      14.72 seconds
TestRunner_ioctl-tester       PASS      12.36 seconds
TestRunner_mesh-tester        PASS      9.24 seconds
TestRunner_smp-tester         PASS      10.01 seconds
TestRunner_userchan-tester    PASS      7.53 seconds
IncrementalBuild              PASS      26.32 seconds



---
Regards,
Linux Bluetooth
Luiz Augusto von Dentz Nov. 27, 2023, 2 p.m. UTC | #2
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
>
Paul Menzel Nov. 27, 2023, 3:08 p.m. UTC | #3
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
diff mbox series

Patch

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