linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] Bluetooth: hci_sync: Fix suspending with wrong filter policy
@ 2024-07-15 14:47 Luiz Augusto von Dentz
  2024-07-15 14:59 ` Paul Menzel
  2024-07-15 15:13 ` [v1] " bluez.test.bot
  0 siblings, 2 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2024-07-15 14:47 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

When suspending the scan filter policy cannot be 0x00 (no acceptlist)
since that means the host has to process every advertisement report
waking up the system, so this attempt to check if hdev is marked as
suspended and the resulting filter policy would be 0x00 (no acceptlist)
then skip passive scanning.

Note: This disables remote wakeup for devices using privacy when LL
privacy is not enabled since that would require the controller to
resolve the addresses.

Fixes: 182ee45da083 ("Bluetooth: hci_sync: Rework hci_suspend_notifier")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/hci_sync.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index cd2ed16da8a4..0996f159c675 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2976,6 +2976,13 @@ static int hci_passive_scan_sync(struct hci_dev *hdev)
 	 */
 	filter_policy = hci_update_accept_list_sync(hdev);
 
+	/* If suspended and filter_policy set to 0x00 (no acceptlist) then
+	 * passive scanning cannot be started since that would require the host
+	 * to be wakeup.
+	 */
+	if (hdev->suspended && !filter_policy)
+		return 0;
+
 	/* When the controller is using random resolvable addresses and
 	 * with that having LE privacy enabled, then controllers with
 	 * Extended Scanner Filter Policies support can now enable support
-- 
2.45.2


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

* Re: [PATCH v1] Bluetooth: hci_sync: Fix suspending with wrong filter policy
  2024-07-15 14:47 [PATCH v1] Bluetooth: hci_sync: Fix suspending with wrong filter policy Luiz Augusto von Dentz
@ 2024-07-15 14:59 ` Paul Menzel
  2024-07-15 15:05   ` Luiz Augusto von Dentz
  2024-07-15 15:13 ` [v1] " bluez.test.bot
  1 sibling, 1 reply; 4+ messages in thread
From: Paul Menzel @ 2024-07-15 14:59 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Dear Luiz,


Thank you for the patch.

Am 15.07.24 um 16:47 schrieb Luiz Augusto von Dentz:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> When suspending the scan filter policy cannot be 0x00 (no acceptlist)
> since that means the host has to process every advertisement report
> waking up the system, so this attempt to check if hdev is marked as

attempt*s*

> suspended and the resulting filter policy would be 0x00 (no acceptlist)

… *if* the …?

> then skip passive scanning.
> 
> Note: This disables remote wakeup for devices using privacy when LL
> privacy is not enabled since that would require the controller to
> resolve the addresses.

Would that regress certain use-cases?

> Fixes: 182ee45da083 ("Bluetooth: hci_sync: Rework hci_suspend_notifier")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
>   net/bluetooth/hci_sync.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index cd2ed16da8a4..0996f159c675 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -2976,6 +2976,13 @@ static int hci_passive_scan_sync(struct hci_dev *hdev)
>   	 */
>   	filter_policy = hci_update_accept_list_sync(hdev);
>   
> +	/* If suspended and filter_policy set to 0x00 (no acceptlist) then
> +	 * passive scanning cannot be started since that would require the host
> +	 * to be wakeup.

to be woken up

> +	 */
> +	if (hdev->suspended && !filter_policy)
> +		return 0;
> +
>   	/* When the controller is using random resolvable addresses and
>   	 * with that having LE privacy enabled, then controllers with
>   	 * Extended Scanner Filter Policies support can now enable support


Kind regards,

Paul

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

* Re: [PATCH v1] Bluetooth: hci_sync: Fix suspending with wrong filter policy
  2024-07-15 14:59 ` Paul Menzel
@ 2024-07-15 15:05   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2024-07-15 15:05 UTC (permalink / raw)
  To: Paul Menzel; +Cc: linux-bluetooth

Hi Paul,

On Mon, Jul 15, 2024 at 11:00 AM Paul Menzel <pmenzel@molgen.mpg.de> wrote:
>
> Dear Luiz,
>
>
> Thank you for the patch.
>
> Am 15.07.24 um 16:47 schrieb Luiz Augusto von Dentz:
> > From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> >
> > When suspending the scan filter policy cannot be 0x00 (no acceptlist)
> > since that means the host has to process every advertisement report
> > waking up the system, so this attempt to check if hdev is marked as
>
> attempt*s*
>
> > suspended and the resulting filter policy would be 0x00 (no acceptlist)
>
> … *if* the …?
>
> > then skip passive scanning.
> >
> > Note: This disables remote wakeup for devices using privacy when LL
> > privacy is not enabled since that would require the controller to
> > resolve the addresses.
>
> Would that regress certain use-cases?

Not apart from what is already stated which is sort of a broke
behavior since any advertisement would result in the system being
woken up which was never the intention. Anyway we do have CI test
cases to cover such regressions.

> > Fixes: 182ee45da083 ("Bluetooth: hci_sync: Rework hci_suspend_notifier")
> > Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> > ---
> >   net/bluetooth/hci_sync.c | 7 +++++++
> >   1 file changed, 7 insertions(+)
> >
> > diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> > index cd2ed16da8a4..0996f159c675 100644
> > --- a/net/bluetooth/hci_sync.c
> > +++ b/net/bluetooth/hci_sync.c
> > @@ -2976,6 +2976,13 @@ static int hci_passive_scan_sync(struct hci_dev *hdev)
> >        */
> >       filter_policy = hci_update_accept_list_sync(hdev);
> >
> > +     /* If suspended and filter_policy set to 0x00 (no acceptlist) then
> > +      * passive scanning cannot be started since that would require the host
> > +      * to be wakeup.
>
> to be woken up
>
> > +      */
> > +     if (hdev->suspended && !filter_policy)
> > +             return 0;
> > +
> >       /* When the controller is using random resolvable addresses and
> >        * with that having LE privacy enabled, then controllers with
> >        * Extended Scanner Filter Policies support can now enable support
>
>
> Kind regards,
>
> Paul



-- 
Luiz Augusto von Dentz

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

* RE: [v1] Bluetooth: hci_sync: Fix suspending with wrong filter policy
  2024-07-15 14:47 [PATCH v1] Bluetooth: hci_sync: Fix suspending with wrong filter policy Luiz Augusto von Dentz
  2024-07-15 14:59 ` Paul Menzel
@ 2024-07-15 15:13 ` bluez.test.bot
  1 sibling, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2024-07-15 15:13 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1421 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=871404

---Test result---

Test Summary:
CheckPatch                    PASS      0.70 seconds
GitLint                       PASS      0.33 seconds
SubjectPrefix                 PASS      0.13 seconds
BuildKernel                   PASS      30.84 seconds
CheckAllWarning               PASS      32.00 seconds
CheckSparse                   PASS      38.57 seconds
CheckSmatch                   PASS      104.84 seconds
BuildKernel32                 PASS      29.16 seconds
TestRunnerSetup               PASS      539.09 seconds
TestRunner_l2cap-tester       PASS      20.03 seconds
TestRunner_iso-tester         PASS      33.41 seconds
TestRunner_bnep-tester        PASS      4.87 seconds
TestRunner_mgmt-tester        PASS      115.79 seconds
TestRunner_rfcomm-tester      PASS      7.65 seconds
TestRunner_sco-tester         PASS      15.16 seconds
TestRunner_ioctl-tester       PASS      8.00 seconds
TestRunner_mesh-tester        PASS      6.03 seconds
TestRunner_smp-tester         PASS      7.02 seconds
TestRunner_userchan-tester    PASS      6.12 seconds
IncrementalBuild              PASS      34.41 seconds



---
Regards,
Linux Bluetooth


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

end of thread, other threads:[~2024-07-15 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-15 14:47 [PATCH v1] Bluetooth: hci_sync: Fix suspending with wrong filter policy Luiz Augusto von Dentz
2024-07-15 14:59 ` Paul Menzel
2024-07-15 15:05   ` Luiz Augusto von Dentz
2024-07-15 15:13 ` [v1] " bluez.test.bot

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