bt devices lost with no way to recover them

Bug #1169961 reported by Vincent Ladeuil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linux
Confirmed
Medium
linux (Ubuntu)
Incomplete
Medium
Unassigned

Bug Description

I use a bluetooth keyboard and mouse since... years.

Lately, I've seen weird disconnections occurring but have never been able to diagnose them properly so I lived with it and reconnect. Sometimes once a day, sometimes 3 or 4 times.

Since yesterday though, things are worse: I can't manage to reconnect neither the mouse nor the keyboard at all.

I found bug #1075487 with many comments leading me to think the problem is known, understood and that even some patches may apply.

https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/1075478/comments/11 in particular seems relevant:

> This bug is because of kernel upstream bug https://bugzilla.kernel.org/show_bug.cgi?id=52471

> All the info is in that bug report, including 2 patches to fix it.

> In short form, the (doomed to fail by timeout) battery status reporting injects a 5 second delay in keyboard device removal. Due to races in the kernel bluetooth code, this leads the code to remove devices from sysfs in the wrong order. This in turn leads to udev events being sent out with truncated device paths.

> This in turn causes Xorg evdev to receive the 'remove' events, but ignore them because they cannot match them up.

> When the keyboard re-connects, Xorg then sees the 'add' events matching a keyboard it thinks it already has, so ignores them ... so your keyboard doesn't work (or mouse too, if bluetooth as well!).

I found evidence of:
- the faulty battery status report,
- Xorg now refusing to accept the bt devices when reconnecting.

Needless to say, having to hard reboot because no more input devices are available is painful.

