Re: [PATCH] Bluetooth: Pause service discovery for suspend

From: Marcel Holtmann
Date: Fri Dec 18 2020 - 16:32:23 EST


Hi Abhishek,

> Just like MGMT_OP_START_DISCOVERY, we should reject
> MGMT_OP_START_SERVICE_DISCOVERY with MGMT_STATUS_BUSY when we are paused
> for suspend.
>
> Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@xxxxxxxxxxxx>
> ---
> On ChromeOS, we started getting reports of scanning failing after
> resuming from suspend. The root cause was that Start Service Discovery
> was being called while discovery was supposed to be paused for suspend
> and it was screwing up some internal state. Adding this check
> immediately fixed it.
>
> The fix was tested by doing the following:
> * Set Discovery Filter ({'transport': 'auto'})
> * Start Discovery
> * Suspend
> * Resume
> * Check the Discovering property
>
> Without the fix, this test failed when checking the Discovering
> property above.
>
> net/bluetooth/mgmt.c | 8 ++++++++
> 1 file changed, 8 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel