* [PATCH] Bluetooth: hci_sync: Fix BLE devices were unable to disable the wakeup function
@ 2024-01-05 2:56 clancy_shang
2024-01-05 3:33 ` bluez.test.bot
2024-01-05 15:21 ` [PATCH] " Luiz Augusto von Dentz
0 siblings, 2 replies; 4+ messages in thread
From: clancy_shang @ 2024-01-05 2:56 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 BLE master enter suspend, it does not delete the peripheral that
in acceptlist. so if disable the wakeup function, the BLE master scans with
basic filter next time, the peripheral can be scanned which is unexpected
Signed-off-by: Clancy Shang <clancy.shang@quectel.com>
---
net/bluetooth/hci_sync.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index d85a7091a116..abc7f614da5f 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2533,6 +2533,7 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
struct bdaddr_list *b, *t;
u8 num_entries = 0;
bool pend_conn, pend_report;
+ struct hci_conn_params *conn_params;
u8 filter_policy;
size_t i, n;
int err;
@@ -2585,6 +2586,15 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
continue;
}
+ conn_params = hci_conn_params_lookup(hdev, &b->bdaddr, b->bdaddr_type);
+ /* During suspend, only wakeable devices can be in acceptlist */
+ if (conn_params && hdev->suspended &&
+ !(conn_params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP)) {
+ hci_le_del_accept_list_sync(hdev, &b->bdaddr,
+ b->bdaddr_type);
+ continue;
+ }
+
num_entries++;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: Bluetooth: hci_sync: Fix BLE devices were unable to disable the wakeup function
2024-01-05 2:56 [PATCH] Bluetooth: hci_sync: Fix BLE devices were unable to disable the wakeup function clancy_shang
@ 2024-01-05 3:33 ` bluez.test.bot
2024-01-05 15:21 ` [PATCH] " Luiz Augusto von Dentz
1 sibling, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2024-01-05 3:33 UTC (permalink / raw)
To: linux-bluetooth, clancy_shang
[-- Attachment #1: Type: text/plain, Size: 1423 bytes --]
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=814541
---Test result---
Test Summary:
CheckPatch PASS 0.63 seconds
GitLint PASS 0.33 seconds
SubjectPrefix PASS 0.13 seconds
BuildKernel PASS 27.78 seconds
CheckAllWarning PASS 30.53 seconds
CheckSparse PASS 38.59 seconds
CheckSmatch PASS 100.43 seconds
BuildKernel32 PASS 26.97 seconds
TestRunnerSetup PASS 434.01 seconds
TestRunner_l2cap-tester PASS 23.08 seconds
TestRunner_iso-tester PASS 49.83 seconds
TestRunner_bnep-tester PASS 6.82 seconds
TestRunner_mgmt-tester PASS 162.98 seconds
TestRunner_rfcomm-tester PASS 10.76 seconds
TestRunner_sco-tester PASS 14.54 seconds
TestRunner_ioctl-tester PASS 11.95 seconds
TestRunner_mesh-tester PASS 8.73 seconds
TestRunner_smp-tester PASS 9.76 seconds
TestRunner_userchan-tester PASS 7.24 seconds
IncrementalBuild PASS 26.13 seconds
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Bluetooth: hci_sync: Fix BLE devices were unable to disable the wakeup function
2024-01-05 2:56 [PATCH] Bluetooth: hci_sync: Fix BLE devices were unable to disable the wakeup function clancy_shang
2024-01-05 3:33 ` bluez.test.bot
@ 2024-01-05 15:21 ` Luiz Augusto von Dentz
[not found] ` <5ebcd5f1.2a8d.18ced8b011e.Coremail.clancy_shang@163.com>
1 sibling, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2024-01-05 15:21 UTC (permalink / raw)
To: clancy_shang
Cc: marcel, johan.hedberg, linux-bluetooth, linux-kernel, zhongjun.yu,
Clancy Shang
Hi Clancy,
On Thu, Jan 4, 2024 at 9:56 PM <clancy_shang@163.com> wrote:
>
> From: Clancy Shang <clancy.shang@quectel.com>
>
> when BLE master enter suspend, it does not delete the peripheral that
> in acceptlist. so if disable the wakeup function, the BLE master scans with
> basic filter next time, the peripheral can be scanned which is unexpected
>
> Signed-off-by: Clancy Shang <clancy.shang@quectel.com>
> ---
> net/bluetooth/hci_sync.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index d85a7091a116..abc7f614da5f 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -2533,6 +2533,7 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
> struct bdaddr_list *b, *t;
> u8 num_entries = 0;
> bool pend_conn, pend_report;
> + struct hci_conn_params *conn_params;
> u8 filter_policy;
> size_t i, n;
> int err;
> @@ -2585,6 +2586,15 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
> continue;
> }
>
> + conn_params = hci_conn_params_lookup(hdev, &b->bdaddr, b->bdaddr_type);
> + /* During suspend, only wakeable devices can be in acceptlist */
> + if (conn_params && hdev->suspended &&
> + !(conn_params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP)) {
> + hci_le_del_accept_list_sync(hdev, &b->bdaddr,
> + b->bdaddr_type);
> + continue;
> + }
This might require a lock since that is not a copy of the conn_params
which can be updated concurrently, so perhaps something like the
following is might be safer:
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index b3141e3f9cf6..eeb73a54fd26 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2206,8 +2206,11 @@ static int hci_le_add_accept_list_sync(struct
hci_dev *hdev,
/* During suspend, only wakeable devices can be in acceptlist */
if (hdev->suspended &&
- !(params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP))
+ !(params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP)) {
+ hci_le_del_accept_list_sync(hdev, ¶ms->bdaddr,
+ params->bdaddr_type);
return 0;
+ }
/* Select filter policy to accept all advertising */
if (*num_entries >= hdev->le_accept_list_size)
> num_entries++;
> }
>
> --
> 2.25.1
>
--
Luiz Augusto von Dentz
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Re: [PATCH] Bluetooth: hci_sync: Fix BLE devices were unable to disable the wakeup function
[not found] ` <5ebcd5f1.2a8d.18ced8b011e.Coremail.clancy_shang@163.com>
@ 2024-01-09 13:41 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2024-01-09 13:41 UTC (permalink / raw)
To: clancy_shang
Cc: marcel, johan.hedberg, linux-bluetooth, linux-kernel, zhongjun.yu,
Clancy Shang
Hi Clancy,
On Tue, Jan 9, 2024 at 4:26 AM clancy_shang <clancy_shang@163.com> wrote:
>
> Hi Luiz Augusto von Dentz,
>
> Thanks for you suggestions. is the patch has been accepted? or need me modify as your suggested and resend to you?
It has been applied already:
https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/?id=0bcd317e8b31833d36cd9843902905aafbd70017
> Kind regards,
>
> Clancy
>
>
>
>
>
>
>
> At 2024-01-05 23:21:59, "Luiz Augusto von Dentz" <luiz.dentz@gmail.com> wrote:
> >Hi Clancy,
> >
> >On Thu, Jan 4, 2024 at 9:56 PM <clancy_shang@163.com> wrote:
> >>
> >> From: Clancy Shang <clancy.shang@quectel.com>
> >>
> >> when BLE master enter suspend, it does not delete the peripheral that
> >> in acceptlist. so if disable the wakeup function, the BLE master scans with
> >> basic filter next time, the peripheral can be scanned which is unexpected
> >>
> >> Signed-off-by: Clancy Shang <clancy.shang@quectel.com>
> >> ---
> >> net/bluetooth/hci_sync.c | 10 ++++++++++
> >> 1 file changed, 10 insertions(+)
> >>
> >> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> >> index d85a7091a116..abc7f614da5f 100644
> >> --- a/net/bluetooth/hci_sync.c
> >> +++ b/net/bluetooth/hci_sync.c
> >> @@ -2533,6 +2533,7 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
> >> struct bdaddr_list *b, *t;
> >> u8 num_entries = 0;
> >> bool pend_conn, pend_report;
> >> + struct hci_conn_params *conn_params;
> >> u8 filter_policy;
> >> size_t i, n;
> >> int err;
> >> @@ -2585,6 +2586,15 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
> >> continue;
> >> }
> >>
> >> + conn_params = hci_conn_params_lookup(hdev, &b->bdaddr, b->bdaddr_type);
> >> + /* During suspend, only wakeable devices can be in acceptlist */
> >> + if (conn_params && hdev->suspended &&
> >> + !(conn_params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP)) {
> >> + hci_le_del_accept_list_sync(hdev, &b->bdaddr,
> >> + b->bdaddr_type);
> >> + continue;
> >> + }
> >
> >This might require a lock since that is not a copy of the conn_params
> >which can be updated concurrently, so perhaps something like the
> >following is might be safer:
> >
> >diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> >index b3141e3f9cf6..eeb73a54fd26 100644
> >--- a/net/bluetooth/hci_sync.c
> >+++ b/net/bluetooth/hci_sync.c
> >@@ -2206,8 +2206,11 @@ static int hci_le_add_accept_list_sync(struct
> >hci_dev *hdev,
> >
> > /* During suspend, only wakeable devices can be in acceptlist */
> > if (hdev->suspended &&
> >- !(params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP))
> >+ !(params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP)) {
> >+ hci_le_del_accept_list_sync(hdev, ¶ms->bdaddr,
> >+ params->bdaddr_type);
> > return 0;
> >+ }
> >
> > /* Select filter policy to accept all advertising */
> > if (*num_entries >= hdev->le_accept_list_size)
> >
> >> num_entries++;
> >> }
> >>
> >> --
> >> 2.25.1
> >>
> >
> >
> >--
> >Luiz Augusto von Dentz
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-09 13:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-05 2:56 [PATCH] Bluetooth: hci_sync: Fix BLE devices were unable to disable the wakeup function clancy_shang
2024-01-05 3:33 ` bluez.test.bot
2024-01-05 15:21 ` [PATCH] " Luiz Augusto von Dentz
[not found] ` <5ebcd5f1.2a8d.18ced8b011e.Coremail.clancy_shang@163.com>
2024-01-09 13:41 ` Luiz Augusto von Dentz
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).