Bug 2053283 - Cannot connect to Bluetooth mouse with kernel 5.17
Summary: Cannot connect to Bluetooth mouse with kernel 5.17
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-10 20:45 UTC by Adam Williamson
Modified: 2022-03-22 15:15 UTC (History)
20 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-03-08 23:48:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
boot messages (120.77 KB, text/plain)
2022-02-10 20:46 UTC, Adam Williamson
no flags Details
output of /usr/libexec/bluetooth/bluetoothd -n -d (50.32 KB, text/plain)
2022-02-10 20:47 UTC, Adam Williamson
no flags Details
btmon for 90s (923.52 KB, text/plain)
2022-02-10 21:59 UTC, Chris Murphy
no flags Details
journalctl with bluetoothd -d (1.24 MB, text/plain)
2022-02-10 22:46 UTC, Chris Murphy
no flags Details
lsusb -v output for a USB device that seems to be a bluetooth controller (9.17 KB, text/plain)
2022-02-10 23:24 UTC, Adam Williamson
no flags Details
filtered dmesg 5.17.0-rc4 (9.19 KB, text/plain)
2022-02-15 15:42 UTC, Chris Murphy
no flags Details

Description Adam Williamson 2022-02-10 20:45:14 UTC
1. Please describe the problem:

When I boot a 5.17 kernel on Fedora 36, my Bluetooth mouse (Logitech MX Master 3) does not work.

2. What is the Version-Release number of the kernel:

5.17.0-0.rc3.89.fc36.x86_64

3. Did it work previously in Fedora? If so, what kernel version did the issue
   *first* appear?  Old kernels are available for download at
   https://koji.fedoraproject.org/koji/packageinfo?packageID=8 :

Yes. I first noticed it did not work with a very early 5.17 build, kernel-5.17.0-0.rc0.20220112gitdaadb3bd0e8d.63.fc36 . 5.16 kernels are fine.

4. Can you reproduce this issue? If so, please provide the steps to reproduce
   the issue below:

Yes. Boot the system with a 5.17 kernel and wiggle the mouse. Nothing happens.


5. Does this problem occur with the latest Rawhide kernel? To install the
   Rawhide kernel, run ``sudo dnf install fedora-repos-rawhide`` followed by
   ``sudo dnf update --enablerepo=rawhide kernel``:

This is pretty much the latest kernel build as I write.

6. Are you running any modules that not shipped with directly Fedora's kernel?:

No.

7. Please attach the kernel logs. You can get the complete kernel log
   for a boot with ``journalctl --no-hostname -k > dmesg.txt``. If the
   issue occurred on a previous boot, use the journalctl ``-b`` flag.

Will do, also bluetoothd verbose output.

Comment 1 Adam Williamson 2022-02-10 20:46:34 UTC
Created attachment 1860445 [details]
boot messages

Comment 2 Adam Williamson 2022-02-10 20:47:55 UTC
Created attachment 1860446 [details]
output of /usr/libexec/bluetooth/bluetoothd -n -d

I tried stopping bluetooth.service and running /usr/libexec/bluetooth/bluetoothd -n -d , waiting for a while, then attempting to force a connection to my mouse from GNOME Bluetooth settings (which didn't work). Then I did ctrl-c to end the bluetoothd run. This is the output from that session.

Comment 3 Adam Williamson 2022-02-10 20:51:48 UTC
The system is an XPS 13 laptop, the 9360 "Kaby Lake" model. `btmgmt info` says this:

[root@xps13k adamw]# btmgmt info
Index list with 1 item
hci0:	Primary controller
	addr 9C:B6:D0:D0:D1:BE version 8 manufacturer 29 class 0x00010c
	supported settings: powered connectable fast-connectable discoverable bondable link-security ssp br/edr le advertising secure-conn debug-keys privacy configuration static-addr phy-configuration wide-band-speech 
	current settings: powered ssp br/edr le secure-conn 
	name BlueZ 5.63
	short name 
hci0:	Configuration options
	supported options: public-address 
	missing options: 

not sure what else would help to debug, please let me know. Thanks!

Comment 4 Chris Murphy 2022-02-10 21:59:47 UTC
Created attachment 1860485 [details]
btmon for 90s

Bus 001 Device 005: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)

Bluetooth monitor ver 5.63
= Note: Linux version 5.17.0-0.rc3.89.fc36.x86_64 (x86_64)                                                                                                                                0.059832
= Note: Bluetooth subsystem version 2.22                                                                                                                                                  0.059833
= New Index: C8:E2:65:04:99:CF (Primary,USB,hci0)                                                                                                                                  [hci0] 0.059834
= Open Index: C8:E2:65:04:99:CF                                                                                                                                                    [hci0] 0.059835
= Index Info: C8:E2:65:04:99:CF (Intel Corp.)     

Run btmon for about 90s while scanning for devices and trying to pair with one.

Comment 5 Chris Murphy 2022-02-10 22:03:05 UTC
I've got a ton of these:
Feb 10 14:49:21 fovo.local bluetoothd[836]: src/adv_monitor.c:btd_adv_monitor_offload_supported() Manager is NULL, get offload support failed

