packages: kernel/kernel-small_fixes.patch - bt fix

arekm arekm at pld-linux.org
Sat Mar 19 22:56:10 CET 2011


Author: arekm                        Date: Sat Mar 19 21:56:10 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- bt fix

---- Files affected:
packages/kernel:
   kernel-small_fixes.patch (1.21 -> 1.22) 

---- Diffs:

================================================================
Index: packages/kernel/kernel-small_fixes.patch
diff -u packages/kernel/kernel-small_fixes.patch:1.21 packages/kernel/kernel-small_fixes.patch:1.22
--- packages/kernel/kernel-small_fixes.patch:1.21	Tue Mar  8 21:38:28 2011
+++ packages/kernel/kernel-small_fixes.patch	Sat Mar 19 22:56:04 2011
@@ -117,3 +117,89 @@
  	sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
  }
 
+From: Gustavo F. Padovan <padovan at profusion.mobi>
+Date: Wed, 16 Mar 2011 18:36:29 +0000 (-0300)
+Subject: Bluetooth: Fix HCI_RESET command synchronization
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fpadovan%2Fbluetooth-next-2.6.git;a=commitdiff_plain;h=b99faf1b798d6d0e33526fd2cef55a405c08ff09;hp=58b6e124aac64bebb2e9e1a136cbd21a5ab0485a
+
+Bluetooth: Fix HCI_RESET command synchronization
+
+We can't send new commands before a cmd_complete for the HCI_RESET command
+shows up.
+
+Reported-by: Mikko Vinni <mmvinni at yahoo.com>
+Reported-by: Justin P. Mattock <justinmattock at gmail.com>
+Reported-by: Ed Tomlinson <edt at aei.ca>
+Signed-off-by: Gustavo F. Padovan <padovan at profusion.mobi>
+Tested-by: Justin P. Mattock <justinmattock at gmail.com>
+Tested-by: Mikko Vinni <mmvinni at yahoo.com>
+Tested-by: Ed Tomlinson <edt at aei.ca>
+---
+
+diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
+index ec6acf2..2c0d309 100644
+--- a/include/net/bluetooth/hci.h
++++ b/include/net/bluetooth/hci.h
+@@ -84,6 +84,8 @@ enum {
+ 	HCI_SERVICE_CACHE,
+ 	HCI_LINK_KEYS,
+ 	HCI_DEBUG_KEYS,
++
++	HCI_RESET,
+ };
+ 
+ /* HCI ioctl defines */
+diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
+index b372fb8..92b48e2 100644
+--- a/net/bluetooth/hci_core.c
++++ b/net/bluetooth/hci_core.c
+@@ -186,6 +186,7 @@ static void hci_reset_req(struct hci_dev *hdev, unsigned long opt)
+ 	BT_DBG("%s %ld", hdev->name, opt);
+ 
+ 	/* Reset device */
++	set_bit(HCI_RESET, &hdev->flags);
+ 	hci_send_cmd(hdev, HCI_OP_RESET, 0, NULL);
+ }
+ 
+@@ -213,8 +214,10 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt)
+ 	/* 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);
+@@ -1074,6 +1077,7 @@ static void hci_cmd_timer(unsigned long arg)
+ 
+ 	BT_ERR("%s command tx timeout", hdev->name);
+ 	atomic_set(&hdev->cmd_cnt, 1);
++	clear_bit(HCI_RESET, &hdev->flags);
+ 	tasklet_schedule(&hdev->cmd_task);
+ }
+ 
+diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
+index 3fbfa50..cebe7588 100644
+--- a/net/bluetooth/hci_event.c
++++ b/net/bluetooth/hci_event.c
+@@ -183,6 +183,8 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb)
+ 
+ 	BT_DBG("%s status 0x%x", hdev->name, status);
+ 
++	clear_bit(HCI_RESET, &hdev->flags);
++
+ 	hci_req_complete(hdev, HCI_OP_RESET, status);
+ }
+ 
+@@ -1847,7 +1849,7 @@ static inline void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb)
+ 	if (ev->opcode != HCI_OP_NOP)
+ 		del_timer(&hdev->cmd_timer);
+ 
+-	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);
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel/kernel-small_fixes.patch?r1=1.21&r2=1.22&f=u



More information about the pld-cvs-commit mailing list