Bug 1217172 - Logitech-Keyboard stops working after login
Summary: Logitech-Keyboard stops working after login
Status: VERIFIED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Kernel (show other bugs)
Version: Current
Hardware: x86-64 openSUSE Tumbleweed
: P5 - None : Major (vote)
Target Milestone: ---
Assignee: openSUSE Kernel Bugs
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-15 10:27 UTC by Benjamin Brunner
Modified: 2023-12-12 11:41 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Potentially related journal messages during boot (6.07 KB, text/plain)
2023-11-15 11:11 UTC, Benjamin Brunner
Details
Logitech error with test-kernel (7.59 KB, text/plain)
2023-11-15 15:19 UTC, Benjamin Brunner
Details
dmesg with kernel 6.5.9 (104.77 KB, text/plain)
2023-11-15 16:03 UTC, Benjamin Brunner
Details
hwinfo with kernel 6.5.9 (1.88 MB, text/plain)
2023-11-15 16:03 UTC, Benjamin Brunner
Details
dmesg with kernel 6.6.1 (122.64 KB, text/plain)
2023-11-15 16:04 UTC, Benjamin Brunner
Details
hwinfo with kernel 6.6.1 (1.87 MB, text/plain)
2023-11-15 16:04 UTC, Benjamin Brunner
Details
dmesg with kernel 6.6.1-1.1.g71674cf (110.86 KB, text/plain)
2023-11-15 16:40 UTC, Benjamin Brunner
Details
hwinfo with kernel 6.6.1-1.1.g71674cf (1.87 MB, text/plain)
2023-11-15 16:40 UTC, Benjamin Brunner
Details
dmesg with kernel 6.6.1-1.gf1daf70 (123.48 KB, text/plain)
2023-11-16 14:23 UTC, Benjamin Brunner
Details
hwinfo with kernel 6.6.1-1.gf1daf70 (1.87 MB, text/plain)
2023-11-16 14:23 UTC, Benjamin Brunner
Details
dmesg with working kernel 6.6.1-2.gc9735e0 (115.24 KB, text/plain)
2023-11-17 09:45 UTC, Benjamin Brunner
Details
hwinfo with working kernel 6.6.1-2.gc9735e0 (1.88 MB, text/plain)
2023-11-17 09:45 UTC, Benjamin Brunner
Details
A workaround patch (2.11 KB, patch)
2023-11-17 10:43 UTC, Takashi Iwai
Details | Diff
dmesg with working kernel 6.6.1-1.g01080f1 (107.20 KB, text/plain)
2023-11-17 11:52 UTC, Benjamin Brunner
Details
hwinfo with working kernel 6.6.1-1.g01080f1 (1.88 MB, text/plain)
2023-11-17 11:52 UTC, Benjamin Brunner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Brunner 2023-11-15 10:27:19 UTC
Since the last kernel-update to 6.6.1, my Logitech G510 stops working after log in to Gnome (no key-presses registered, num-lock stuck on the previous state).

The keyboard is connected via usb-switch.

Booting to an older 6.5.9 temporary solved it again.

I also found some related bug reports, mentioning other Logitech- and also the G510-keyboard:
https://bbs.archlinux.org/viewtopic.php?id=290172 (c#10 seems to have some pointers on the problematic commit)
https://bugs.archlinux.org/task/80133
https://bugzilla.kernel.org/show_bug.cgi?id=218094
https://bbs.archlinux.org/viewtopic.php?id=287927

Please let me know if you need any logs or additional information.
Comment 1 Benjamin Brunner 2023-11-15 11:11:40 UTC
Created attachment 870769 [details]
Potentially related journal messages during boot

journalctl -o short-precise -k -b -1
Comment 2 Takashi Iwai 2023-11-15 12:26:44 UTC
It seems that the upstream commit 9d1bd9346241cd6963b58da7ffb7ed303285f684
  HID: logitech-dj: Add support for a new lightspeed receiver iteration
caused a regression.

I'm building a test kernel with the revert of the commit.  It's being built in OBS home:tiwai:bsc1217172 repo.  Please give it a try later once after the build finishes.
Comment 3 Benjamin Brunner 2023-11-15 15:18:25 UTC
Takashi, thanks for the fast reply. I installed 6.6.1-1.1.g2044391 from your repo, unfortunately the behavior is still the same.

I'll attach the new logs to the bug.
Comment 4 Benjamin Brunner 2023-11-15 15:19:52 UTC
Created attachment 870776 [details]
Logitech error with test-kernel

journalctl -o short-precise -k -b
Comment 5 Takashi Iwai 2023-11-15 15:35:47 UTC
OK, thanks, then it's a different bug from the bugzilla.kernel.org entries.
Rather it's relevant with the Arch's entry, something about leds class changes.

