Re: [PATCH v3 00/14] HID: logitech-hidpp: G920 force-feedback and battery fixes

From: Jiri Kosina

Date: Fri Nov 20 2026 - 07:14:26 EST


On Fri, 20 Nov 2026, Dmitry Torokhov wrote:

> Per Jiri Kosina's request, the v2 series has been split into this
> 14-patch bug-fix series targeting v7.4 and a separate 18-patch rework
> and cleanup series targeting v7.5. The open-evdev-across-unbind
> force-feedback teardown use-after-free (v2 patch 22/33) is now handled
> in input core ("Input: destroy force-feedback device on input
> unregistration") and has been dropped.
>
> This series starts from Gideon Heinz's report of Logitech G920
> force-feedback initialization timing out in v7.3 and addresses several
> pre-existing bugs and lifetime races in hid-logitech-hidpp.
>
> The force-feedback and teardown fixes temporarily enable device I/O
> around g920_get_config() in hidpp_input_configured(), switch
> hidpp_ff_queue_work() to GFP_ATOMIC since callbacks run under the input
> event spinlock, drain the G920 FF workqueue before closing the HID
> transport on input close, synchronously disable driver work items and
> disconnect input devices with device I/O enabled before stopping the
> transport on removal and probe failure, avoid storing an ERR_PTR in
> battery->ps on registration failure, avoid NULL pointer subtraction in
> the HID++ 1.0 consumer keys report fixup, and fix an off-by-one in G920
> slot tracking that made the 63rd user effect in slot 64 unusable and
> leaked it across reopen.
>
> The transport and battery fixes update hidpp_send_message_sync() to stop
> retrying timeouts and transport errors, initialize response buffers
> before publishing send_receive_buf to eliminate races with concurrent or
> spurious packets, fix HID++ 1.0 battery mileage event parsing and state
> updates, properly propagate negative errors in ADC measurement (0x1f20)
> queries, mark devices online on unified battery (0x1004) events while
> gating 0x1000/0x1004 dispatch, fix K750 solar battery feature lookup and
> reconnect handling, and expose and correctly map the charge_type
> property for the battery voltage (0x1001) feature.
>
> Note that device removal teardown still has limitations due to how HID
> core's hid_device_io_start() and hid_device_io_stop() (via
> driver_input_lock) gate both driver raw command/response I/O and
> subdriver event forwarding, disabling I/O before .remove() and
> hid_disconnect(). For instance, HIDPP_QUIRK_DELAYED_INIT devm-managed
> input devices are still unregistered after hid_hw_stop(), and
> hidpp_connect_event() publishes hidpp->input before input registration
> completes. Resolving these teardown edge cases cleanly will require
> follow-up work in HID core and driver input registration.
>
> Thanks.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
> ---
> Changes in v3:
> - Split out the 14 bug fixes into this series for v7.4 per Jiri Kosina,
> moving the 18 rework and cleanup patches into a separate series for
> v7.5 and dropping v2 patch 22/33 in favor of input core teardown.
> - Collected Tested-by tags from Gideon Heinz on all unchanged patches in
> this series (omitted from patches 12 and 14 which were updated after
> v2 testing).
> - Gated event dispatch in hidpp_raw_hidpp_event() on
> HIDPP_CAPABILITY_UNIFIED_BATTERY so 0x1000 and 0x1004 events are
> routed to their respective handlers instead of cross-corrupting
> battery state.
> - In hidpp20_battery_map_status_voltage(), set charge_type to unknown
> when status is unknown, to none when discharging, full, or not
> charging, and to standard, fast, or trickle only when charging.
> - Reset charge_type to unknown on wireless disconnect in
> hidpp_connect_event().
> - Link to v2: https://patch.msgid.link/20261110-hid-logitech-hidpp-v2-0-30743e91d83b@xxxxxxxxx

Applied to hid.git#for-7.4/upstream-fixes.

Thanks,

--
Jiri Kosina
SUSE Labs