This is a note to let you know that I've just added the patch titled

    Bluetooth: Fix HCI_RESET command synchronization

to the 2.6.38-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bluetooth-fix-hci_reset-command-synchronization.patch
and it can be found in the queue-2.6.38 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From f630cf0d5434e3923e1b8226ffa2753ead6b0ce5 Mon Sep 17 00:00:00 2001
From: Gustavo F. Padovan <[email protected]>
Date: Wed, 16 Mar 2011 15:36:29 -0300
Subject: Bluetooth: Fix HCI_RESET command synchronization

From: Gustavo F. Padovan <[email protected]>

commit f630cf0d5434e3923e1b8226ffa2753ead6b0ce5 upstream.

We can't send new commands before a cmd_complete for the HCI_RESET command
shows up.

Reported-by: Mikko Vinni <[email protected]>
Reported-by: Justin P. Mattock <[email protected]>
Reported-by: Ed Tomlinson <[email protected]>
Signed-off-by: Gustavo F. Padovan <[email protected]>
Tested-by: Justin P. Mattock <[email protected]>
Tested-by: Mikko Vinni <[email protected]>
Tested-by: Ed Tomlinson <[email protected]>


---
 include/net/bluetooth/hci.h |    2 ++
 net/bluetooth/hci_core.c    |    5 ++++-
 net/bluetooth/hci_event.c   |    4 +++-
 3 files changed, 9 insertions(+), 2 deletions(-)

--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -76,6 +76,8 @@ enum {
        HCI_INQUIRY,
 
        HCI_RAW,
+
+       HCI_RESET,
 };
 
 /* HCI ioctl defines */
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -184,6 +184,7 @@ static void hci_reset_req(struct hci_dev
        BT_DBG("%s %ld", hdev->name, opt);
 
        /* Reset device */
+       set_bit(HCI_RESET, &hdev->flags);
        hci_send_cmd(hdev, HCI_OP_RESET, 0, NULL);
 }
 
@@ -210,8 +211,10 @@ static void hci_init_req(struct hci_dev
        /* Mandatory initialization */
 
        /* Reset */
-       if (!test_bit(HCI_QUIRK_NO_RESET, &hdev->quirks))
+       if (!test_bit(HCI_QUIRK_NO_RESET, &hdev->quirks)) {
+                       set_bit(HCI_RESET, &hdev->flags);
                        hci_send_cmd(hdev, HCI_OP_RESET, 0, NULL);
+       }
 
        /* Read Local Supported Features */
        hci_send_cmd(hdev, HCI_OP_READ_LOCAL_FEATURES, 0, NULL);
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -183,6 +183,8 @@ static void hci_cc_reset(struct hci_dev
 
        BT_DBG("%s status 0x%x", hdev->name, status);
 
+       clear_bit(HCI_RESET, &hdev->flags);
+
        hci_req_complete(hdev, HCI_OP_RESET, status);
 }
 
@@ -1464,7 +1466,7 @@ static inline void hci_cmd_status_evt(st
                break;
        }
 
-       if (ev->ncmd) {
+       if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) {
                atomic_set(&hdev->cmd_cnt, 1);
                if (!skb_queue_empty(&hdev->cmd_q))
                        tasklet_schedule(&hdev->cmd_task);


Patches currently in stable-queue which might be from [email protected] are

queue-2.6.38/bluetooth-fix-hci_reset-command-synchronization.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to