The Arch entry (https://bbs.archlinux.org/viewtopic.php?id=290172) suggested the upstream commit 43a707ae58406200597b03a5be782e726b3c175b
  leds: Make leds_class a static const structure
as the culprit.

Another test kernel with the revert of this commit is being built in OBS home:tiwai:bsc1217172-2 repo.  Please give it a try later.

(Though, I doubt that it's a false-positive bisection result, judging from the commit change.  But it's better to double-check with the actual revert.)
Comment 6 Takashi Iwai 2023-11-15 15:41:37 UTC
Also, could you give the dmesg outputs from both working (6.5.x) and non-working (6.6.1) kernels, as well as hwinfo outputs from both of them?
Comment 7 Benjamin Brunner 2023-11-15 16:03:15 UTC
Created attachment 870777 [details]
dmesg with kernel 6.5.9
Comment 8 Benjamin Brunner 2023-11-15 16:03:48 UTC
Created attachment 870778 [details]
hwinfo with kernel 6.5.9
Comment 9 Benjamin Brunner 2023-11-15 16:04:20 UTC
Created attachment 870779 [details]
dmesg with kernel 6.6.1
Comment 10 Benjamin Brunner 2023-11-15 16:04:55 UTC
Created attachment 870780 [details]
hwinfo with kernel 6.6.1
Comment 11 Benjamin Brunner 2023-11-15 16:07:08 UTC
I'll give the new test-kernel a try as soon as it's built or latest tomorrow morning.
Comment 12 Benjamin Brunner 2023-11-15 16:37:21 UTC
6.6.1-1.1.g71674cf unfortunately hasn't resolved it as well. 

I'll upload the new hwinfo and dmesg afterwards.
Comment 13 Benjamin Brunner 2023-11-15 16:40:04 UTC
Created attachment 870782 [details]
dmesg with kernel 6.6.1-1.1.g71674cf
Comment 14 Benjamin Brunner 2023-11-15 16:40:39 UTC
Created attachment 870783 [details]
hwinfo with kernel 6.6.1-1.1.g71674cf
Comment 15 Takashi Iwai 2023-11-16 08:06:33 UTC
Thanks for quick testing.

It's no surprise that the revert patch didn't work (although the problem must be related with some changes in leds class drivers).

I made a quick hack to name the leds device unique per hid/input device for avoiding the sysfs name conflict.  A test kernel is being built in OBS home:tiwai:bsc1217172-3 repo.  Please give it a try later.
Comment 16 Benjamin Brunner 2023-11-16 14:21:53 UTC
Sorry that it took a bit longer. I tested it with the new kernel and sadly still the same result. Also, I strangely still see the sysfs conflict in dmesg.
Comment 17 Benjamin Brunner 2023-11-16 14:23:13 UTC
Created attachment 870801 [details]
dmesg with kernel 6.6.1-1.gf1daf70
Comment 18 Benjamin Brunner 2023-11-16 14:23:50 UTC
Created attachment 870802 [details]
hwinfo with kernel 6.6.1-1.gf1daf70
Comment 19 Takashi Iwai 2023-11-16 15:36:40 UTC
Hmm, it's puzzling.  Then it means that the conflict happens within the same HID device probe?

Now I added some debug prints and also let the driver to ignore the led class registration error.  Another test kernel is being built in OBS home:tiwai:bsc1217172-4.  Let's see.
Comment 20 Benjamin Brunner 2023-11-16 16:06:21 UTC
Thanks again for the fast reply. It seems OBS is down at the moment. I'll give it a try tomorrow morning.
Comment 21 Benjamin Brunner 2023-11-17 09:43:55 UTC
I just tested 6.6.1-2.gc9735e0 and with ignoring the led class registration error, the keyboard works again! Thank you very much!

I'll attach the hwinfo and dmesg of the working kernel and in case this is not the final fix, just let me know and I'll happily give it another test.
Comment 22 Benjamin Brunner 2023-11-17 09:45:02 UTC
Created attachment 870815 [details]
dmesg with working kernel 6.6.1-2.gc9735e0
Comment 23 Benjamin Brunner 2023-11-17 09:45:46 UTC
Created attachment 870816 [details]
hwinfo with working kernel 6.6.1-2.gc9735e0
Comment 24 Takashi Iwai 2023-11-17 10:43:03 UTC
OK, thanks, now finally I understood what's going on.

The problem is that leds class gained the sysfs entry "color" in the commit c7d80059b086c4986cd994a1973ec7a5d75f8eea
    leds: class: Store the color index in struct led_classdev

Meanwhile, hid-lg-g15 driver creates the own sysfs entry "color", and this conflicts with the new standard one in the above.

A fix would be to rename either of them.  I'm building a test kernel with the rename of the hid-lg-g15's one (from "color" to "kbd_color"), and this should avoid the conflict.

Another test kernel with the patch is being built in OBS home:tiwai:bsc1217172-5 repo.  Please give it a try later again.
Comment 25 Takashi Iwai 2023-11-17 10:43:23 UTC
Created attachment 870817 [details]
A workaround patch
Comment 26 Benjamin Brunner 2023-11-17 11:51:09 UTC
Seems like the naming of the led-class was really the reason.

6.6.1-1.g01080f1 works as well.

Thank you very much for your efforts!
Comment 27 Benjamin Brunner 2023-11-17 11:52:15 UTC
Created attachment 870818 [details]
dmesg with working kernel 6.6.1-1.g01080f1
Comment 28 Benjamin Brunner 2023-11-17 11:52:54 UTC
Created attachment 870820 [details]
hwinfo with working kernel 6.6.1-1.g01080f1
Comment 29 Takashi Iwai 2023-11-21 15:23:39 UTC
We ended up rather with the revert of the affecting commit in leds core:
  https://lore.kernel.org/r/20231121142629.27083-1-tiwai@suse.de

Now I backported the revert patch to stable branch.
Comment 30 Takashi Iwai 2023-11-22 07:46:08 UTC
(In reply to Takashi Iwai from comment #29)
> We ended up rather with the revert of the affecting commit in leds core:
>   https://lore.kernel.org/r/20231121142629.27083-1-tiwai@suse.de

... and this turned out to break the build.
A partial revert was submitted to the upstream instead:
  https://lore.kernel.org/r/20231121162359.9332-1-tiwai@suse.de

The patch was backported to TW stable branch now.
Comment 31 Benjamin Brunner 2023-12-12 11:41:08 UTC
I just tested it with 6.6.3 and everything is working as expected.

Thanks Takashi for your help!