2018-03-15 06:46:38

by Robert R. Howell

[permalink] [raw]
Subject: [PATCH] Bluetooth: hci_bcm: Keep runtime resumed on packet reception

From: Robert R. Howell <[email protected]>

Commit 43fff7683468 ("Bluetooth: hci_bcm: Streamline runtime PM code")
broke runtime PM on Baytrail machines such as the ASUS T100 and perhaps
other devices because the call to pm_request_resume() became a no-op
if the device was already runtime resumed. The purpose of the code it
replaced appears to have been to keep the device awake for another
5 seconds on receipt of a full packet. Reinstate that behavior.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=198953
Fixes: 43fff7683468 ("Bluetooth: hci_bcm: Streamline runtime PM code")
Signed-off-by: Robert R. Howell <[email protected]>
---
drivers/bluetooth/hci_bcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 6314dfb02969..3633710080b1 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -587,7 +587,7 @@ static int bcm_recv(struct hci_uart *hu, const void *data, int count)
/* Delay auto-suspend when receiving completed packet */
mutex_lock(&bcm_device_lock);
if (bcm->dev && bcm_device_exists(bcm->dev))
- pm_request_resume(bcm->dev->dev);
+ pm_runtime_mark_last_busy(bcm->dev->dev);
mutex_unlock(&bcm_device_lock);
}

--
2.13.6


2018-03-15 18:33:44

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hci_bcm: Keep runtime resumed on packet reception

Hi Robert,

> Commit 43fff7683468 ("Bluetooth: hci_bcm: Streamline runtime PM code")
> broke runtime PM on Baytrail machines such as the ASUS T100 and perhaps
> other devices because the call to pm_request_resume() became a no-op
> if the device was already runtime resumed. The purpose of the code it
> replaced appears to have been to keep the device awake for another
> 5 seconds on receipt of a full packet. Reinstate that behavior.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=198953
> Fixes: 43fff7683468 ("Bluetooth: hci_bcm: Streamline runtime PM code")
> Signed-off-by: Robert R. Howell <[email protected]>
> ---
> drivers/bluetooth/hci_bcm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

the decision was to revert that commit and rather work out something better later. So I am doing the revert.

Regards

Marcel