rpms/kernel/F-10 linux-2.6-bluetooth-submit-bulk-urbs-with-interrupt-urbs.patch, NONE, 1.1 kernel.spec, 1.1352, 1.1353

Chuck Ebbert cebbert at fedoraproject.org
Tue Apr 28 00:23:23 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9874

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-bluetooth-submit-bulk-urbs-with-interrupt-urbs.patch 
Log Message:
Fix some broken bluetooth USB adapters

linux-2.6-bluetooth-submit-bulk-urbs-with-interrupt-urbs.patch:

--- NEW FILE linux-2.6-bluetooth-submit-bulk-urbs-with-interrupt-urbs.patch ---
From: Marcel Holtmann <marcel at holtmann.org>
Date: Wed, 4 Feb 2009 16:41:38 +0000 (+0100)
Subject: Bluetooth: Submit bulk URBs along with interrupt URBs
X-Git-Tag: v2.6.30-rc1~662^2~538^2~20
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=43c2e57f94c15744495fee564610aa24602b3824

Bluetooth: Submit bulk URBs along with interrupt URBs

Submitting the bulk URBs for ACL data transfers only on demand has no
real benefit compared to just submit them when a Bluetooth device gets
opened. So when submitting the interrupt URBs for HCI events, just
submit the bulk URBs, too.

This solves a problem with some Bluetooth USB dongles that has been
reported over the last few month. These devices require that the bulk
URBs are actually present. These devices are really broken, but there
is nothing we can do about it.

Signed-off-by: Marcel Holtmann <marcel at holtmann.org>
---

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index b5fbda6..e70c57e 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -35,7 +35,7 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 
-#define VERSION "0.4"
+#define VERSION "0.5"
 
 static int ignore_dga;
 static int ignore_csr;
@@ -171,6 +171,7 @@ struct btusb_data {
 
 	__u8 cmdreq_type;
 
+	unsigned int sco_num;
 	int isoc_altsetting;
 	int suspend_count;
 };
@@ -496,11 +497,23 @@ static int btusb_open(struct hci_dev *hdev)
 		return 0;
 
 	err = btusb_submit_intr_urb(hdev, GFP_KERNEL);
+	if (err < 0)
+		goto failed;
+
+	err = btusb_submit_bulk_urb(hdev, GFP_KERNEL);
 	if (err < 0) {
-		clear_bit(BTUSB_INTR_RUNNING, &data->flags);
-		clear_bit(HCI_RUNNING, &hdev->flags);
+		usb_kill_anchored_urbs(&data->intr_anchor);
+		goto failed;
 	}
 
+	set_bit(BTUSB_BULK_RUNNING, &data->flags);
+	btusb_submit_bulk_urb(hdev, GFP_KERNEL);
+
+	return 0;
+
+failed:
+	clear_bit(BTUSB_INTR_RUNNING, &data->flags);
+	clear_bit(HCI_RUNNING, &hdev->flags);
 	return err;
 }
 
@@ -655,19 +668,10 @@ static void btusb_notify(struct hci_dev *hdev, unsigned int evt)
 
 	BT_DBG("%s evt %d", hdev->name, evt);
 
-	if (hdev->conn_hash.acl_num > 0) {
-		if (!test_and_set_bit(BTUSB_BULK_RUNNING, &data->flags)) {
-			if (btusb_submit_bulk_urb(hdev, GFP_ATOMIC) < 0)
-				clear_bit(BTUSB_BULK_RUNNING, &data->flags);
-			else
-				btusb_submit_bulk_urb(hdev, GFP_ATOMIC);
-		}
-	} else {
-		clear_bit(BTUSB_BULK_RUNNING, &data->flags);
-		usb_unlink_anchored_urbs(&data->bulk_anchor);
+	if (hdev->conn_hash.sco_num != data->sco_num) {
+		data->sco_num = hdev->conn_hash.sco_num;
+		schedule_work(&data->work);
 	}
-
-	schedule_work(&data->work);
 }
 
 static int inline __set_isoc_interface(struct hci_dev *hdev, int altsetting)
@@ -982,9 +986,11 @@ static int btusb_resume(struct usb_interface *intf)
 	}
 
 	if (test_bit(BTUSB_BULK_RUNNING, &data->flags)) {
-		if (btusb_submit_bulk_urb(hdev, GFP_NOIO) < 0)
+		err = btusb_submit_bulk_urb(hdev, GFP_NOIO);
+		if (err < 0) {
 			clear_bit(BTUSB_BULK_RUNNING, &data->flags);
-		else
+			return err;
+		} else
 			btusb_submit_bulk_urb(hdev, GFP_NOIO);
 	}
 


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/kernel.spec,v
retrieving revision 1.1352
retrieving revision 1.1353
diff -u -p -r1.1352 -r1.1353
--- kernel.spec	27 Apr 2009 19:35:59 -0000	1.1352
+++ kernel.spec	28 Apr 2009 00:22:53 -0000	1.1353
@@ -723,6 +723,9 @@ Patch9502: linux-2.6-x86-hpet-fix-period
 # FPU state can become corrupt
 Patch9510: linux-2.6-x86-64-fix-fpu-corruption-with-signals-and-preemption.patch
 
+# fix some broken bluetooth dongles
+Patch9600: linux-2.6-bluetooth-submit-bulk-urbs-with-interrupt-urbs.patch
+
 # Backport of upstream memory reduction for ftrace
 Patch10000: linux-2.6-ftrace-memory-reduction.patch
 
@@ -1345,6 +1348,8 @@ ApplyPatch linux-2.6-x86-hpet-fix-period
 
 ApplyPatch linux-2.6-x86-64-fix-fpu-corruption-with-signals-and-preemption.patch
 
+ApplyPatch linux-2.6-bluetooth-submit-bulk-urbs-with-interrupt-urbs.patch
+
 # Reduce the memory usage of ftrace if you don't use it.
 ApplyPatch linux-2.6-ftrace-memory-reduction.patch
 
@@ -1924,6 +1929,9 @@ fi
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Mon Apr 27 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.2-53
+- Fix some broken bluetooth USB adapters
+
 * Mon Apr 27 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.2-52
 - Fix possible FPU context corruption on x86-64.
 




More information about the scm-commits mailing list