Bluetooth: hci0 link tx timeout with Intel Corporation Wireless 7260

Bug #1591167 reported by 7oby on 2016-06-10
40
This bug affects 8 people
Affects Status Importance Assigned to Milestone
linux-firmware (Ubuntu)
Undecided
Unassigned

Bug Description

reported upstream as well : https://bugzilla.kernel.org/show_bug.cgi?id=120161

Starting with Ubuntu 16.04 (no problem in 15.10) the bluetoth stack crashes several times a day:

May 20 11:54:59 thinktank kernel: [ 6274.939039] Bluetooth: hci0 link tx timeout
May 20 11:54:59 thinktank kernel: [ 6274.939046] Bluetooth: hci0 killing stalled connection 7c:6d:62:f1:ef:b1
May 20 11:55:01 thinktank kernel: [ 6276.942116] Bluetooth: hci0 command 0x041f tx timeout
May 20 11:55:03 thinktank kernel: [ 6278.946094] Bluetooth: hci0 command 0x0406 tx timeout

I have an Apple Keyboard and Apple Magicmouse connected and the entire stack is down after seeing the above crash. These are the devices:

input: Apple Wireless Keyboard as /devices/pci0000:00/0000:00:14.0/usb2/2-11/2-11:1.0/bluetooth/hci0/hci0:512/0005:05AC:023A.0002/input/input18
apple 0005:05AC:023A.0002: input,hidraw1: BLUETOOTH HID v0.50 Keyboard [Apple Wireless Keyboard] on 5c:c5:d4:5d:94:7b

input: ... mouse as /devices/pci0000:00/0000:00:14.0/usb2/2-11/2-11:
1.0/bluetooth/hci0/hci0:256/0005:05AC:030D.0001/input/input17
magicmouse 0005:05AC:030D.0001: input,hidraw0: BLUETOOTH HID v0.84 Mouse [... mouse] on 5c:c5:d4:5d:94:7b

No input or re-pairing is possible after those timeout messages. Reloading the kernel firmware modules doesn't help either:

modprobe -r btusb
modprobe btusb

The only way to bring the bluetooth stack up again is to toggle to standby (S3) and wake up the system again. In this case there firmware is reloaded and everything back to life:

May 20 10:10:35 thinktank kernel: [ 10.017143] Bluetooth: hci0: read Intel version: 370710018002030d00
May 20 10:10:35 thinktank kernel: [ 10.019069] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
May 20 10:10:35 thinktank kernel: [ 10.160231] Bluetooth: hci0: Intel Bluetooth firmware patch completed and activated
May 20 10:10:35 thinktank systemd[1]: Starting Bluetooth service...
May 20 10:10:36 thinktank bluetoothd[1147]: Bluetooth daemon 5.37
May 20 10:10:36 thinktank systemd[1]: Reached target Bluetooth.

May 20 10:10:36 thinktank kernel: [ 11.412940] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
May 20 10:10:36 thinktank kernel: [ 11.412943] Bluetooth: BNEP filters: protocol multicast
May 20 10:10:36 thinktank kernel: [ 11.412948] Bluetooth: BNEP socket layer initialized
May 20 10:10:36 thinktank bluetoothd[1147]: Bluetooth management interface 1.10 initialized

Since the problem did not occur with Ubuntu 15.10 I traced the issue down to the changed firmware files:
/lib/firmware/intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
of package linux-firmware

Bad:
$ sha1sum ibt-hw-37.7.10-fw-1.80.2.3.d.bseq.ubuntu
b697de26b72804af9d9385d13e989a72fd364d75 ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
Filesize : 25631

origin:
2016-02-03 linux-firmware: Update firmware patch for Intel Bluetooth 7260 (B3/B4)
http://git.kernel.org/cgit/linux/kernel/git/iwlwifi/linux-firmware.git/commit/intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq?id=7b1a5cb6a2cd379f470058580be2a41f5d5c4867

Good (included in Ubuntu 15.10):

$ sha1sum ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
19f01d6469f30a9b1d7c214615ea39ac5e9d875c ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
Filesize : 25117

