]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Remove unneeded locking
authorAndre Guedes <andre.guedes@openbossa.org>
Fri, 27 Jan 2012 22:42:03 +0000 (19:42 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Apr 2012 22:38:55 +0000 (15:38 -0700)
commit e72acc13c770a82b4ce4a07e9716f29320eae0f8 upstream.

We don't need locking hdev in hci_conn_timeout() since it doesn't
access any hdev's shared resources, it basically queues HCI commands.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Reviewed-by: Ulisses Furquim <ulisses@profusion.mobi>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Tested-by: Alexander Holler <holler@ahsoftware.de>
[reported to fix lockups on battery-powered bluetooth devices - gregkh]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bluetooth/hci_conn.c

index 07bc69ed9498c276e272d9215a3189b0df7beb30..280953bf9927bd1f31f30e5fe96db2bba4cc6f30 100644 (file)
@@ -279,7 +279,6 @@ static void hci_conn_timeout(struct work_struct *work)
 {
        struct hci_conn *conn = container_of(work, struct hci_conn,
                                                        disc_work.work);
-       struct hci_dev *hdev = conn->hdev;
        __u8 reason;
 
        BT_DBG("conn %p state %d", conn, conn->state);
@@ -287,8 +286,6 @@ static void hci_conn_timeout(struct work_struct *work)
        if (atomic_read(&conn->refcnt))
                return;
 
-       hci_dev_lock(hdev);
-
        switch (conn->state) {
        case BT_CONNECT:
        case BT_CONNECT2:
@@ -308,8 +305,6 @@ static void hci_conn_timeout(struct work_struct *work)
                conn->state = BT_CLOSED;
                break;
        }
-
-       hci_dev_unlock(hdev);
 }
 
 /* Enter sniff mode */