Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp523037rwd; Wed, 31 May 2023 01:28:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7LaK+6VcodnBSuX0GT9UgNyoiXxb9QHAdmpC6TGhy6H7riCyaJoP04zWgjGzltddDvZw28 X-Received: by 2002:a05:622a:1905:b0:3f8:5:fcd1 with SMTP id w5-20020a05622a190500b003f80005fcd1mr5147830qtc.25.1685521682377; Wed, 31 May 2023 01:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685521682; cv=none; d=google.com; s=arc-20160816; b=Afb5EP7KGYBuOaCbK0JEGSrRf5MF2ndPAWmMwkRUZMw4lXzJArglSUzai1twCOcXHj IObxDSkx247sK6lggxYWObHpISx90tjGDgqYIoqUo+VXP9b6SFWgV/ppJdtz0lRsnpfK El8nbkd71m/b/q+DRt9eDmpjm9H3DS6yG1KvftuUTKAYa5dDgxFMB4+oESWXYcFpBcQV F9tP0OdQMZUA12Fwk5a9GYHodgbp2BWo4q70XSiS5J9hOMoJ4xeIWJf28HHfxeqZpsFf 44bA7NURH00qAWQjd8p/aOvbO8zKzULU/++7Mjyc9UjGm+tBVECQIzUYJlhNfl68XiVC ZqNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=fqtbpjR48QiUI5mpdVCjGN6WECkdRYTuJaM8RG/ThfQ=; b=MSQk2NrRsayHv5AlCMGuXNKRn7CSTZXmV/pBukLzWHk9s+hCoPYQg/8eK4/HpnboyX gR3OtiNOyMDwSIFmjUIafEICjV5DZTlt4ml0jWPaJ7FtB+9oOSBHGxiMhrpNSzEJ2xFm hH/FY36MV9rJXDHOnJpdWcxNdijtq1lvbSZvOwa8c+vl2wdqqCCktxhw2VorBdNa6J1P kgF6k0RVQnojbq2P0wpxvdPf1nftPy4UIC7A1cpzfRlphWhVpZEKgYv/E2c5L+RQFB4c HoYaqvbyl+Uan0jEhde7IeeCFpLz5YLMhJEHpPY1Rx/mcbJUpsOyHoXGRkaTduZ+oCHZ Vz9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a1709029f8e00b001ab012a1ba9si458862plq.402.2023.05.31.01.27.46; Wed, 31 May 2023 01:28:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234881AbjEaIYh (ORCPT + 99 others); Wed, 31 May 2023 04:24:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234862AbjEaIYe (ORCPT ); Wed, 31 May 2023 04:24:34 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44D3BBE; Wed, 31 May 2023 01:24:32 -0700 (PDT) X-GND-Sasl: hadess@hadess.net X-GND-Sasl: hadess@hadess.net X-GND-Sasl: hadess@hadess.net X-GND-Sasl: hadess@hadess.net X-GND-Sasl: hadess@hadess.net X-GND-Sasl: hadess@hadess.net X-GND-Sasl: hadess@hadess.net X-GND-Sasl: hadess@hadess.net Received: by mail.gandi.net (Postfix) with ESMTPSA id 219601BF20B; Wed, 31 May 2023 08:24:28 +0000 (UTC) From: Bastien Nocera To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jiri Kosina , Benjamin Tissoires , "Peter F . Patel-Schneider" , =?UTF-8?q?Filipe=20La=C3=ADns?= , Nestor Lopez Casado , Mark Lord Subject: [PATCH] HID: logitech-hidpp: Handle timeout differently from busy Date: Wed, 31 May 2023 10:24:28 +0200 Message-Id: <20230531082428.21763-1-hadess@hadess.net> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Suggested-by: Mark Lord 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