Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Andrea Spitaleri <spita90@gmail.com>
To: Jiri Kosina <jikos@kernel.org>, Benjamin Tissoires <bentiss@kernel.org>
Cc: "Andrea Spitaleri" <spita90@gmail.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Filipe Laíns" <lains@riseup.net>,
	linux-input@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH] HID: logitech-hidpp: fix G920 force feedback init timing out
Date: Mon, 30 Nov 2026 15:13:06 +0100	[thread overview]
Message-ID: <20261130141337.14283-1-spita90@gmail.com> (raw)

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


                 reply	other threads:[~2026-11-30 14:14 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=20261130141337.14283-1-spita90@gmail.com \
    --to=spita90@gmail.com \
    --cc=bentiss@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=lains@riseup.net \
    --cc=linux-input@vger.kernel.org \
    --cc=stable@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