origin:
2015-09-24 linux-firmware: Update firmware patch for Intel Bluetooth 7260 (B3/B4)
http://git.kernel.org/cgit/linux/kernel/git/iwlwifi/linux-firmware.git/commit/intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq?id=01f57c63a0d2fd822462b5eedb09ff3a92fbcb29

The numbers in the file name do not correspond to version numbers: Therefore sha1sum and filesize given to distinguish.

According to
http://linuxwireless.org/en/users/Drivers/iwlwifi/#Bugzilla
I may file a bug upstream.

kernel: 4.4.0-22-generic

Bluetooth Device:
$ lsusb -d 8087:07dc
Bus 002 Device 004: ID 8087:07dc Intel Corp.

$ lspci -v
03:00.0 Network controller: Intel Corporation Wireless 7260 (rev 83)
        Subsystem: Intel Corporation Dual Band Wireless-AC 7260

Switching off USB Autosuspend for Bluettooth devices also didn't help:

BTUSB_DEV="8087:07dc"
BTUSB_BINDING="$(lsusb -d "$BTUSB_DEV" |
    cut -f 1 -d : |
    sed -e 's,Bus ,,' -e 's, Device ,/,' |
    xargs -I {} udevadm info -q path -n /dev/bus/usb/{} |
    xargs basename)"

echo "Disabling autosuspend for Bluetooth USB Mouse: $BTUSB_BINDING (old value: $(cat /sys/bus/usb/devices/$BTUSB_BINDING/power/autosuspend_delay_ms))"
echo -1 | sudo tee "/sys/bus/usb/devices/$BTUSB_BINDING/power/autosuspend_delay_ms"

7oby (tobias-hain) on 2016-06-13
description: updated
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-firmware (Ubuntu):
status: New → Confirmed

Experiencing similar problem with intel here too.

7oby (tobias-hain) wrote :

Just replace
/lib/firmware/intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
with the file mentioned in comment #1
https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1591167/comments/1
If it is really the same issue for you - it will fix your problem.

Meanwhile the bug has been fixed for Ubuntu 16.10 (Yakkety Yak):
http://packages.ubuntu.com/yakkety/linux-firmware
linux-firmware (1.160) yakkety includes the fix already:
http://changelogs.ubuntu.com/changelogs/pool/main/l/linux-firmware/linux-firmware_1.161/changelog

Changed in linux-firmware (Ubuntu):
status: Confirmed → Fix Committed
Kapitan (aric81) wrote :

This problem still happens here with:

linux-firmware:
  Installed: 1.161
  Candidate: 1.161

linux-image-lowlatency:
  Installed: 4.8.0.22.31
  Candidate: 4.8.0.22.31

Temporary solving with:
sudo modprobe -r btusb
sudo modprobe btusb

But it happens very very often.

Kapitan (aric81) wrote :

Sorry, hardware for the #5 is:

128:03:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)

and I am open for trying things out ;)

Doug Morse (dm-dougmorse) wrote :

I applied the patched /lib/firmware/intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq as mentioned by @7oby in comment #4 on Ubuntu 16.04.3. No Joy. My control, is a newer:

[ 9.468054] iwlwifi 0000:02:00.0: Detected Intel(R) Dual Band Wireless AC 7265, REV=0x210

but the patched firmware seems to work just fine. (I have rolled back to the original, however.) Hardware is Intel NUC NUC5i5RYH.

Bluetooth has been working fine with my primary bluetooth speaker since I first installed 16.04 shortly after it was released. As of sometime in the last two weeks it sometimes works and sometimes doesn't. The problem appears after I have to reboot. A few days ago, it wasn't working and I just gave up and used a cable. But then at some point after another reboot it started working again. Today it stopped again (no updates during this whole time).

Gotta love intermittent HW-related problems. ;-)

Doug Morse (dm-dougmorse) wrote :

Just to be clear, these are the errors I'm seeing:

