Skip to content
/ linux Public

Commit 07960da

Browse files
ssorensenrokuSasha Levin
authored andcommitted
Bluetooth: hci_conn: use mod_delayed_work for active mode timeout
[ Upstream commit 49d0901 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c06dbfd commit 07960da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/bluetooth/hci_conn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,8 +2518,8 @@ void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active)
25182518

25192519
timer:
25202520
if (hdev->idle_timeout > 0)
2521-
queue_delayed_work(hdev->workqueue, &conn->idle_work,
2522-
msecs_to_jiffies(hdev->idle_timeout));
2521+
mod_delayed_work(hdev->workqueue, &conn->idle_work,
2522+
msecs_to_jiffies(hdev->idle_timeout));
25232523
}
25242524

25252525
/* Drop all connection on the device */

0 commit comments

Comments
 (0)