Message ID | 20221110204131.1354704-1-abergmeier@gmx.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp372976wru; Thu, 10 Nov 2022 13:01:59 -0800 (PST) X-Google-Smtp-Source: AMsMyM57fU8Q5QmOuOxaYL80COP7SC6BK29pl8YotXUOANMBvhNJWQSOg46e4yKjpn55n77CkDJN X-Received: by 2002:a62:7b16:0:b0:563:9203:cc53 with SMTP id w22-20020a627b16000000b005639203cc53mr3465679pfc.20.1668114119335; Thu, 10 Nov 2022 13:01:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668114119; cv=none; d=google.com; s=arc-20160816; b=nLIjFZGO3APGqBuPVmLIV27pXN861cYLsKmjHHxDZONmRSpiZgH8HGQG+vyn2IRYdr K0hfltMSW1iXQjJS3xKOM72rGasA0SiwWvKyTUp527FBTQ92qrmRlQe2YliCeS+O6AA7 M/5L0qYiKXPcWhzzjzhMcD1unwSGTgwJ0W7TFU1PBhKkU2pxA8kAXWSnfpomB/xl47Ma ZGd5kEv7fY2V0hYuwdG4s/kSV0kW5DVmJ0axF3PNORYw4OUobHwRwlzP1gwWzwvE0+5H AhvkJSol/tEBUI1YQa4t+Tc4LPr7WEXVm4J7kAG38fgGWH9WQC3NZ6Gbd/TaZaVbMjOt QuYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=M/8qEZ+yhJQXiMRpaJeAXWGlL3Iw/WCdNtuAjfmaMkY=; b=DRtYGZrDea/qaUKmsMGQA3DUHMJf29+x3FMqZr2h7Ye5+gjOMwDn9Pq8+/WPFNt1gb bG0ucx/0jG7krQnP2S5ZwK3hDhTtdlgYbrZQQ5Y2x/OwGR1o4SKp2UbWKvAUTbKMvL9s 1Slshr6ryG2jAujyH05VKPYbDptib0aF3BaLvJR9frGTEE9uwq3dMvkxCTQ8xYrSUmtb PjlP/aBPHdiWkvmjnDNSamOOCJ9c/sEN0gVKxhYLX+NaIDyc4gdgcQS6qvew05NMojai 8lxSst2fDSelPeEN9jplglC0jPVYoQQWQDTTr5PZxkL+bwo7p0Or8VmxdO3/Y2TCougy ZjjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=s31663417 header.b=CTWPiCTt; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmx.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q22-20020a056a00151600b0054ed3047ee2si294600pfu.22.2022.11.10.13.01.43; Thu, 10 Nov 2022 13:01:59 -0800 (PST) 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; dkim=pass header.i=@gmx.net header.s=s31663417 header.b=CTWPiCTt; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmx.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231665AbiKJUmi (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Thu, 10 Nov 2022 15:42:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbiKJUmh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 10 Nov 2022 15:42:37 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A7C11FFAB; Thu, 10 Nov 2022 12:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1668112944; bh=rmo4JVfDog5xAigKtgT2UyaJyCUuTBirPqF3UvRgNGg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=CTWPiCTt3OfjxbfwCSChhbmwC2q3vratLIC88YKuhQO3hfyufij8BkkeWbgFbdq5a IebRXydGJafemUr3/VZwtdWAovcja29DG/kKS3IO+gzZiDlh9BfgMGrV0JzwbI7vab h02frJfFTOiQVp9BdubJC7ZYchjb2R/oWVvcNruALUSpy6jsmLCx7Iqry9vbjSiHHW itxxFu7IzSKyj/jYw4R4VGQaU49rpiKWz/OLFrgcRevFhw1lxuL5nkz2pM5nqPc9yv 1ohG2hpUHaszYXQ1GA7zm8wjZ1hEY8YEj16ri45vN0tS/DV2qTrP7l1BC6LQVccThL SFJnQ2yPyttUA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from 9300.fritz.box ([93.221.18.29]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mnaof-1pIMa53f0P-00jZKG; Thu, 10 Nov 2022 21:42:24 +0100 From: Andreas Bergmeier <abergmeier@gmx.net> To: lains@riseup.net, jikos@kernel.org, benjamin.tissoires@redhat.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] HID: Print specific timeout error in probe Date: Thu, 10 Nov 2022 21:41:31 +0100 Message-Id: <20221110204131.1354704-1-abergmeier@gmx.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Ky7vsQJgKylO0bQBYoz3/sjTpGST/K5TWHtrBgRZcoKfPj1gLJH 68CEczY+P6P94vvacNTilBDE/vvbcT3kLJIGrpP8evMQvBFaGxldkmrEWd6nT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CKfeQLq93yeQcvQvRcNDAc+04yFAGFYdwrHT0KVqHHOoIO4yICm9Gf rYlhQg== X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749144431155267903?= X-GMAIL-MSGID: =?utf-8?q?1749144431155267903?= |
Series |
[1/1] HID: Print specific timeout error in probe
|
|
Commit Message
Andreas Bergmeier
Nov. 10, 2022, 8:41 p.m. UTC
When -ETIMEOUT gets reported ensure that the error message mentiones
timeout.
Signed-off-by: Andreas Bergmeier <abergmeier@gmx.net>
---
drivers/hid/hid-logitech-hidpp.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--
2.34.1
Comments
On Thu, 10 Nov 2022, Andreas Bergmeier wrote: > When -ETIMEOUT gets reported ensure that the error message mentiones > timeout. > > Signed-off-by: Andreas Bergmeier <abergmeier@gmx.net> > --- > drivers/hid/hid-logitech-hidpp.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c > index 20ae7f73ef08..a0c148a8df6c 100644 > --- a/drivers/hid/hid-logitech-hidpp.c > +++ b/drivers/hid/hid-logitech-hidpp.c > @@ -4438,12 +4438,16 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id) > if (hidpp->quirks & HIDPP_QUIRK_UNIFYING) > hidpp_unifying_init(hidpp); > > - connected = hidpp_root_get_protocol_version(hidpp) == 0; > + ret = hidpp_root_get_protocol_version(hidpp); > + connected = ret == 0; > atomic_set(&hidpp->connected, connected); > if (!(hidpp->quirks & HIDPP_QUIRK_UNIFYING)) { > if (!connected) { > + if (ret == -ETIMEDOUT) > + hid_err(hdev, "Device connection timed out"); > + else > + hid_err(hdev, "Device not connected"); > ret = -ENODEV; > - hid_err(hdev, "Device not connected"); Printing as specific error as possible makes sense to me. I am however wondering whether the better aproach (covering all the cases, not just ETIMEDOUT specifically) wouldn't be to convert all the dbg_hid() in hidpp_send_message_sync() to be proper error messages instead? That would cover also your case, as ETIMEDOUT is handled there as well with debugging message. Thanks,
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 20ae7f73ef08..a0c148a8df6c 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -4438,12 +4438,16 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id) if (hidpp->quirks & HIDPP_QUIRK_UNIFYING) hidpp_unifying_init(hidpp); - connected = hidpp_root_get_protocol_version(hidpp) == 0; + ret = hidpp_root_get_protocol_version(hidpp); + connected = ret == 0; atomic_set(&hidpp->connected, connected); if (!(hidpp->quirks & HIDPP_QUIRK_UNIFYING)) { if (!connected) { + if (ret == -ETIMEDOUT) + hid_err(hdev, "Device connection timed out"); + else + hid_err(hdev, "Device not connected"); ret = -ENODEV; - hid_err(hdev, "Device not connected"); goto hid_hw_init_fail; }