From e6da88d7e77de3963dddb5dc68dc1db2f0697f9e Mon Sep 17 00:00:00 2001 From: Sumit Bajpai Date: Thu, 14 Mar 2013 15:16:56 +0530 Subject: [PATCH] Bluetooth: Remove wake_locks added for BT idle timer Wakelocks were used to address the issue related to timer which was not triggered when device was put into suspend mode.This does not impact the usecases as the link would be put into sniff mode immediately after the device comes out of suspend mode. Change-Id: I648acf32c6ce9bd0d3415ac0e9dcd2250d3fb68d Signed-off-by: Sumit Bajpai --- include/net/bluetooth/hci_core.h | 2 -- net/bluetooth/hci_conn.c | 3 --- net/bluetooth/hci_event.c | 3 --- 3 files changed, 8 deletions(-) diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index efc11bb4f32..c68d4271328 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -26,7 +26,6 @@ #define __HCI_CORE_H #include -#include /* HCI upper protocols */ #define HCI_PROTO_L2CAP 0 #define HCI_PROTO_SCO 1 @@ -327,7 +326,6 @@ struct hci_conn { struct work_struct work_add; struct work_struct work_del; - struct wake_lock idle_lock; struct device dev; atomic_t devref; diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 50f73bebdd2..7ffcc1bb6b2 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -543,7 +543,6 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, conn->disc_timeout = HCI_DISCONN_TIMEOUT; conn->conn_valid = true; spin_lock_init(&conn->lock); - wake_lock_init(&conn->idle_lock, WAKE_LOCK_SUSPEND, "bt_idle"); switch (type) { case ACL_LINK: @@ -621,7 +620,6 @@ int hci_conn_del(struct hci_conn *conn) /* Make sure no timers are running */ del_timer(&conn->idle_timer); - wake_lock_destroy(&conn->idle_lock); del_timer(&conn->disc_timer); del_timer(&conn->smp_timer); __cancel_delayed_work(&conn->rssi_update_work); @@ -1082,7 +1080,6 @@ timer: if (conn->conn_valid) { mod_timer(&conn->idle_timer, jiffies + msecs_to_jiffies(hdev->idle_timeout)); - wake_lock(&conn->idle_lock); } spin_unlock_bh(&conn->lock); } diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 198773c1cc7..d2436465f8e 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -2596,9 +2596,6 @@ static inline void hci_mode_change_evt(struct hci_dev *hdev, struct sk_buff *skb else conn->power_save = 0; } - if (conn->mode == HCI_CM_SNIFF) - if (wake_lock_active(&conn->idle_lock)) - wake_unlock(&conn->idle_lock); if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, &conn->pend)) hci_sco_setup(conn, ev->status);