]> git.ipfire.org Git - people/ms/linux.git/commitdiff
Bluetooth: ath3k: workaround the compatibility issue with xHCI controller
authorAdam Lee <adam.lee@canonical.com>
Thu, 12 Feb 2015 05:42:31 +0000 (13:42 +0800)
committerJiri Slaby <jslaby@suse.cz>
Mon, 16 Feb 2015 11:05:41 +0000 (12:05 +0100)
commit c561a5753dd631920c4459a067d22679b3d110d6 upstream.

BugLink: https://bugs.launchpad.net/bugs/1400215
ath3k devices fail to load firmwares on xHCI buses, but work well on
EHCI, this might be a compatibility issue between xHCI and ath3k chips.
As my testing result, those chips will work on xHCI buses again with
this patch.

This workaround is from Qualcomm, they also did some workarounds in
Windows driver.

Signed-off-by: Adam Lee <adam.lee@canonical.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/bluetooth/ath3k.c

index 1685b3c50db1f01b9a5813f70a1726bc85434624..fa6a7900972468984e088defa90bc3c9077d17af 100644 (file)
@@ -168,6 +168,8 @@ static struct usb_device_id ath3k_blist_tbl[] = {
 #define USB_REQ_DFU_DNLOAD     1
 #define BULK_SIZE              4096
 #define FW_HDR_SIZE            20
+#define TIMEGAP_USEC_MIN       50
+#define TIMEGAP_USEC_MAX       100
 
 static int ath3k_load_firmware(struct usb_device *udev,
                                const struct firmware *firmware)
@@ -198,6 +200,9 @@ static int ath3k_load_firmware(struct usb_device *udev,
        count -= 20;
 
        while (count) {
+               /* workaround the compatibility issue with xHCI controller*/
+               usleep_range(TIMEGAP_USEC_MIN, TIMEGAP_USEC_MAX);
+
                size = min_t(uint, count, BULK_SIZE);
                pipe = usb_sndbulkpipe(udev, 0x02);
                memcpy(send_buf, firmware->data + sent, size);
@@ -294,6 +299,9 @@ static int ath3k_load_fwfile(struct usb_device *udev,
        count -= size;
 
        while (count) {
+               /* workaround the compatibility issue with xHCI controller*/
+               usleep_range(TIMEGAP_USEC_MIN, TIMEGAP_USEC_MAX);
+
                size = min_t(uint, count, BULK_SIZE);
                pipe = usb_sndbulkpipe(udev, 0x02);