Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: hci_conn: use mod_delayed_work for active mode timeout

hci_conn_enter_active_mode() uses queue_delayed_work() with the
intention that the work will run after the given timeout. However,
queue_delayed_work() does nothing if the work is already queued, so
depending on the link policy we may end up putting the connection
into idle mode every hdev->idle_timeout ms.

Use mod_delayed_work() instead so the work is queued if not already
queued, and the timeout is updated otherwise.

Signed-off-by: Stefan Sørensen <ssorensen@roku.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Stefan Sørensen and committed by
Luiz Augusto von Dentz
49d0901e 544a237a

+2 -2
+2 -2
net/bluetooth/hci_conn.c
··· 2619 2619 2620 2620 timer: 2621 2621 if (hdev->idle_timeout > 0) 2622 - queue_delayed_work(hdev->workqueue, &conn->idle_work, 2623 - msecs_to_jiffies(hdev->idle_timeout)); 2622 + mod_delayed_work(hdev->workqueue, &conn->idle_work, 2623 + msecs_to_jiffies(hdev->idle_timeout)); 2624 2624 } 2625 2625 2626 2626 /* Drop all connection on the device */