diff options
author | Ethan Hsieh <ethan.hsieh@canonical.com> | 2016-10-07 00:06:42 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2016-10-07 03:46:56 -0400 |
commit | c7e163fe282f34efdf77fb09b333529de97a6a10 (patch) | |
tree | 0fc552aa32a10b539cca829217436c4c65077fb0 /drivers/bluetooth/btusb.c | |
parent | 1b422066658b7cc985fa020066b72d28159d858f (diff) |
Bluetooth: btusb: Fix atheros firmware download error
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>
Diffstat (limited to 'drivers/bluetooth/btusb.c')
-rw-r--r-- | drivers/bluetooth/btusb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 88962339d4b7..2f633df9f4e6 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -1043,6 +1043,10 @@ static int btusb_open(struct hci_dev *hdev) | |||
1043 | 1043 | ||
1044 | BT_DBG("%s", hdev->name); | 1044 | BT_DBG("%s", hdev->name); |
1045 | 1045 | ||
1046 | err = usb_autopm_get_interface(data->intf); | ||
1047 | if (err < 0) | ||
1048 | return err; | ||
1049 | |||
1046 | /* Patching USB firmware files prior to starting any URBs of HCI path | 1050 | /* Patching USB firmware files prior to starting any URBs of HCI path |
1047 | * It is more safe to use USB bulk channel for downloading USB patch | 1051 | * It is more safe to use USB bulk channel for downloading USB patch |
1048 | */ | 1052 | */ |
@@ -1052,10 +1056,6 @@ static int btusb_open(struct hci_dev *hdev) | |||
1052 | return err; | 1056 | return err; |
1053 | } | 1057 | } |
1054 | 1058 | ||
1055 | err = usb_autopm_get_interface(data->intf); | ||
1056 | if (err < 0) | ||
1057 | return err; | ||
1058 | |||
1059 | data->intf->needs_remote_wakeup = 1; | 1059 | data->intf->needs_remote_wakeup = 1; |
1060 | 1060 | ||
1061 | if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags)) | 1061 | if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags)) |