Finally, this (no way to reconnect) started this morning or may be yesterday (I can't confirm it was caused by the last kernel update but this sounds 90% likely).

Feel free to contact me for more testing or information.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: linux-image-3.8.0-18-generic 3.8.0-18.28
ProcVersionSignature: Ubuntu 3.8.0-18.28-generic 3.8.6
Uname: Linux 3.8.0-18-generic x86_64
ApportVersion: 2.9.2-0ubuntu8
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: vila 4239 F.... pulseaudio
 /dev/snd/controlC1: vila 4239 F.... pulseaudio
CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1: nl80211 not found.
Date: Wed Apr 17 15:14:37 2013
InstallationDate: Installed on 2011-06-23 (663 days ago)
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64+mac (20110427.1)
MachineType: System manufacturer System Product Name
MarkForUpload: True
ProcFB: 0 radeondrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.8.0-18-generic root=UUID=9e03ea1c-298d-4b96-9870-4db1fe183774 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-3.8.0-18-generic N/A
 linux-backports-modules-3.8.0-18-generic N/A
 linux-firmware 1.105
RfKill:
 0: hci0: Bluetooth
  Soft blocked: no
  Hard blocked: no
SourcePackage: linux
UpgradeStatus: Upgraded to raring on 2013-03-17 (31 days ago)
dmi.bios.date: 12/05/2008
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 1003
dmi.board.asset.tag: To Be Filled By O.E.M.
dmi.board.name: P6T DELUXE
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr1003:bd12/05/2008:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP6TDELUXE:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
Vincent Ladeuil (vila) wrote :
Revision history for this message
Brad Figg (brad-figg) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v3.9 kernel[0]. You will need to install both the linux-image and linux-image-extra .deb packages.

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.
Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.9-rc7-raring/

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Revision history for this message
Vincent Ladeuil (vila) wrote :
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Thanks for pointing that out. There should be an extras package, I'll check if there was a build failure.

Vincent Ladeuil (vila)
description: updated
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

After checking, we will no longer be building the extras package. So it should be fine to just install v3.9-rc7 without the extras package.

Changed in linux:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Vincent Ladeuil (vila) wrote :

v3.9-rc7 installed and things are running so far but it's too soon to confirm the bug is fixed since I don't have a reliable way to trigger it (ideas welcome ;).

Vincent Ladeuil (vila)
tags: added: kernel-bug-exists-upstream
Revision history for this message
Vincent Ladeuil (vila) wrote :

The good old trick about mentioning that a bug doesn't occur anymore worked once again.

This has been reproduced with v3.9-rc7-raring.

Some more observations:

- at least once, I was able to regain the bt devices by forcing them to reconnect with:

  hcitool dc 60:FB:42:04:C5:3E
  hcitool dc 60:FB:42:FD:08:CB

  the devices re-appeared in 'xinput --list' output but twice (the wedged one and the working one)

  But the bug manifested itself again and the above trick didn't work anymore.
  Additionally, plugging a USB kbd didn't help even if it appeared in xinput output.

- with the v3.9-rc7-raring kernel I was able able to trigger the bug by issuing a 'phablet-flash' with a nexus7 plugged on USB.
  In this case the bug manifests itself pretty late (the phablet-flash command has ended) around the time the nexus7 is installing the new firmware after reboot (nexus7 reboot that is).

Note that I'm not suggesting that the nexus7 or adb is at fault here as the bug occurred under other circumstances.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

The v3.10-rc4 kernel is now available. Can you test that kernel and see if it still exhibits this bug:
 http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.10-rc4-saucy/

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
tags: added: kernel-da-key
Revision history for this message
Vincent Ladeuil (vila) wrote :

Test in progress on *raring* (I haven't migrated to saucy yet).

Note that with an up-to-date raring the bug has been manifesting itself several times a day in the last days without involving any nexus7 as before.

Revision history for this message
Vincent Ladeuil (vila) wrote :
Download full text (13.3 KiB)

The bug is still there.

I triggered it by plugin a nexus7 and issuing phablet-flash again.

I noticed a burst of messages (hundreds) in /var/log/syslog of the form:

Jun 6 09:13:48 saw kernel: [ 2138.793971] usb 2-4: clear tt 4 (9072) error -71

BUT

while typing this, I unplug/replug a bunch of usb devices (including the bt dongle) and

Jun 6 09:22:56 saw kernel: [ 2687.003663] usb 2-4: clear tt 4 (9072) error -71
Jun 6 09:22:56 saw kernel: [ 2687.011655] usb 2-4: clear tt 4 (9072) error -71
Jun 6 09:22:56 saw kernel: [ 2687.019167] usb 2-4: USB disconnect, device number 4
Jun 6 09:22:56 saw kernel: [ 2687.019171] usb 2-4.1: USB disconnect, device number 5
Jun 6 09:22:56 saw kernel: [ 2687.019715] usb 2-4: clear tt 4 (9072) error -71
Jun 6 09:22:56 saw kernel: [ 2687.092813] usb 2-4.2: USB disconnect, device number 8
Jun 6 09:22:56 saw kernel: [ 2687.093101] usb 2-4.3: USB disconnect, device number 6
Jun 6 09:22:56 saw kernel: [ 2687.203285] usb 2-4.4: USB disconnect, device number 7
Jun 6 09:22:57 saw bluetoothd[1853]: hci0: Remove UUID (0x0011) failed: Not Powered (0x0f)
Jun 6 09:22:57 saw bluetoothd[1853]: Adapter /org/bluez/1853/hci0 has been disabled
Jun 6 09:22:57 saw bluetoothd[1853]: Unregister path: /org/bluez/1853/hci0
Jun 6 09:22:57 saw bluetoothd[1853]: Endpoint unregistered: sender=:1.57 path=/MediaEndpoint/HFPAG
Jun 6 09:22:57 saw bluetoothd[1853]: Endpoint unregistered: sender=:1.57 path=/MediaEndpoint/HFPHS
Jun 6 09:22:59 saw kernel: [ 2689.684651] usb 2-4: new high-speed USB device number 9 using ehci-pci
Jun 6 09:22:59 saw kernel: [ 2689.824010] usb 2-4: New USB device found, idVendor=05e3, idProduct=0610
Jun 6 09:22:59 saw kernel: [ 2689.824016] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jun 6 09:22:59 saw kernel: [ 2689.824020] usb 2-4: Product: USB2.0 Hub
Jun 6 09:22:59 saw kernel: [ 2689.824023] usb 2-4: Manufacturer: GenesysLogic
Jun 6 09:22:59 saw kernel: [ 2689.825084] hub 2-4:1.0: USB hub found
Jun 6 09:22:59 saw kernel: [ 2689.826130] hub 2-4:1.0: 4 ports detected
Jun 6 09:22:59 saw kernel: [ 2690.108797] usb 2-4.3: new low-speed USB device number 10 using ehci-pci
Jun 6 09:22:59 saw kernel: [ 2690.203586] usb 2-4.3: New USB device found, idVendor=0461, idProduct=4d15
Jun 6 09:22:59 saw kernel: [ 2690.203591] usb 2-4.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
Jun 6 09:22:59 saw kernel: [ 2690.203594] usb 2-4.3: Product: USB Optical Mouse
Jun 6 09:22:59 saw kernel: [ 2690.205813] input: USB Optical Mouse as /devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4.3/2-4.3:1.0/input/input21
Jun 6 09:22:59 saw kernel: [ 2690.206086] hid-generic 0003:0461:4D15.000B: input,hidraw3: USB HID v1.11 Mouse [USB Optical Mouse] on usb-0000:00:1d.7-4.3/input0
Jun 6 09:23:00 saw kernel: [ 2690.280613] usb 2-4.4: new full-speed USB device number 11 using ehci-pci
Jun 6 09:23:00 saw kernel: [ 2690.585980] usb 2-4.4: New USB device found, idVendor=0a12, idProduct=0001
Jun 6 09:23:00 saw kernel: [ 2690.585986] usb 2-4.4: New USB device strings: Mfr=0, Product=2, SerialNumber=0
Jun 6 09:23:00 saw kernel: [ 2690.585989] usb 2-4.4: Product: BT2.0
Jun 6 09:23:00 saw mtp-probe...

Revision history for this message
Vincent Ladeuil (vila) wrote :
Download full text (26.8 KiB)

Digging further while still in the same session (i.e. I haven't rebooted since my last comments):

- issuing phablet-flash a second time succeeded,
- issuing it a third time triggered the bug again with the following syslog entries:

Jun 6 09:45:16 saw bluetoothd[1853]: Endpoint unregistered: sender=:1.289 path=/MediaEndpoint/HFPAG
Jun 6 09:45:16 saw bluetoothd[1853]: Endpoint unregistered: sender=:1.289 path=/MediaEndpoint/HFPHS
Jun 6 09:45:16 saw bluetoothd[1853]: Endpoint unregistered: sender=:1.289 path=/MediaEndpoint/A2DPSource
Jun 6 09:45:16 saw bluetoothd[1853]: Endpoint unregistered: sender=:1.289 path=/MediaEndpoint/A2DPSink
Jun 6 09:46:09 saw kernel: [ 4078.892767] usb 2-4.2: USB disconnect, device number 18
Jun 6 09:46:10 saw kernel: [ 4079.098248] usb 2-4.2: new high-speed USB device number 22 using ehci-pci
Jun 6 09:46:10 saw kernel: [ 4079.202128] usb 2-4.2: New USB device found, idVendor=18d1, idProduct=d002
Jun 6 09:46:10 saw kernel: [ 4079.202132] usb 2-4.2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
Jun 6 09:46:10 saw kernel: [ 4079.202133] usb 2-4.2: Product: Nexus 7
Jun 6 09:46:10 saw kernel: [ 4079.202135] usb 2-4.2: Manufacturer: Asus
Jun 6 09:46:10 saw kernel: [ 4079.202136] usb 2-4.2: SerialNumber: 015d21d4fd581613
Jun 6 09:46:10 saw mtp-probe: checking bus 2, device 22: "/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4.2"
Jun 6 09:46:10 saw mtp-probe: bus: 2, device: 22 was not an MTP device
Jun 6 09:46:12 saw kernel: [ 4081.450706] usb 2-4.2: USB disconnect, device number 22
Jun 6 09:46:22 saw kernel: [ 4091.112029] usb 2-4.2: new high-speed USB device number 23 using ehci-pci
Jun 6 09:46:22 saw kernel: [ 4091.215437] usb 2-4.2: New USB device found, idVendor=18d1, idProduct=d001
Jun 6 09:46:22 saw kernel: [ 4091.215442] usb 2-4.2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
Jun 6 09:46:22 saw kernel: [ 4091.215445] usb 2-4.2: Product: Nexus 7
Jun 6 09:46:22 saw kernel: [ 4091.215448] usb 2-4.2: Manufacturer: Asus
Jun 6 09:46:22 saw kernel: [ 4091.215451] usb 2-4.2: SerialNumber: 015d21d4fd581613
Jun 6 09:46:22 saw mtp-probe: checking bus 2, device 23: "/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4.2"
Jun 6 09:46:22 saw mtp-probe: bus: 2, device: 23 was not an MTP device
Jun 6 09:51:08 saw kernel: [ 4377.388040] usb 2-4.2: USB disconnect, device number 23
Jun 6 09:51:19 saw kernel: [ 4388.072602] usb 2-4.2: new high-speed USB device number 24 using ehci-pci
Jun 6 09:51:19 saw kernel: [ 4388.177101] usb 2-4.2: New USB device found, idVendor=18d1, idProduct=d002
Jun 6 09:51:19 saw kernel: [ 4388.177107] usb 2-4.2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
Jun 6 09:51:19 saw kernel: [ 4388.177110] usb 2-4.2: Product: Nexus 7
Jun 6 09:51:19 saw kernel: [ 4388.177113] usb 2-4.2: Manufacturer: Asus
Jun 6 09:51:19 saw kernel: [ 4388.177116] usb 2-4.2: SerialNumber: 015d21d4fd581613
Jun 6 09:51:19 saw mtp-probe: checking bus 2, device 24: "/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4.2"
Jun 6 09:51:19 saw mtp-probe: bus: 2, device: 24 was not an MTP device

At that point, I realized I never mentioned that both the bt dongle and the nexus7 are ...

Revision history for this message
Vincent Ladeuil (vila) wrote :

So, fifth day starting:
- still running v3.10-rc4-saucy with an up-to-date raring,
- bt dongle moved around (back and forth) between screen's hub and PC,
- several 'phablet-flash' commands run

I can't diagnose the usb errors mentioned in the previous comments (error -71), but basically, while the bt devices are still lost under certain conditions (more about that below), they always come back so at least the issue is not critical for me anymore.

The bt devices are still lost from time to time but after they get rediscovered and are seen as new by X11 after some time (it's hard to be precise here, the order is tens of seconds).

When this happens, I have to issue 'xmodmap ~/.Xmodmap' and '~/.xprofile' to restore my own settings which is inconvenient but far less than having to reboot ;)

I think the 'phablet-flash' issue is only revealing some unrelated issue, possibly in the screen's usb hub but the issue this bug is about seem to be addressed in v3.10-rc4-saucy.

Feedback or advices about how to refine the diagnosis highly welcome.

I'm a bit hesitant to tag the bug 'kernel-fixed-upstream' without better understanding.

tags: added: nexus7
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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