netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_core: cancel power off delayed work properly
@ 2016-02-15  9:09 Wei-Ning Huang
  2016-02-20  8:12 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Wei-Ning Huang @ 2016-02-15  9:09 UTC (permalink / raw)
  To: Linux Bluetooth
  Cc: LKML, johan.hedberg, snanda, djkurtz, Wei-Ning Huang, marcel,
	gustavo, johan.hedberg, davem, netdev

From: Wei-Ning Huang <wnhuang@chromium.org>

When the HCI_AUTO_OFF flag is cleared, the power_off delayed work need
to be cancel or HCI will be powered off even if it's managed.

Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org>
---
 net/bluetooth/hci_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 47bcef7..f42305a 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2017,6 +2017,7 @@ static void hci_power_on(struct work_struct *work)
 	if (test_bit(HCI_UP, &hdev->flags) &&
 	    hci_dev_test_flag(hdev, HCI_MGMT) &&
 	    hci_dev_test_and_clear_flag(hdev, HCI_AUTO_OFF)) {
+		cancel_delayed_work(&hdev->power_off);
 		hci_req_sync_lock(hdev);
 		err = __hci_req_hci_power_on(hdev);
 		hci_req_sync_unlock(hdev);
-- 
2.7.0.rc3.207.g0ac5344

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

* Re: [PATCH] Bluetooth: hci_core: cancel power off delayed work properly
  2016-02-15  9:09 [PATCH] Bluetooth: hci_core: cancel power off delayed work properly Wei-Ning Huang
@ 2016-02-20  8:12 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2016-02-20  8:12 UTC (permalink / raw)
  To: Wei-Ning Huang
  Cc: Linux Bluetooth, LKML, Johan Hedberg, snanda, djkurtz,
	Gustavo F. Padovan, Johan Hedberg, David S. Miller, netdev

Hi Wei-Ning,

> When the HCI_AUTO_OFF flag is cleared, the power_off delayed work need
> to be cancel or HCI will be powered off even if it's managed.
> 
> Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org>
> ---
> net/bluetooth/hci_core.c | 1 +
> 1 file changed, 1 insertion(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel

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

end of thread, other threads:[~2016-02-20  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-15  9:09 [PATCH] Bluetooth: hci_core: cancel power off delayed work properly Wei-Ning Huang
2016-02-20  8:12 ` Marcel Holtmann

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