All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] Bluetooth: Set missing suspend task bits
@ 2020-12-04  3:14 Howard Chung
  2020-12-04  4:08 ` [v1] " bluez.test.bot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Howard Chung @ 2020-12-04  3:14 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: alainm, mmandlik, mcchou, marcel, abhishekpandit, apusaka,
	Howard Chung, David S. Miller, Jakub Kicinski, Johan Hedberg,
	linux-kernel, netdev

From: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>

When suspending, mark SUSPEND_SCAN_ENABLE and SUSPEND_SCAN_DISABLE tasks
correctly when either classic or le scanning is modified.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Howard Chung <howardchung@google.com>
Reviewed-by: Alain Michaud <alainm@chromium.org>
---

 net/bluetooth/hci_request.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 80dc451d6e124..71bffd7454720 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -707,6 +707,9 @@ void hci_req_add_le_scan_disable(struct hci_request *req, bool rpa_le_conn)
 		return;
 	}
 
+	if (hdev->suspended)
+		set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks);
+
 	if (use_ext_scan(hdev)) {
 		struct hci_cp_le_set_ext_scan_enable cp;
 
@@ -1159,6 +1162,11 @@ static void hci_req_set_event_filter(struct hci_request *req)
 		scan = SCAN_PAGE;
 	}
 
+	if (scan)
+		set_bit(SUSPEND_SCAN_ENABLE, hdev->suspend_tasks);
+	else
+		set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks);
+
 	hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
 }
 
-- 
2.29.2.576.ga3fc446d84-goog


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

* RE: [v1] Bluetooth: Set missing suspend task bits
  2020-12-04  3:14 [PATCH v1] Bluetooth: Set missing suspend task bits Howard Chung
@ 2020-12-04  4:08 ` bluez.test.bot
  2020-12-04  9:55 ` [PATCH v1] " Marcel Holtmann
  2020-12-21 14:35 ` Dmitry Osipenko
  2 siblings, 0 replies; 6+ messages in thread
From: bluez.test.bot @ 2020-12-04  4:08 UTC (permalink / raw)
  To: linux-bluetooth, howardchung

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

---Test result---

##############################
Test: CheckPatch - PASS

##############################
Test: CheckGitLint - PASS

##############################
Test: CheckBuildK - PASS



---
Regards,
Linux Bluetooth


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

* Re: [PATCH v1] Bluetooth: Set missing suspend task bits
  2020-12-04  3:14 [PATCH v1] Bluetooth: Set missing suspend task bits Howard Chung
  2020-12-04  4:08 ` [v1] " bluez.test.bot
@ 2020-12-04  9:55 ` Marcel Holtmann
  2020-12-21 14:35 ` Dmitry Osipenko
  2 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2020-12-04  9:55 UTC (permalink / raw)
  To: Howard Chung
  Cc: linux-bluetooth, Alain Michaud, Manish Mandlik, Miao-chen Chou,
	Abhishek Pandit-Subedi, Archie Pusaka, David S. Miller,
	Jakub Kicinski, Johan Hedberg, LKML, netdev

Hi Howard,

> When suspending, mark SUSPEND_SCAN_ENABLE and SUSPEND_SCAN_DISABLE tasks
> correctly when either classic or le scanning is modified.
> 
> Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> Signed-off-by: Howard Chung <howardchung@google.com>
> Reviewed-by: Alain Michaud <alainm@chromium.org>
> ---
> 
> net/bluetooth/hci_request.c | 8 ++++++++
> 1 file changed, 8 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

* Re: [PATCH v1] Bluetooth: Set missing suspend task bits
  2020-12-04  3:14 [PATCH v1] Bluetooth: Set missing suspend task bits Howard Chung
  2020-12-04  4:08 ` [v1] " bluez.test.bot
  2020-12-04  9:55 ` [PATCH v1] " Marcel Holtmann
@ 2020-12-21 14:35 ` Dmitry Osipenko
  2020-12-21 17:58   ` Abhishek Pandit-Subedi
  2 siblings, 1 reply; 6+ messages in thread
From: Dmitry Osipenko @ 2020-12-21 14:35 UTC (permalink / raw)
  To: Howard Chung, linux-bluetooth
  Cc: alainm, mmandlik, mcchou, marcel, abhishekpandit, apusaka,
	David S. Miller, Jakub Kicinski, Johan Hedberg, linux-kernel,
	netdev

04.12.2020 06:14, Howard Chung пишет:
> From: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> 
> When suspending, mark SUSPEND_SCAN_ENABLE and SUSPEND_SCAN_DISABLE tasks
> correctly when either classic or le scanning is modified.
> 
> Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> Signed-off-by: Howard Chung <howardchung@google.com>
> Reviewed-by: Alain Michaud <alainm@chromium.org>
> ---
> 
>  net/bluetooth/hci_request.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
> index 80dc451d6e124..71bffd7454720 100644
> --- a/net/bluetooth/hci_request.c
> +++ b/net/bluetooth/hci_request.c
> @@ -707,6 +707,9 @@ void hci_req_add_le_scan_disable(struct hci_request *req, bool rpa_le_conn)
>  		return;
>  	}
>  
> +	if (hdev->suspended)
> +		set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks);
> +
>  	if (use_ext_scan(hdev)) {
>  		struct hci_cp_le_set_ext_scan_enable cp;
>  
> @@ -1159,6 +1162,11 @@ static void hci_req_set_event_filter(struct hci_request *req)
>  		scan = SCAN_PAGE;
>  	}
>  
> +	if (scan)
> +		set_bit(SUSPEND_SCAN_ENABLE, hdev->suspend_tasks);
> +	else
> +		set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks);
> +
>  	hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
>  }
>  
> 

Hi,

This commit caused a regression on entering into suspend for Broadcom
Bluetooth 4330 on Nexus 7:

 Bluetooth: hci0: Timed out waiting for suspend events
 Bluetooth: hci0: Suspend timeout bit: 4
 Bluetooth: hci0: Suspend notifier action (3) failed: -110

I don't see this problem using BCM4329 chip on another device.

Please fix, thanks in advance.

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

* Re: [PATCH v1] Bluetooth: Set missing suspend task bits
  2020-12-21 14:35 ` Dmitry Osipenko
