Linux Input/HID development
 help / color / mirror / Atom feed
From: Phobos <phobos@mumbletreff.com>
To: linux-input@vger.kernel.org
Cc: jikos@kernel.org, bentiss@kernel.org
Subject: HID: lenovo: cptkbd probe blocks ~20 s per device when feature reports time out (behind KVM switch)
Date: Thu, 19 Nov 2026 17:55:04 +0100	[thread overview]
Message-ID: <d426ab73-e1aa-43da-a6ca-8fbb05362aaa@mumbletreff.com> (raw)

Hi,

with the ThinkPad Compact USB Keyboard with TrackPoint (17ef:6047)
connected through a USB KVM switch (ASIX AX68002, 0b95:6802), probing
the mouse interface in hid-lenovo blocks for about 20 seconds per
keyboard. With two KVM ports this delays usable keyboard/mouse input
until ~46 s after boot; GDM/gnome-shell is already up at ~9 s.

Kernel: 6.18.63 (Gentoo distribution kernel, Fedora-based config,
CONFIG_HID_LENOVO=m). I checked current mainline hid-lenovo.c and the
relevant code is unchanged.

The KVM switch emulates the keyboard and does not pass the vendor
feature reports (report 0x13, SET_REPORT) through, so every
lenovo_send_cmd_cptkbd() call ends in a 5 s USB control timeout:

   [   10.026746] lenovo 0003:17EF:6047.0003: Failed to switch F7/9/11 mode: -110
   [   15.146706] lenovo 0003:17EF:6047.0003: Failed to switch middle button: -110
   [   20.266709] lenovo 0003:17EF:6047.0003: Fn-lock setting failed: -110
   [   25.386681] lenovo 0003:17EF:6047.0003: Sensitivity setting failed: -110
   [   25.387037] input: Lenovo ThinkPad Compact USB Keyboard with TrackPoint as .../2-14.4.1:1.0/...
   [   30.720038] lenovo 0003:17EF:6047.0008: Failed to switch F7/9/11 mode: -110
   [   35.840036] lenovo 0003:17EF:6047.0008: Failed to switch middle button: -110
   [   40.960040] lenovo 0003:17EF:6047.0008: Fn-lock setting failed: -110
   [   46.080009] lenovo 0003:17EF:6047.0008: Sensitivity setting failed: -110
   [   46.258842] systemd-logind: Watching system buttons on /dev/input/event22 (Lenovo ThinkPad Compact USB Keyboard with TrackPoint)

USB topology (lsusb -t, abbreviated):

   Port 014: Hub 1a40:0101
     Port 003: Hub 0b95:6802 (ASIX AX68002 KVM Switch SoC)
       Port 001: 17ef:6047 ThinkPad Compact Keyboard with TrackPoint
       Port 002: 1532:0098 Razer DeathAdder Essential
     Port 004: Hub 0b95:6802 (second KVM port, same devices)

lenovo_features_set_cptkbd() sends four commands synchronously from
probe and continues after each failure, so a device that never answers
costs 4 x 5 s. While the probe runs, the udev events for the other
devices behind the same hub are not processed either, so the keyboard
is unusable for the whole time.

Possible improvements (I'm not familiar enough with the driver to say
which is preferred):

   1. Stop sending the remaining feature reports after the first one
      fails with -ETIMEDOUT (and maybe skip creating the sysfs
      attributes that cannot work).
   2. Send the initial settings from a workqueue instead of blocking
      probe.

A second, related issue: simply blacklisting hid_lenovo does not fall
back to hid-generic. 17ef:6047 is listed in hid_have_special_driver,
so HID_QUIRK_HAVE_SPECIAL_DRIVER is set whenever CONFIG_HID_LENOVO is
enabled, and hid-generic refuses the device even if hid-lenovo is not
loaded. The keyboard then has no driver at all. With the kernel built
without CONFIG_HID_LENOVO everything worked through hid-generic.

Workaround (tested): booting with usbhid.quirks=0x17ef:0x6047:0x0
(the dynamic quirk replaces the static ones, including
HAVE_SPECIAL_DRIVER) plus "blacklist hid_lenovo" makes hid-generic
bind all four interfaces at ~4.3 s; keyboard and TrackPoint are usable
as soon as GDM is up and no timeouts are logged.

Happy to test patches.

Thanks,
Phobos


                 reply	other threads:[~2026-11-19 16:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d426ab73-e1aa-43da-a6ca-8fbb05362aaa@mumbletreff.com \
    --to=phobos@mumbletreff.com \
    --cc=bentiss@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox