Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5871855rwd; Mon, 5 Jun 2023 09:37:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ49zrS50qTrVQokB1Ku8WR8ljwotnZU+c4ONmTftyDWVn+wlLVy6GJAkwFH9VFuVemQwKy7 X-Received: by 2002:a17:902:d490:b0:1a9:433e:41e7 with SMTP id c16-20020a170902d49000b001a9433e41e7mr5955674plg.43.1685983036214; Mon, 05 Jun 2023 09:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685983036; cv=none; d=google.com; s=arc-20160816; b=RnjsuBsQ7Av5zg++x/vy4syqARKG/Bnmh8n5F9/jsqytf+RKoO61KFyBjs4moNzOo7 JdHEuMpRpmZQ6ago2TEjEyFbUjjODAfljP7rYmKfl99E5jgSTnT79KyaYkDvmdjAjA/C qjl6SG0JAqDZu5CACoqlmRI4myEaAEpRYyf93ML+bZO/lczAM2A3MkbhYwf46Xuum43n ZVqn7EN+Dj+bjnnMSzc2Sv4WoavKqzwunUU+HCZx5cW5MBnnrheot8ydD8lDWlbE4dhk 9NJZTJF1rcd7BzS2MO1uxlAf5jd7ZE3gGrSMnnOeKNVwhB+Jf/4DxZzf+2OBtqAKf8HT lNtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=iquBDfFnwURN8OuyiHZzQU4jLuzsJC4FbXaOhVbXayw=; b=JM0+tjbQA84gvE7Wrd+FPJbg/Kbr1qUQogFAHC9iF8iBWHgvXsowzDdAbVPGmi8NEu 9rKr8EWjKIkriO1ebSFQUiMzv+knoJ2TNrapAPI898oDHs5p+B3gNv7dIeit5KpO62rC FsbZ2okNLvmskcS3YuNb4dCsUmQvYBpjXIdi+5k33wFpMCb8Rp4X0s7oJn1Arzy2AxVc qefhOoGBNqc+rYBAOglwI1OaEzmQ5VFDVfb9V1sL6Q1JSSVHFZv/MqpHNdHU1lVdVwQ7 RsZgHgCr9nEYEjZSPSy42bg3MCJ5kT6NRpWhngOz6wSuoYq0dgGhO668flR/dn+zRtYd bGUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=WcF8hI+G; 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=NONE dis=NONE) header.from=pobox.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jj18-20020a170903049200b001afc602cd55si5567166plb.21.2023.06.05.09.37.04; Mon, 05 Jun 2023 09:37:16 -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; dkim=pass header.i=@pobox.com header.s=sasl header.b=WcF8hI+G; 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=NONE dis=NONE) header.from=pobox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230374AbjFEQZ3 (ORCPT + 99 others); Mon, 5 Jun 2023 12:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230189AbjFEQZU (ORCPT ); Mon, 5 Jun 2023 12:25:20 -0400 Received: from sasl.smtp.pobox.com (pb-sasl2.pobox.com [64.147.108.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0C92EA; Mon, 5 Jun 2023 09:25:19 -0700 (PDT) Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id F3A6D919A1; Mon, 5 Jun 2023 12:25:16 -0400 (EDT) (envelope-from mlord@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=subject:to :cc:references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=sasl; bh=Kkit9hxeaRzj sC+jEwyCGJmNshi/SBvv1rGprkktDfg=; b=WcF8hI+G3hD4gxX55dXQE6G/SLoe jEKA6SadjiZH2sPbl2flhQQOZ9xE7+Fqg3KMePstywt3afxeJd1WMBfhZs423vTx W8ayQQYGJRluvaUEPVK6YZdGgrPHoi3uOL4w1duEw/pUuXz0oL2y/H8HTtayDN2v anj81MLK88IdkJA= Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id D6DFB9199F; Mon, 5 Jun 2023 12:25:16 -0400 (EDT) (envelope-from mlord@pobox.com) Received: from [10.0.0.9] (unknown [24.156.181.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-sasl2.pobox.com (Postfix) with ESMTPSA id B46879199E; Mon, 5 Jun 2023 12:25:15 -0400 (EDT) (envelope-from mlord@pobox.com) Subject: Re: [PATCH] HID: logitech-hidpp: Handle timeout differently from busy To: Benjamin Tissoires , Linux regressions mailing list Cc: Jiri Kosina , Bastien Nocera , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, "Peter F . Patel-Schneider" , =?UTF-8?Q?Filipe_La=c3=adns?= , Nestor Lopez Casado References: <20230531082428.21763-1-hadess@hadess.net> <15bb2507-a145-7f1b-8e84-58aeb02484b9@leemhuis.info> <7ko33em3pqdaeghkt6wumzks6fz2lzztmqyhyzvv3kisjovmvr@mojlmkmrqlml> From: Mark Lord Message-ID: <2c10eb8f-8804-d47f-7b15-5da56ffb5414@pobox.com> Date: Mon, 5 Jun 2023 12:25:13 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <7ko33em3pqdaeghkt6wumzks6fz2lzztmqyhyzvv3kisjovmvr@mojlmkmrqlml> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Pobox-Relay-ID: 8E120F22-03BD-11EE-A498-77FD3825B25C-82205200!pb-sasl2.pobox.com X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 On 2023-06-05 10:27 AM, Benjamin Tissoires wrote: > > On Jun 05 2023, Linux regression tracking (Thorsten Leemhuis) wrote: >> >> On 03.06.23 14:41, Jiri Kosina wrote: >>> On Wed, 31 May 2023, Jiri Kosina wrote: >>> >>>>> 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 >>> [...] >>>> >>>> I have applied this even before getting confirmation from the reporters in >>>> bugzilla, as it's the right thing to do anyway. >>> >>> Unfortunately it doesn't seem to cure the reported issue (while reverting >>> 586e8fede79 does): >> >> BTW, remind me again: was fixing this by reverting 586e8fede79 for now a >> option? I guess it's not, but if I'm wrong I wonder if that might at >> this point be the best way forward. > > Could be. I don't think we thought at simply reverting it because it is > required for some new supoprted devices because they might differ > slightly from what we currently supported. > > That being said, Bastien will be unavailable for at least a week AFAIU, > so maybe we should revert that patch. > >> >>> https://bugzilla.kernel.org/show_bug.cgi?id=217523#c2 Pardon me, but I don't understand what that "retry" loop is even attempting to do inside function hidpp_send_message_sync(). It appears to unconditionally loop until: (1) the __hidpp_send_report() fails, or (2) it gets a HIDPP_ERROR, or (3) it gets a HIDPP20_ERROR other than HIDPP20_ERROR_BUSY, or (4) until it has looped 3 times, which appears to be the normal exit. It doesn't seem to have any provision to exit the loop earlier on "success" (whatever that is). And so when it finally does exit after the 3 iterations, it then returns the last value of "ret", which will be zero from the __hidpp_send_report() call, or sometimes the most recent non-BUSY HIDPP20_ERROR seen. Obviously I'm missing something, as otherwise this code would never have passed review and made it into the Linux kernel in the first place. Right? What is this code trying to do? And what am I not seeing? -- Mark Lord