root@n1:~# dmesg | grep -i blue
[ 9.402011] Bluetooth: Core ver 2.21
[ 9.402031] Bluetooth: HCI device and connection manager initialized
[ 9.402034] Bluetooth: HCI socket layer initialized
[ 9.402037] Bluetooth: L2CAP socket layer initialized
[ 9.402043] Bluetooth: SCO socket layer initialized
[ 11.429434] Bluetooth: hci0 command 0x0c03 tx timeout
[ 12.076536] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 12.076539] Bluetooth: BNEP filters: protocol multicast
[ 12.076544] Bluetooth: BNEP socket layer initialized
[ 19.425625] Bluetooth: hci0 sending initial HCI reset command failed (-110)
[ 21.429720] Bluetooth: hci0 command 0x0c03 tx timeout
[ 29.425982] Bluetooth: hci0 sending initial HCI reset command failed (-110)

7oby (tobias-hain) wrote :

> I applied the patched /lib/firmware/intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq as mentioned by @7oby in
> comment #4 on Ubuntu 16.04.3. No Joy. My control, is a newer:
>
> [ 9.468054] iwlwifi 0000:02:00.0: Detected Intel(R) Dual Band Wireless AC 7265, REV=0x210

actually AC 7265 has different firmware files than AC 7260. There are even two files depending on your hardware revision. I can't tell which one you have and therefore you may want to replace both:

Intel Bluetooth 7265 (D1)
/lib/firmware/intel/ibt-hw-37.8.10-fw-22.50.19.14.f.bseq
upstream : Release Version: 19.30 (2016/11/30)
Ubuntu 16.04.03: Release Version 18.15 (2016/01/11)

Intel Bluetooth 7265 (C0)
/lib/firmware/intel/ibt-hw-37.8.10-fw-1.10.2.27.d.bseq
upstream : Releaes Version 19.30 (2016/11/30)
Ubuntu 16.04.03: Release Version 18.15 (2016/01/29)

upstream:
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/intel

However from time to time the ubuntu linux-firmware package gets updated even for 16.04:
http://changelogs.ubuntu.com/changelogs/pool/main/l/linux-firmware/linux-firmware_1.157.11/changelog
Anytime you fetch those updates, your custom firmware files get overwritten and your patches have to be reapplied.

Artur Bodera (abodera) wrote :

I'm getting the same error messages but also silent failures.

Having Bluetooth scan enabled it will detect devices correctly for 30-120s, then it will keep discovering fewer and fewer devices to a point at which it can not see any bluetooth devices anymore. Then, after some more time it might start reporting "Bluetooth: hci0 *somethingsomething* command failed"

The only workaround is to:
modprobe -r btusb
modprobe btusb

I'm forced to do it every minute or so when it becomes flaky.

distro: Antergos Linux (Archlinux clone)

uname-a: Linux default 4.12.12-1-ARCH #1 SMP PREEMPT Sun Sep 10 09:41:14 CEST 2017 x86_64 GNU/Linux

lspci: Network controller: Intel Corporation Wireless 3165 (rev 91)

relevant logs:
[ 5.308899] Bluetooth: hci0: read Intel version: 370810011003110e00
[ 5.311044] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-hw-37.8.10-fw-1.10.3.11.e.bseq
[39629.337875] Bluetooth: hci0: read Intel version: 370810011003110e25
[39629.337879] Bluetooth: hci0: Intel device is already patched. patch num: 25

I am using "Linux 4.10.0-35-generic #39~16.04.1-Ubuntu" and I have the same issue with the Bluetooth. I replaced the file:

/lib/firmware/intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq

as mentioned in a previous comment. The problem has been fixed. But still my trackpad frozen for a short time and then wakes up again.

michele orlandi (mik3lo) wrote :

Hope this helps, I think I found a workaround for my bluetooth tethering issue with Android.

NOTE: This assumes that you're using tlp power manager.

Find your bluetooth device like so:

tlp-usblist | grep btusb

Bus 002 Device 011 ID xxxx:yyyy control = on, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb)

add your device to your /etc/default/tlp:
USB_BLACKLIST=xxxx:yyyy

restart tlp in order to load your changes:
sudo service tlp restart

When I received a call the BT device timed out again, but not every 5 minutes like before.

I'll keep testing this and will let you know if confirmed.

michele orlandi (mik3lo) wrote :

just to be clear:

I received a call on my bluetooth headphones...

I "copied" this workaround from here:

https://bbs.archlinux.org/viewtopic.php?id=226312

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.