Bug 1213972

Summary: system intermittently fails to detect Bluetooth LE devices
Product: [openSUSE] openSUSE Tumbleweed Reporter: Bruno Pitrus <brunopitrus>
Component: KernelAssignee: openSUSE Kernel Bugs <kernel-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: brunopitrus, kernel-bugs, tiwai
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Tumbleweed   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Bruno Pitrus 2023-08-04 06:41:25 UTC
Since the last few kernel updates (all 6.3.x kernels i remember working correctly), I often can't get my computer to detect my Bluetooth LE mouse (Logitech M575 trackball). I tried using both the KDE gui and bluetoothctl. Sometimes after several reboots it starts detecting. Devices which support old Bluetooth standards (phones etc.) can be paired normally.

If the mouse is successfully paired, it works correctly even across reboots.
Comment 1 Takashi Iwai 2023-08-04 11:56:43 UTC
Could you verify whether it's a regression from 6.3?  You can boot with the old 6.3.x kernel and see whether the problem happens or not.

If no 6.3 kernel is on your system any longer, you can still take it from TW history repo
  http://download.opensuse.org/history/
Comment 2 Bruno Pitrus 2023-08-04 13:45:16 UTC
I installed kernel-default-6.3.9-1.1 (from snapshot 20230706 — the oldest in this directory) and bluetooth LE works perfectly.

Should I do a binsearch on the snapshots to determine which release broke it?
Comment 3 Takashi Iwai 2023-08-04 13:47:16 UTC
Yes, at least a quick check of the first 6.4.x kernel in TW history would be helpful.
Comment 4 Bruno Pitrus 2023-08-04 13:58:42 UTC
kernel-default-6.4.3-1.1 is broken
Comment 5 Bruno Pitrus 2023-08-04 14:40:29 UTC
6.4.2 is also broken. It's the first broken kernel (the previous one was 6.3.9 which works ok)
Comment 6 Takashi Iwai 2023-08-04 14:43:33 UTC
Thanks, so very likely a bug introduced in 6.4 bump.

Care to report it to the upstream?  The best would be the corresponding devel ML, but you can try bugzilla.kernel.org, too.
Comment 8 Bruno Pitrus 2023-08-05 08:14:50 UTC
How can I go from a https://github.com/SUSE/kernel like git tree to an RPM package that i can install? I want to binsearch the particular commit causing the issue.
Comment 9 Takashi Iwai 2023-08-05 15:33:48 UTC
Creating an rpm isn't so trivial, so I'd rather recommend to compile and install manually the upstream linux git repo for bisection.
Comment 10 Bruno Pitrus 2023-08-06 09:30:05 UTC
How it will boot then? You need to also install the modules and run dracut to be able to boot, and this seems to be done separately (?)

(Please forgive me if this seems a stupid question, i don't know anything about kernel development)
Comment 11 Takashi Iwai 2023-08-06 10:48:56 UTC
You can find some upstream document like:
  https://docs.kernel.org/admin-guide/quickly-build-trimmed-linux.html

The installkernel program is included in kernel-install-tools package.
Comment 12 Bruno Pitrus 2023-09-06 09:21:00 UTC
What's the policy on backporting kernel patches? It did not get merged in time for the 6.5 kernel: https://github.com/bluez/bluez/issues/582
Comment 13 Takashi Iwai 2023-09-06 09:41:18 UTC
It's fine to backport as long as the fix gets merged to the upstream.
Through a quick glance, it seems to be the commit 253f3399f4c09ce6f4e67350f839be0361b4d5ff
 Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED

I'm building a test kernel with the backport patch in OBS home:tiwai:bsc1213972 repo.  Once after the build finishes (takes an hour or so), the test package will be available at
  http://download.opensuse.org/repositories/home:/tiwai:/bsc1213972/standard/
Please give it a try later.

Note that it's an unofficial build, hence you'll need to turn off Secure Boot.
Comment 14 Bruno Pitrus 2023-09-06 14:39:23 UTC
I confirm that kernel 6.5.1-1.g74930eb-default from home:tiwai:bsc1213972 fixes the problem.
Comment 15 Takashi Iwai 2023-09-06 15:41:30 UTC
OK, then the fix is already on the way to TW kernel.