If a receiver is reset on resume, for example because a USB KVM switch moved it to another host while the system was suspended, its paired devices may have reconnected to it while the host was not listening. The connection notification the receiver queued for the host is lost in the USB reset, so hid-logitech-hidpp never re-runs its connect handling for the device. Devices drop host-configured state when they reconnect, so whatever hidpp configured on connect is silently lost. The most visible case is HID++ 2.0 hi-res scrolling: the mouse reverts to low-resolution wheel reports while hidpp keeps scaling them by the hi-res multiplier, so scrolling becomes extremely slow (1/15 of the normal speed on an MX Master 3) until the receiver is replugged or the mouse power cycled. logi_dj_reset_resume() only switches the receiver back to DJ mode. Also ask the receiver to re-announce its connected devices with the HID++ "fake device arrival" request, which is already used to query paired devices on non-DJ receivers, and which Solaar sends to all receivers on startup. The resulting connect notifications are forwarded to the existing child devices, whose drivers then reconfigure them. On Unifying receivers, slots without a known device are then enumerated through DJ notifications; this depends on the previous patch, which stops HID++ connect notifications from adding them. Reproduced with an MX Master 3 on a Unifying receiver (046d:c52b) behind a USB KVM switch: suspend, switch the KVM away and back, move the mouse while the host is still suspended, then resume. Without this change the wheel stays in low-res mode with the hi-res multiplier applied; with it, hidpp re-enables hi-res scrolling after resume. Fixes: 534a7b8e10ec ("HID: Add full support for Logitech Unifying receivers") Link: https://bugzilla.kernel.org/show_bug.cgi?id=203421 Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/528 Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Mark Pariente --- drivers/hid/hid-logitech-dj.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index 383c762c503f..4230c47713ee 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -2016,6 +2016,16 @@ static int logi_dj_reset_resume(struct hid_device *hdev) return 0; logi_dj_recv_switch_to_dj_mode(djrcv_dev, 0); + + /* + * Paired devices may have reconnected and lost their configuration + * (e.g. hi-res scrolling) while the receiver was unpowered or switched + * away by a KVM. Have the receiver re-announce connected devices so + * the child drivers run their connect handling again. + */ + if (djrcv_dev->dj_mode && logi_dj_recv_query_hidpp_devices(djrcv_dev)) + hid_err(hdev, "%s: failed to query connected devices\n", __func__); + return 0; } -- 2.56.0