@ 2020-12-21 17:58   ` Abhishek Pandit-Subedi
  2020-12-21 18:19     ` Dmitry Osipenko
  0 siblings, 1 reply; 6+ messages in thread
From: Abhishek Pandit-Subedi @ 2020-12-21 17:58 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Howard Chung, Bluez mailing list, Alain Michaud, Manish Mandlik,
	Miao-chen Chou, Marcel Holtmann, apusaka, David S. Miller,
	Jakub Kicinski, Johan Hedberg, LKML, netdev

Hi Dmitry,

https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/?id=295fa2a5647b13681594bb1bcc76c74619035218
should fix this issue.

Your issue seems the same as the one I encountered -- the
SUSPEND_DISABLE bit (0x4) wasn't being cleared by the request
completion handler.

Thanks,
Abhishek

On Mon, Dec 21, 2020 at 6:35 AM Dmitry Osipenko <digetx@gmail.com> wrote:
>
> 04.12.2020 06:14, Howard Chung пишет:
> > From: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> >
> > When suspending, mark SUSPEND_SCAN_ENABLE and SUSPEND_SCAN_DISABLE tasks
> > correctly when either classic or le scanning is modified.
> >
> > Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> > Signed-off-by: Howard Chung <howardchung@google.com>
> > Reviewed-by: Alain Michaud <alainm@chromium.org>
> > ---
> >
> >  net/bluetooth/hci_request.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
> > index 80dc451d6e124..71bffd7454720 100644
> > --- a/net/bluetooth/hci_request.c
> > +++ b/net/bluetooth/hci_request.c
> > @@ -707,6 +707,9 @@ void hci_req_add_le_scan_disable(struct hci_request *req, bool rpa_le_conn)
> >               return;
> >       }
> >
> > +     if (hdev->suspended)
> > +             set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks);
> > +
> >       if (use_ext_scan(hdev)) {
> >               struct hci_cp_le_set_ext_scan_enable cp;
> >
> > @@ -1159,6 +1162,11 @@ static void hci_req_set_event_filter(struct hci_request *req)
> >               scan = SCAN_PAGE;
> >       }
> >
> > +     if (scan)
> > +             set_bit(SUSPEND_SCAN_ENABLE, hdev->suspend_tasks);
> > +     else
> > +             set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks);
> > +
> >       hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
> >  }
> >
> >
>
> Hi,
>
> This commit caused a regression on entering into suspend for Broadcom
> Bluetooth 4330 on Nexus 7:
>
>  Bluetooth: hci0: Timed out waiting for suspend events
>  Bluetooth: hci0: Suspend timeout bit: 4
>  Bluetooth: hci0: Suspend notifier action (3) failed: -110
>
> I don't see this problem using BCM4329 chip on another device.
>
> Please fix, thanks in advance.

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

* Re: [PATCH v1] Bluetooth: Set missing suspend task bits
  2020-12-21 17:58   ` Abhishek Pandit-Subedi
@ 2020-12-21 18:19     ` Dmitry Osipenko
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Osipenko @ 2020-12-21 18:19 UTC (permalink / raw)
  To: Abhishek Pandit-Subedi
  Cc: Howard Chung, Bluez mailing list, Alain Michaud, Manish Mandlik,
	Miao-chen Chou, Marcel Holtmann, apusaka, David S. Miller,
	Jakub Kicinski, Johan Hedberg, LKML, netdev

21.12.2020 20:58, Abhishek Pandit-Subedi пишет:
> Hi Dmitry,
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/?id=295fa2a5647b13681594bb1bcc76c74619035218
> should fix this issue.
> 
> Your issue seems the same as the one I encountered -- the
> SUSPEND_DISABLE bit (0x4) wasn't being cleared by the request
> completion handler.

Hello Abhishek,

It fixes the problem using today's linux-next, which already includes
that commit, thank you.

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

end of thread, other threads:[~2020-12-21 18:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04  3:14 [PATCH v1] Bluetooth: Set missing suspend task bits Howard Chung
2020-12-04  4:08 ` [v1] " bluez.test.bot
2020-12-04  9:55 ` [PATCH v1] " Marcel Holtmann
2020-12-21 14:35 ` Dmitry Osipenko
2020-12-21 17:58   ` Abhishek Pandit-Subedi
2020-12-21 18:19     ` Dmitry Osipenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.