Bug 1806321 - Kernel 5.5.5, Keyborad, Logitech G510s, Keyborad switch ATEN
Summary: Kernel 5.5.5, Keyborad, Logitech G510s, Keyborad switch ATEN
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 31
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Hans de Goede
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-23 19:06 UTC by Holger Schranz
Modified: 2020-03-16 10:29 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-16 10:28:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Dmesg with error (137.48 KB, text/plain)
2020-02-23 19:06 UTC, Holger Schranz
no flags Details
Dmesg with kernel 5.4.20-200 (good case) (102.59 KB, text/plain)
2020-02-23 19:09 UTC, Holger Schranz
no flags Details
Dmesg file with 5.5.9-kernel (140.27 KB, text/plain)
2020-03-15 22:02 UTC, Holger Schranz
no flags Details

Description Holger Schranz 2020-02-23 19:06:26 UTC
Created attachment 1665244 [details]
Dmesg with error

1. Please describe the problem:
   Keyboard Logitech G510s doesn't work correctly "Bad cable". 
   A kexboard switch ATEN is used. If I switch to the second PC and back the
   Keyboard works for while. Than the same behavior ocurre. 
   The environment with kernel 5.4.20-200 works.

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

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 :
   See dexription of the problem


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

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``:


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.

   Is attached

Comment 1 Holger Schranz 2020-02-23 19:09:32 UTC
Created attachment 1665245 [details]
Dmesg with kernel 5.4.20-200 (good case)

Comment 2 Holger Schranz 2020-03-04 07:47:57 UTC
Hello,

meanwhile updtaed to FedoraSrv 31 5.5.7-200.
The same behavior.

Best regards

Comment 3 Hans de Goede 2020-03-15 12:41:52 UTC
Thank you for the bug report.

Kernel 5.5 has a new driver for some of the Logitech gaming keyboards (which I wrote), this drivers makes the gaming keys actually do something somewhat useful and allows control of the backlight through the sysfs LED class interface.

It seems that this driver and your aten kvm are not working together well.

I happen to have an Aten KVM switch myself too. Mine is a CS1764a, what is your model?

For me using my G510 (not a G510s but a G510) through the KVM I get the following errors which you get too:

[   20.000737] lg-g15 0003:046D:C22D.0016: Error disabling keyboard emulation for the G-keys
[   20.014258] lg-g15: probe of 0003:046D:C22D.0016 failed with error -32

For me it is just those errors, this breaks the new hid_lg_g15 driver, causing the multi-media keys and the game-keys to not work, but I'm not getting the behavior you are seeing these errors:

[   20.065109] usb 5-4.1-port1: disabled by hub (EMI?), re-enabling...
[   20.065114] usb 5-4.1.1: USB disconnect, device number 17

For me after the error everything works except for the multi-media and game keys. Also for me the

"lg-g15 0003:046D:C22D.0016: Error disabling keyboard emulation for the G-keys"

error goes away when the KVM is pointed to the computer while it is booting/probing the keyboard. This likely explains why the switch away + switch back works.

Can you double-check if the errors still happen if you point the kvm to the computer running the 5.5 kernel before booting that computer (and leaving the kvm pointed to that computer during boot)?

A possible workaround for this, is likely to not use the new driver, can you try creating a:

/etc/modprobe.d/blacklist-g15.conf

File with the following single line in there:

blacklist hid_lg_g15

Note you also need to regenerate the initrd to get a copy of this new file inside the initrd, to do this, boot the troublesome kernel and then run:

sudo dracut -f

And then reboot into the troublesome kernel again, after this the output of:

lsmod | grep g15

Should be empty and the problem will hopefully be gone.

Comment 4 Holger Schranz 2020-03-15 17:12:20 UTC
Hello Hans de Goede,

thanks a lot for your information.

About your questions:

a) Model of KVM: 

   Aten CS782DP KVM Switch 2-Port USB DisplayPort

b) I get this problem every time if I boot the PC.

c) Additional information:

   I have to scenarios:

   1) If the problem occur and I press the switch button the problem is gone for 5 - 10 min and it occurs again
   2) If the problem occur and don't switch I acn't type anyhing and message below (end of the message) is reported
      each minute.

d) Messages (journalctl) 
   
Messages at boot/startup (all 2 sec):