Bunch of these
Feb 10 14:49:57 fovo.local gnome-control-c[39502]: Setting up /org/bluez/hci0/dev_38_18_4C_24_2D_1D failed: Timeout was reached
Feb 10 14:50:07 fovo.local gnome-control-c[39502]: Setting up /org/bluez/hci0/dev_38_18_4C_24_2D_1D failed: GDBus.Error:org.bluez.Error.InProgress: In Progress
Feb 10 14:50:08 fovo.local gnome-control-c[39502]: Setting up /org/bluez/hci0/dev_38_18_4C_24_2D_1D failed: GDBus.Error:org.bluez.Error.InProgress: In Progress
Feb 10 14:50:09 fovo.local gnome-control-c[39502]: Setting up /org/bluez/hci0/dev_38_18_4C_24_2D_1D failed: GDBus.Error:org.bluez.Error.InProgress: In Progress
Feb 10 14:51:32 fovo.local bluetoothd[836]: Pair device timed out for hci0

Scanning is flaky, sometimes it sees things sometimes not. When it sees my Sony headset, I try to pair in GNOME Shell by clicking on the words "Not Set Up" in Settings, and nothing happens. No error in Shell, the "button" for the device recesses, but no additional dialog comes up to pair. And I see the above messages in journal.

So other than transiently OK scanning, pairing is 100% broken.

Comment 6 Chris Murphy 2022-02-10 22:46:20 UTC
Created attachment 1860499 [details]
journalctl with bluetoothd -d

This is about 5 minutes of bluetoothd debug (systemd is also in debug mode so this is quite verbose) while trying various things. Near the end it did eventually pair and I was able to get sound. But it was like wrestling a snapping turtle.

Comment 7 Adam Williamson 2022-02-10 23:24:19 UTC
Created attachment 1860501 [details]
lsusb -v output for a USB device that seems to be a bluetooth controller

One USB device claims to be a bluetooth controller. It's listed as Qualcomm/Atheros. Here is the lsusb -v output for it. These are the bluetooth modules that show in lsmod:

btusb                  65536  0
btrtl                  28672  1 btusb
btbcm                  20480  1 btusb
btintel                45056  1 btusb
bluetooth             692224  37 btrtl,btintel,btbcm,bnep,btusb,rfcomm

Comment 9 Chris Murphy 2022-02-15 15:40:04 UTC
No improvement in 5.17.0-rc4. I am seeing errors that take the form:

[   15.731405] kernel: Bluetooth: hci0: unexpected event 0xff length: 5 > 0

This matches with a complaint I found here https://lore.kernel.org/linux-bluetooth/20220125144639.2226-1-mike@fireburn.co.uk/ about this patch https://lore.kernel.org/linux-bluetooth/20211201000215.1134831-13-luiz.dentz@gmail.com/

I've also got a lockdep warning when running +debug kernels:

[   26.657824] kernel: krfcommd/1391 is trying to acquire lock:
[   26.657831] kernel: ffff8d697a534940
(sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+.}-{0:0}, at:
rfcomm_sk_state_change+0x4d/0x110 [rfcomm]

Comment 10 Chris Murphy 2022-02-15 15:42:47 UTC
Created attachment 1861289 [details]
filtered dmesg 5.17.0-rc4

includes the full lockdep warning and deadlock backtrace

Comment 11 Fedora Update System 2022-02-16 17:51:17 UTC
FEDORA-2022-2aa7c08b53 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2022-2aa7c08b53

Comment 12 Fedora Update System 2022-02-16 17:51:18 UTC
FEDORA-2022-9d4e48836d has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-9d4e48836d

Comment 13 Adam Williamson 2022-02-17 16:45:05 UTC
Those updates don't fix this bug, it was a mispaste. Setting back to ASSIGNED.

Comment 14 Adam Williamson 2022-02-23 23:33:46 UTC
Still valid with kernel-core-5.17.0-0.rc5.102.fc37.x86_64 .

Comment 15 Adam Williamson 2022-03-08 23:47:25 UTC
Seems fixed with 5.17.0-0.rc7! I'll edit the update and mark it as fixing this bug.

Comment 16 Adam Williamson 2022-03-08 23:48:00 UTC
Actually, I filed this against Rawhide so I'll just close it.

Comment 17 Garrett LeSage 2022-03-22 08:45:49 UTC
I'm still seeing problems with Bluetooth on my XPS 13 9360 and ThinkPad T14s, with problems scanning and this in my dmesg:

[  495.039893] Bluetooth: hci0: unexpected event 0xff length: 4 > 0

And this is with 5.17.0-0.rc7.116.fc36.x86_64 on Fedora 36 pre-beta on both Workstation and Silverblue.


Related issue I opened (that I assigned to bluez):

https://bugzilla.redhat.com/show_bug.cgi?id=2066216


Removing /var/lib/bluetoothn/* and rebooting allows scanning (+ pairing) to work again for a bit, but it eventually fails again, even across reboots, if there's anything in /var/lib/bluetooth/.

Comment 18 Adam Williamson 2022-03-22 15:15:13 UTC
Try updating to rc8. rc7 still had problems for me (I lost the mouse on suspend/resume), but with rc8 it seems to be back to working perfectly.


Note You need to log in before you can comment on or make changes to this bug.