5

Context:

  • Linux kernel 5.10.x (5.18.x also)
  • Thinkpad X1c (gen7) laptop

Problem:

Sometimes, when I set my system to sleep (suspend to RAM) and then resume, the bluetooth adapter is not found anymore. If I reboot, it works again.

When it works,

here is the (internal) bluetooth adapter as seen from lsusb:

# lsusb | grep 8087 
Bus 001 Device 006: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)

And I'm able to scan, connect & use my bluetooth devices.

When it doesn't work:

  • usually after a computer power suspend/resume (not systematically),
  • lsusb does not display the above device anymore,
  • I'm not able to scan, connect or even see my bluetooth adapter.

And kern.log says:

usb usb1-port10: Cannot enable. Maybe the USB cable is bad? 
usb usb1-port10: Cannot enable. Maybe the USB cable is bad? 
usb usb1-port10: attempt power cycle
usb 1-10: new low-speed USB device number 71 using xhci_hcd
usb 1-10: Device not responding to setup address.
usb 1-10: Device not responding to setup address.
usb 1-10: device not accepting address 71, error -71
usb 1-10: new low-speed USB device number 72 using xhci_hcd
usb 1-10: Device not responding to setup address.
usb 1-10: Device not responding to setup address.
usb 1-10: device not accepting address 72, error -71
usb usb1-port10: unable to enumerate USB device

Port 10 is the one connected to the bluetooth adapter.

What I already tried (doesn't work):

  • systemctl restart bluetooth.service,
  • modprobe -r btusb && modprobe btusb,
  • bluetoothctl power on: says No default controller available,
  • rfkill unblock bluetooth, even if it shows a bluetooth device and accepts the command.

My question

How can I make the Bluetooth work properly again without rebooting the whole computer?

1 Answer 1

5

May be overkill, but does actually work:

  • resetting the whole USB "Bus" to which the bluetooth adapter is hardwired.

Solution

Get the PCI ID of Bus 1 "root hub" (don't know why the error):

# lsusb -v -s1:1 | grep iSerial
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
  iSerial                 1 0000:00:14.0

And use it to unbind (will disconnect all related USB devices) and re-bind:

echo -n '0000:00:14.0' >| /sys/bus/pci/drivers/xhci_hcd/unbind && \
sleep 3 && \
echo -n '0000:00:14.0' >| /sys/bus/pci/drivers/xhci_hcd/bind

Beware, all my (internal & external) USB devices are connected to this hub: external mouse, external keyboard, internal webcam, internal fingerprint sensor... All will be (temporarily) disconnected in the process.

Result

After that kern.log says:

usb 1-10: new full-speed USB device number 6 using xhci_hcd
usb 1-10: New USB device found, idVendor=8087, idProduct=0aaa, bcdDevice= 0.02
usb 1-10: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[...]
Bluetooth: hci0: Bootloader revision 0.1 build 42 week 52 2015
[...]
Bluetooth: hci0: Firmware loaded in 1643271 usecs
Bluetooth: hci0: Waiting for device to boot
Bluetooth: hci0: Device booted in 13788 usecs

And lsusb | grep 8087:

Bus 001 Device 006: ID 8087:0aaa Intel Corp.

And it is possible to use the bluetooth again!

Another way?

While it's better than rebooting, do you know another solution that would be less "intrusive"?

3
  • 1
    Months that I have this problem, and this seems the only way to solve it. One liner may work even better since you want to have both lines run in "single shot" as you lose mouse & keyboard. Something like sudo bash -c "..." ? May 17, 2022 at 11:07
  • 1
    @user3041539 I added some sort of one liner
    – Totor
    May 28, 2022 at 12:27
  • awesome! that one liner is much better, I'd even say to hide the few lines solution so a a user doesn't hit with non functioning peripheries May 29, 2022 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.