Mär 15 07:47:00 localhost.localdomain kernel: lg-g15 0003:046D:C22D.0004: input,hidraw3: USB HID v1.11 Device [Logitech G510s Gaming Keyboard] on usb-0000:0d:00.3-4.1.1/input1
Mär 15 07:47:00 localhost.localdomain kernel: input: Logitech G510s Gaming Keyboard as /devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1/5-4.1.1:1.2/0003:046D:C22D.0005/input/input14
Mär 15 07:47:00 localhost.localdomain kernel: lg-g15 0003:046D:C22D.0005: input,hidraw4: USB HID v1.11 Mouse [Logitech G510s Gaming Keyboard] on usb-0000:0d:00.3-4.1.1/input2
.
.
.
Mär 15 07:47:01 localhost.localdomain systemd-journald[392]: Received SIGTERM from PID 1 (systemd).
Mär 15 07:47:01 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:01 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:01 localhost.localdomain kernel: usb 5-4.1: USB disconnect, device number 4
Mär 15 07:47:01 localhost.localdomain kernel: usb 5-4.1.1: USB disconnect, device number 5
Mär 15 07:47:01 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: Cannot enable. Maybe the USB cable is bad?
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot disable (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: Cannot enable. Maybe the USB cable is bad?
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot disable (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1: USB disconnect, device number 6
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1.1: USB disconnect, device number 7
Mär 15 07:47:04 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
.
.
.
Mär 15 07:47:06 localhost.localdomain kernel: usb 5-4.1-port1: cannot reset (err = -71)
Mär 15 07:47:06 localhost.localdomain kernel: usb 5-4.1-port1: Cannot enable. Maybe the USB cable is bad?
Mär 15 07:47:06 localhost.localdomain kernel: usb 5-4.1-port1: cannot disable (err = -71)
Mär 15 07:47:06 localhost.localdomain kernel: usb 5-4.1-port1: cannot disable (err = -71)
Mär 15 07:47:06 localhost.localdomain kernel: hub 5-4.1:1.0: hub_ext_port_status failed (err = -71)
Mär 15 07:47:06 localhost.localdomain kernel: usb 5-4.1: USB disconnect, device number 8
Mär 15 07:47:06 localhost.localdomain kernel: usb 5-4.1.1: USB disconnect, device number 9
Mär 15 07:47:07 localhost.localdomain ModemManager[1050]: <info>  Couldn't check support for device '/sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:05.0/0000:07:00.0': not supported by any plugin
Mär 15 07:47:07 localhost.localdomain kernel: usb 5-4.1: new full-speed USB device number 10 using xhci_hcd
Mär 15 07:47:07 localhost.localdomain kernel: usb 5-4.1: New USB device found, idVendor=0557, idProduct=8021, bcdDevice= 1.00
Mär 15 07:47:07 localhost.localdomain kernel: usb 5-4.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Mär 15 07:47:07 localhost.localdomain kernel: hub 5-4.1:1.0: USB hub found
Mär 15 07:47:07 localhost.localdomain kernel: hub 5-4.1:1.0: 4 ports detected
Mär 15 07:47:07 localhost.localdomain kernel: usb 5-4.1.1: new full-speed USB device number 11 using xhci_hcd
Mär 15 07:47:08 localhost.localdomain kernel: usb 5-4.1.1: New USB device found, idVendor=046d, idProduct=c22d, bcdDevice=11.72
Mär 15 07:47:08 localhost.localdomain kernel: usb 5-4.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Mär 15 07:47:08 localhost.localdomain kernel: usb 5-4.1.1: Product: G510s Gaming Keyboard
Mär 15 07:47:08 localhost.localdomain kernel: usb 5-4.1.1: Manufacturer: Logitech
Mär 15 07:47:08 localhost.localdomain kernel: input: Logitech G510s Gaming Keyboard as /devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1/5-4.1.1:1.0/0003:046D:C22D.000C/input/input46
Mär 15 07:47:08 localhost.localdomain kernel: lg-g15 0003:046D:C22D.000C: input,hidraw2: USB HID v1.11 Keyboard [Logitech G510s Gaming Keyboard] on usb-0000:0d:00.3-4.1.1/input0
Mär 15 07:47:08 localhost.localdomain kernel: input: LogMär 15 06:47:55 famserver.fritz.box kernel: input: Logitech G510s Gaming Keyboard as /devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1/5-4.1.1:1.0/0003:046D:C22D.003F/input/input131
.
.
.
Mär 15 06:47:55 famserver.fritz.box kernel: lg-g15 0003:046D:C22D.003F: input,hidraw2: USB HID v1.11 Keyboard [Logitech G510s Gaming Keyboard] on usb-0000:0d:00.3-4.1.1/input0
Mär 15 06:47:55 famserver.fritz.box kernel: input: Logitech G510s Gaming Keyboard Consumer Control as /devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1/5-4.1.1:1.1/0003:046D:C22D.0040/input/input133
Mär 15 06:47:55 famserver.fritz.box kernel: lg-g15 0003:046D:C22D.0040: input,hidraw3: USB HID v1.11 Device [Logitech G510s Gaming Keyboard] on usb-0000:0d:00.3-4.1.1/input1
Mär 15 06:47:56 famserver.fritz.box kernel: lg-g15 0003:046D:C22D.0040: Error disabling keyboard emulation for the G-keys
Mär 15 06:47:56 famserver.fritz.box kernel: lg-g15: probe of 0003:046D:C22D.0040 failed with error -32
Mär 15 06:47:56 famserver.fritz.box kernel: usbhid 5-4.1.1:1.2: can't add hid device: -32
Mär 15 06:47:56 famserver.fritz.box kernel: usbhid: probe of 5-4.1.1:1.2 failed with error -32
itech G510s Gaming Keyboard Consumer Control as /devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1/5-4.1.1:1.1/0003:046D:C22D.000D/input/input48
Mär 15 07:47:08 localhost.localdomain kernel: lg-g15 0003:046D:C22D.000D: input,hidraw3: USB HID v1.11 Device [Logitech G510s Gaming Keyboard] on usb-0000:0d:00.3-4.1.1/input1
.
Mär 15 07:47:08 localhost.localdomain kernel: input: Logitech Gaming Keyboard Gaming Keys as /devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1/5-4.1.1:1.1/0003:046D:C22D.000D/input/input47
Mär 15 07:47:08 localhost.localdomain kernel: input: Logitech G510s Gaming Keyboard as /devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1/5-4.1.1:1.2/0003:046D:C22D.000E/input/input50
Mär 15 07:47:08 localhost.localdomain kernel: lg-g15 0003:046D:C22D.000E: input,hidraw4: USB HID v1.11 Mouse [Logitech G510s Gaming Keyboard] on usb-0000:0d:00.3-4.1.1/input2
Mär 15 07:47:08 localhost.localdomain mtp-probe[2092]: checking bus 5, device 11: "/sys/devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1"
Mär 15 07:47:08 localhost.localdomain mtp-probe[2092]: bus: 5, device: 11 was not an MTP device
.
.
Running session: Last information in the current session:
Mär 15 17:34:07 famserver.fritz.box kernel: input: Logitech G510s Gaming Keyboard as /devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1/5-4.1.1:1.0/0003:046D:C22D.557B/input/input36543
Mär 15 17:34:07 famserver.fritz.box kernel: lg-g15 0003:046D:C22D.557B: input,hidraw2: USB HID v1.11 Keyboard [Logitech G510s Gaming Keyboard] on usb-0000:0d:00.3-4.1.1/input0
Mär 15 17:34:07 famserver.fritz.box kernel: input: Logitech G510s Gaming Keyboard Consumer Control as /devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1/5-4.1.1:1.1/0003:046D:C22D.557C/input/input36545
Mär 15 17:34:07 famserver.fritz.box kernel: lg-g15 0003:046D:C22D.557C: input,hidraw3: USB HID v1.11 Device [Logitech G510s Gaming Keyboard] on usb-0000:0d:00.3-4.1.1/input1
Mär 15 17:34:07 famserver.fritz.box kernel: lg-g15 0003:046D:C22D.557C: Error disabling keyboard emulation for the G-keys
Mär 15 17:34:07 famserver.fritz.box kernel: lg-g15: probe of 0003:046D:C22D.557C failed with error -32
Mär 15 17:34:07 famserver.fritz.box kernel: input: Logitech G510s Gaming Keyboard as /devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1/5-4.1.1:1.2/0003:046D:C22D.557D/input/input36547
Mär 15 17:34:07 famserver.fritz.box kernel: lg-g15 0003:046D:C22D.557D: input,hidraw3: USB HID v1.11 Mouse [Logitech G510s Gaming Keyboard] on usb-0000:0d:00.3-4.1.1/input2
Mär 15 17:34:07 famserver.fritz.box mtp-probe[632124]: checking bus 5, device 93: "/sys/devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1"
Mär 15 17:34:07 famserver.fritz.box mtp-probe[632124]: bus: 5, device: 93 was not an MTP device
Mär 15 17:34:07 famserver.fritz.box systemd-logind[1157]: Watching system buttons on /dev/input/event26 (Logitech G510s Gaming Keyboard)
Mär 15 17:34:07 famserver.fritz.box mtp-probe[632155]: checking bus 5, device 93: "/sys/devices/pci0000:00/0000:00:08.1/0000:0d:00.3/usb5/5-4/5-4.1/5-4.1.1"
Mär 15 17:34:07 famserver.fritz.box mtp-probe[632155]: bus: 5, device: 93 was not an MTP device

Comment 5 Holger Schranz 2020-03-15 17:22:11 UTC
Hello Hans,

meanwhile I have done the modification to prevent the load of the driver
 /etc/modprobe/blacklist-g15.conf

and the problem doesn't occur at the startup and in the running system it seems
it runs well.

Thank you very much !! 

Best regards

Holger

Comment 6 Hans de Goede 2020-03-15 17:28:57 UTC
Thank you for the quick feedback and good to hear that the blacklist helps.

I've written a kernel patch which makes the hid-lg-g15 fall back to the generic hid-input driver when the error happens because a KVM is used. This fixes the media keys not working for me.

But as said in your case, with all the extra errors, things are a bit different. So I'm not sure if the patch will help for you. Still I'm curious if it helps.

I've started a scratch-build of the latest Fedora kernel with the patch added:
https://koji.fedoraproject.org/koji/taskinfo?taskID=42495983

Note this is still building atm (this takes aprox. 2 hours).

When it is done building, please give this kernel a try, see here:
https://fedorapeople.org/~jwrdegoede/kernel-test-instructions.txt

For generic instructions for installing a kernel directly from koji (Fedora's buildsystem).

Note do not forget to remove the blacklist before installing this kernel; you can verify that the blacklist is not interfering by doing: "lsmod | grep g15" to check that the driver has loaded.

Comment 7 Holger Schranz 2020-03-15 19:41:16 UTC
Great , i will test it and report you

Best regards 

Holger

Comment 8 Holger Schranz 2020-03-15 22:01:40 UTC
Hello Hans,

the test is done ... unfortunately the issue occur again at the startup.
Before the test I have moved th blacklist-g15.conf away and build start a mkinitrd.
So the environment was clean.

[root@famserver ~]# hostnamectl
   Static hostname: localhost.localdomain
Transient hostname: famserver.fritz.box
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: 3c2b56f608b54b4d9078cb751705850c
           Boot ID: 3cb7418854334f208d3828412946dd2f
  Operating System: Fedora 31 (Server Edition)
       CPE OS Name: cpe:/o:fedoraproject:fedora:31
            Kernel: Linux 5.5.9-200.rhbz1806321.fc31.x86_64
      Architecture: x86-64
[root@famserver ~]# dmesg > /tmp/dmesg-keyboard-lg15.txt
[root@famserver ~]# ll /tmp/dmesg-keyboard-lg15.txt 
-rw-r--r--. 1 root root 143641 15. Mär 22:55 /tmp/dmesg-keyboard-lg15.txt
[root@famserver ~]# lsmod | grep lg15
[root@famserver ~]# lsmod | grep g15
hid_lg_g15             20480  0
[root@famserver ~]# 

I have upload the dmesg-file.

If you need any additional help let me know.

Best regards

Holger

Comment 9 Holger Schranz 2020-03-15 22:02:37 UTC
Created attachment 1670368 [details]
Dmesg file with 5.5.9-kernel

Comment 10 Holger Schranz 2020-03-16 06:36:51 UTC
Hello Hans,

one additional information.
It looks/seems that the problem occur only at the boot time now.
Since a half hour, the problem doesn't occur in the running system.
In the past it occurs all 5 - 10 min.

Best regards

Holger

Comment 11 Holger Schranz 2020-03-16 06:56:36 UTC
:( .... Just in this moment the issue occur in the running system again ....

Comment 12 Hans de Goede 2020-03-16 10:06:53 UTC
Ok, looking at your log you are indeed running the new kernel (and I properly added the patch( and it is behaving as expected, the error now is:

lg-g15 0003:046D:C22D.0013: Error -32 disabling keyboard emulation for the G-keys, falling back to generic hid-input driver

But as I was afraid this does not help, it seems that just trying to use the advanced gaming features confuses your KVM to a point where things break.

So I'm afraid that the only solution is to blacklist the driver. Which is a bit unfortunate as I always prefer for things to work out of the box, but I see no other option here. So I'm going to close this with a resolution of can'tfix and as said I suggest you use the blacklist as a workaround.

One last thing which you could try is upgrading your KVM's firmware. I've upgrade mine somewhat recently. IIRC this requires connecting it to a Windows machine. See here for firmware upgrades for your KVM:

https://www.aten.com/global/en/supportcenter/downloads/?q=CS782DP

And from the release notes:

v1.2.115 1. Improved KVM performance.
v1.2.114 1. Improved the keyboard and mouse compatibility.
v1.2.113 1. Improved the compatibility with USB peripherals.
etc.

So a firmware update might help.

Comment 13 Holger Schranz 2020-03-16 10:22:14 UTC
Hello Hans,

I agree the result. And yes, blacklist lg15 driver and it runs well.
Also thanks for the hint I will try to update the ATEN.

Cu and best regards

Holger

Comment 14 Hans de Goede 2020-03-16 10:29:32 UTC
p.s.

I just checked for my own model and the ATEN firmware upgrade process is somewhat complicated, it is described in the user-manual (at least for my model it is).


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