Bluetooth: btusb: Fix atheros firmware download error
diff mbox

Message ID 1476775277-23816-2-git-send-email-acelan.kao@canonical.com
State New
Headers show

Commit Message

AceLan Kao Oct. 18, 2016, 7:21 a.m. UTC
From: Ethan Hsieh <ethan.hsieh@canonical.com>

BugLink: http://bugs.launchpad.net/bugs/1634380

Move usb_autopm_get_interface() ahead of setup_on_usb() to prevent
device from sending usb control message in usb suspend mode.

The error message is as below:

[   83.944103] btusb 1-2:1.1: usb_suspend_interface: status 0
[   83.944107] btusb 1-2:1.0: usb_suspend_interface: status 0
[   83.960132] usb 1-2: usb auto-suspend, wakeup 0
[   83.976156] usb 1-2: usb_suspend_device: status 0
[   83.976162] usb 1-2: usb_suspend_both: status 0
[  298.689106] Bluetooth: hci0
[  298.689399] Bluetooth: hci0: Failed to access otp area (-113)

Signed-off-by: Ethan Hsieh <ethan.hsieh@canonical.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
(cherry picked from commit c7e163fe282f34efdf77fb09b333529de97a6a10)
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
---
 drivers/bluetooth/btusb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Tim Gardner Oct. 18, 2016, 1:12 p.m. UTC | #1

Seth Forshee Oct. 21, 2016, 7:43 p.m. UTC | #2
On Tue, Oct 18, 2016 at 03:21:17PM +0800, AceLan Kao wrote:
> From: Ethan Hsieh <ethan.hsieh@canonical.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1634380
> 
> Move usb_autopm_get_interface() ahead of setup_on_usb() to prevent
> device from sending usb control message in usb suspend mode.
> 
> The error message is as below:
> 
> [   83.944103] btusb 1-2:1.1: usb_suspend_interface: status 0
> [   83.944107] btusb 1-2:1.0: usb_suspend_interface: status 0
> [   83.960132] usb 1-2: usb auto-suspend, wakeup 0
> [   83.976156] usb 1-2: usb_suspend_device: status 0
> [   83.976162] usb 1-2: usb_suspend_both: status 0
> [  298.689106] Bluetooth: hci0
> [  298.689399] Bluetooth: hci0: Failed to access otp area (-113)
> 
> Signed-off-by: Ethan Hsieh <ethan.hsieh@canonical.com>
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> (cherry picked from commit c7e163fe282f34efdf77fb09b333529de97a6a10)
> Signed-off-by: AceLan Kao <acelan.kao@canonical.com>

Applied to xenial.

Patch
diff mbox

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 842cf10..be4c24b 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1036,6 +1036,10 @@  static int btusb_open(struct hci_dev *hdev)
 
 	BT_DBG("%s", hdev->name);
 
+	err = usb_autopm_get_interface(data->intf);
+	if (err < 0)
+		return err;
+
 	/* Patching USB firmware files prior to starting any URBs of HCI path
 	 * It is more safe to use USB bulk channel for downloading USB patch
 	 */
@@ -1045,10 +1049,6 @@  static int btusb_open(struct hci_dev *hdev)
 			return err;
 	}
 
-	err = usb_autopm_get_interface(data->intf);
-	if (err < 0)
-		return err;
-
 	data->intf->needs_remote_wakeup = 1;
 
 	if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags))