netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei-Ning Huang <wnhuang@chromium.org>
To: Linux Bluetooth <linux-bluetooth@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	johan.hedberg@intel.com, snanda@chromium.org,
	djkurtz@chromium.org, Wei-Ning Huang <wnhuang@chromium.org>,
	marcel@holtmann.org, gustavo@padovan.org,
	johan.hedberg@gmail.com, davem@davemloft.net,
	netdev@vger.kernel.org
Subject: [PATCH] Bluetooth: hci_core: cancel power off delayed work properly
Date: Mon, 15 Feb 2016 17:09:51 +0800	[thread overview]
Message-ID: <1455527391-13622-1-git-send-email-wnhuang@google.com> (raw)

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

             reply	other threads:[~2016-02-15  9:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15  9:09 Wei-Ning Huang [this message]
2016-02-20  8:12 ` [PATCH] Bluetooth: hci_core: cancel power off delayed work properly Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455527391-13622-1-git-send-email-wnhuang@google.com \
    --to=wnhuang@chromium.org \
    --cc=davem@davemloft.net \
    --cc=djkurtz@chromium.org \
    --cc=gustavo@padovan.org \
    --cc=johan.hedberg@gmail.com \
    --cc=johan.hedberg@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    --cc=snanda@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).