Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH] HID: logitech-hidpp: fix G920 force feedback init timing out
@ 2026-11-30 14:13 Andrea Spitaleri
  0 siblings, 0 replies; only message in thread
From: Andrea Spitaleri @ 2026-11-30 14:13 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: Andrea Spitaleri, Dmitry Torokhov, Filipe Laíns, linux-input,
	stable

Since commit 544315e40172 ("HID: logitech-hidpp: move FF initialization
to .input_configured()"), the force feedback of the G920 (and of the
G923 for Xbox, which shares its class) no longer initializes:

  logitech-hidpp-device 0003:046D:C262.000A: Unable to initialize force feedback support, errno -110

hidpp_input_configured() runs from hid_connect(), which hidpp_probe()
calls right after hid_device_io_stop(). While IO is stopped,
__hid_input_report() cannot take driver_input_lock and drops every
incoming report, so the answer to the first HID++ request of
g920_get_config() never reaches hidpp_raw_event().
hidpp_send_message_sync() waits 5 seconds for it, gets an empty response,
tries twice more and returns -ETIMEDOUT: the probe takes 15 seconds
longer and the wheel is left without force feedback.

Start IO for the duration of the force feedback initialization.
hdev->claimed is still empty at that point, so the incoming reports only
reach the driver's raw_event, not hid-input, hiddev or hidraw, which are
not connected yet.

Tested on a G920 (046d:c262) with 7.3.4: the wheel probes at once and
has its force feedback again, as on 7.2.

Fixes: 544315e40172 ("HID: logitech-hidpp: move FF initialization to .input_configured()")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Andrea Spitaleri <spita90@gmail.com>
---
 drivers/hid/hid-logitech-hidpp.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 60fc6b8..6abf07b 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -4092,13 +4092,25 @@ static int hidpp_input_configured(struct hid_device *hdev, struct hid_input *hid
 
 	if (hidpp->quirks & HIDPP_QUIRK_CLASS_G920) {
 		struct hidpp_ff_private_data data;
+		bool io_stopped;
 
 		if (!list_is_first(&hidinput->list, &hdev->inputs))
 			return 0;
 
+		/*
+		 * hidpp_probe() stops IO before hid_connect(), which calls us,
+		 * so the answers to the HID++ requests below would be dropped.
+		 * Allow incoming packets meanwhile: hdev->claimed is not set
+		 * yet, so they only reach hidpp_raw_event().
+		 */
+		io_stopped = !hdev->io_started;
+		if (io_stopped)
+			hid_device_io_start(hdev);
 		ret = g920_get_config(hidpp, &data);
 		if (!ret)
 			ret = hidpp_ff_init(hidpp, &data);
+		if (io_stopped)
+			hid_device_io_stop(hdev);
 
 		if (ret) {
 			hid_warn(hidpp->hid_dev,
-- 
2.56.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-30 14:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 14:13 [PATCH] HID: logitech-hidpp: fix G920 force feedback init timing out Andrea Spitaleri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox