Bluetooth: Fix using system-global workqueue when not necessary
authorJohan Hedberg <johan.hedberg@intel.com>
Mon, 14 Jan 2013 20:33:52 +0000 (22:33 +0200)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Fri, 18 Jan 2013 04:58:37 +0000 (02:58 -0200)
There's a per-HCI device workqueue (hdev->workqueue) that should be used
for general per-HCI device work (except hdev->req_workqueue that's for
hci_request() related work). This patch fixes places using the
system-global work queue and makes them use the hdev->workqueue instead.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/hci_core.c
net/bluetooth/mgmt.c

index 545553b822955f5ab5c29eaa4a772a3ecec964af..e061b354d2c4a597839d9b6d0250dff6ec36409a 100644 (file)
@@ -1622,8 +1622,8 @@ static int hci_do_le_scan(struct hci_dev *hdev, u8 type, u16 interval,
        if (err < 0)
                return err;
 
-       schedule_delayed_work(&hdev->le_scan_disable,
-                             msecs_to_jiffies(timeout));
+       queue_delayed_work(hdev->workqueue, &hdev->le_scan_disable,
+                          msecs_to_jiffies(timeout));
 
        return 0;
 }
index 54114ff4090f075712d1675736c706e8c7dbfabc..fc171f222ba45859544ca8e0cfd8b064b262b5cd 100644 (file)
@@ -1361,7 +1361,8 @@ static bool enable_service_cache(struct hci_dev *hdev)
                return false;
 
        if (!test_and_set_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) {
-               schedule_delayed_work(&hdev->service_cache, CACHE_TIMEOUT);
+               queue_delayed_work(hdev->workqueue, &hdev->service_cache,
+                                  CACHE_TIMEOUT);
                return true;
        }