All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, "Jiri Kosina" <jikos@kernel.org>,
	"Benjamin Tissoires" <benjamin.tissoires@redhat.com>,
	"Peter F . Patel-Schneider" <pfpschneider@gmail.com>,
	"Filipe Laíns" <lains@riseup.net>,
	"Nestor Lopez Casado" <nlopezcasad@logitech.com>,
	"Mark Lord" <mlord@pobox.com>
Subject: [PATCH] HID: logitech-hidpp: Handle timeout differently from busy
Date: Wed, 31 May 2023 10:24:28 +0200	[thread overview]
Message-ID: <20230531082428.21763-1-hadess@hadess.net> (raw)

If an attempt at contacting a receiver or a device fails because the
receiver or device never responds, don't restart the communication, only
restart it if the receiver or device answers that it's busy, as originally
intended.

This was the behaviour on communication timeout before commit 586e8fede795
("HID: logitech-hidpp: Retry commands when device is busy").

This fixes some overly long waits in a critical path on boot, when
checking whether the device is connected by getting its HID++ version.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Suggested-by: Mark Lord <mlord@pobox.com>
Fixes: 586e8fede795 ("HID: logitech-hidpp: Retry commands when device is busy")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217412
---
 drivers/hid/hid-logitech-hidpp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 0fcfd85fea0f..2246044b1639 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -314,6 +314,7 @@ static int hidpp_send_message_sync(struct hidpp_device *hidpp,
 			dbg_hid("%s:timeout waiting for response\n", __func__);
 			memset(response, 0, sizeof(struct hidpp_report));
 			ret = -ETIMEDOUT;
+			goto exit;
 		}
 
 		if (response->report_id == REPORT_ID_HIDPP_SHORT &&
-- 
2.40.1


             reply	other threads:[~2023-05-31  8:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31  8:24 Bastien Nocera [this message]
2023-05-31 14:07 ` [PATCH] HID: logitech-hidpp: Handle timeout differently from busy Jiri Kosina
2023-06-03 12:41   ` Jiri Kosina
2023-06-03 13:17     ` Mark Lord
2023-06-05 14:20       ` Benjamin Tissoires
2023-06-05 14:31         ` Mark Lord
2023-06-05  8:44     ` Linux regression tracking (Thorsten Leemhuis)
2023-06-05 14:27       ` Benjamin Tissoires
2023-06-05 16:25         ` Mark Lord
2023-06-05 17:04           ` Benjamin Tissoires
2023-06-05 17:47             ` Mark Lord
2023-06-05 20:03               ` Jiri Kosina
2023-06-06 13:27       ` Jiri Kosina
2023-06-06 18:18         ` Linux regression tracking (Thorsten Leemhuis)
2023-06-06 18:37           ` Benjamin Tissoires
2023-06-07  9:46             ` Greg Kroah-Hartman
2023-06-07 10:07               ` Benjamin Tissoires
2023-06-15  7:24           ` Linux regression tracking (Thorsten Leemhuis)
2023-06-15 11:24             ` Mark Lord
2023-06-21 14:03               ` Linux regression tracking (Thorsten Leemhuis)
2023-06-21 15:10                 ` Benjamin Tissoires
2023-06-21 17:19                   ` Linux regression tracking (Thorsten Leemhuis)

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=20230531082428.21763-1-hadess@hadess.net \
    --to=hadess@hadess.net \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=lains@riseup.net \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlord@pobox.com \
    --cc=nlopezcasad@logitech.com \
    --cc=pfpschneider@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.