Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp581814lqd; Wed, 24 Apr 2024 10:34:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUpSPmwNhB+VNZCOJz/M7c9gBjbTxghwaeyGLalUGrxJwDsy4TlD4OnmSDqmw1sEOzUK5VqKg6ViLt0Hgz8NfxVUAWF0zYh0Kd8/6+YWQ== X-Google-Smtp-Source: AGHT+IHi52aG1aAKWMPg80vIxfOM3z7OO0n+D2J1XkpmywU1MLPDU0fcKBW/a0BZWbT4Aq1j288j X-Received: by 2002:a05:6a00:c86:b0:6f0:c828:87ef with SMTP id a6-20020a056a000c8600b006f0c82887efmr4227616pfv.3.1713980072032; Wed, 24 Apr 2024 10:34:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713980072; cv=pass; d=google.com; s=arc-20160816; b=kbB49/IjM1dV+ubVVepHSSxepIV7uvg8G6/HPLOQkAW3ItRb17Eb3en/WzIf3VjJPe dBfChQPtYMFRh1Q2C6E/EoqADe7z+Q5zuAro9kue/3aCWK5tq2FXauegJti6eCiru84T V9F2eAmaVU88oJP7RxJpK9tZR/iJm2AxbsQSs4/E74xrE09eVfAcy1jG8AZ9tNsDeip7 5IzB1iFlxcAoEAB5EwuXew44wmocmtJBtJzq6BOxcjOFx/2/9Mcqy4i8oMbtQEBUCVN6 3c1WToQyJ95mzc+BNxC9u8Qpl1zk+W7PZkzxu1AlQuqSoIIPwBsKHAAWbZh8s5mG31zm 4r9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Gr5w+NNXaBuu9MFvS/3sV7owIcp9t8FJfSpSoyXuyTk=; fh=jqe/5r5dHgcbbQ/Q+tjYnSe2DPVPCA0DymtHakSp66c=; b=xFkojXhl/n17D+Y9AAeE61oUYj8TwpjYl7MpHeENzPB7DZCyjg2l+wN6nz8i/S6G/6 ie6puIq/cOJI5mBMVRKOeX2unbJ3BggG2ph5LV5L9G2RNl1/6Q/r55iZIIyB4DHM2xAn TDVfeyFwmUHFH0nFYRa7WuieIjYMOeoRBJiQyY9WCoLgeympFj34UBbuko3M2XmJJ5Wc gL2txPd0Gr4m7QfQJFWU/LCUoNuP3oQoggt0WkPEulFqvinXdWzwB0jzDZ+c5J6cqxfv Zma+/lNVrGGVzaq7g2ztXaraV+SxWFx2AcPCe2dPEENrUlVI9mArRwWDIb0aReSndn74 l8gA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@leemhuis.info header.s=he214686 header.b=2UpQJN3A; arc=pass (i=1 spf=pass spfdomain=leemhuis.info dkim=pass dkdomain=leemhuis.info); spf=pass (google.com: domain of linux-kernel+bounces-157361-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157361-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d23-20020aa78e57000000b006edd43fb59fsi11389384pfr.400.2024.04.24.10.34.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 10:34:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157361-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@leemhuis.info header.s=he214686 header.b=2UpQJN3A; arc=pass (i=1 spf=pass spfdomain=leemhuis.info dkim=pass dkdomain=leemhuis.info); spf=pass (google.com: domain of linux-kernel+bounces-157361-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157361-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 51EB3B23A0F for ; Wed, 24 Apr 2024 16:56:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D360D16C87F; Wed, 24 Apr 2024 16:56:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=leemhuis.info header.i=@leemhuis.info header.b="2UpQJN3A" Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AED5616C87B; Wed, 24 Apr 2024 16:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.237.130.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713977784; cv=none; b=tfwIVM4rSq/JkZ4Wzsrje2uk3cJJmG7mUnEtYN+Xqf0SgONpk8qadPQ3FOwMdVfvF3/W9QLdBSc3XM6Iyc/ZKBTMoRPhibq3slSWaPVUIeCxGkTpcl4A6PaswJmQkrBzVSrfdVtN1wiek0w4D6kXbKhADmWXShceuvOUAKNGbKw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713977784; c=relaxed/simple; bh=jFSAdj8Fg1g/sV31cy/CgP0Fejcy6/GdPi/dUTUgELU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=coZuX/3ThjKEYhmHCQuT+UEVz0Oc4lZ2nMmohAyG7w1XxNLzTgS2Vt8z1tfNOhazcE2Z746zjYMywcsP4R5v4ThgTc1RFeuyoRgexL6TQ+Dr/3IxYCyG7NW3zwNaCq3ePHclmyJMMhCS5I8vKXz0wG50ftTwdSvPXzBN4jAb+Pw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=leemhuis.info; spf=pass smtp.mailfrom=leemhuis.info; dkim=pass (2048-bit key) header.d=leemhuis.info header.i=@leemhuis.info header.b=2UpQJN3A; arc=none smtp.client-ip=80.237.130.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=leemhuis.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=leemhuis.info DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=leemhuis.info; s=he214686; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:In-Reply-To: References; bh=Gr5w+NNXaBuu9MFvS/3sV7owIcp9t8FJfSpSoyXuyTk=; t=1713977782; x=1714409782; b=2UpQJN3AUCGtXaPA6BYlPw/2ltZGacGaU5IfAUgvQoN83avPhpYvLvb0X3p9A 8WqmDNCyDBHF3IGYGF/UoiB6y5V4i+FnbI1gOaN+fdjmSkjaWrIEQnNu1j5sVpGfoTh87fRPvrZG1 0pVoaqEE6r9gSpW7wu6LXHF0IAOXxQSv2yoPPlGcn8xNJRqSZghxHnJY+sYBqtBnqZpOfNyTJaGck +CeNB8N9Ws42AIpahmx0OjuS+/FuYo32G58ikk3wXH0Fxt7FBU5nrtx2q23oUfw9Ki5NGRxsEudXI mZs21UUrlNemneRqzYW+KYaLfNUFqo9jCOIxAwmQ6gxNK9ix2Q==; Received: from [2a02:8108:8980:2478:8cde:aa2c:f324:937e]; authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1rzfus-0000lM-MC; Wed, 24 Apr 2024 18:56:18 +0200 Message-ID: Date: Wed, 24 Apr 2024 18:56:18 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: regression fixes sitting in subsystem git trees for a week or longer (was: Re: [PATCH v2] HID: i2c-hid: Revert to await reset ACK before reading report descriptor) To: Linus Torvalds Cc: Jiri Kosina , Douglas Anderson , Hans de Goede , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Kenny Levinsen , Benjamin Tissoires , Linux regressions mailing list References: <20240331182440.14477-1-kl@kl.wtf> <14d1b38e-0f11-4852-9c52-92b4bedb0a77@leemhuis.info> From: Thorsten Leemhuis Content-Language: en-US, de-DE In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-bounce-key: webpack.hosteurope.de;regressions@leemhuis.info;1713977782;880531d9; X-HE-SMSGID: 1rzfus-0000lM-MC Linus, On 23.04.24 16:59, Benjamin Tissoires wrote: > On Mon, Apr 22, 2024 at 7:11 PM Linux regression tracking (Thorsten > Leemhuis) wrote: >> On 31.03.24 20:24, Kenny Levinsen wrote: > > [previous subject: [PATCH v2] HID: i2c-hid: Revert to await reset ACK before reading report descriptor] > >>> In af93a167eda9, i2c_hid_parse was changed to continue with reading the >>> report descriptor before waiting for reset to be acknowledged. >>> >>> This has lead to two regressions: >> >> Lo! Jiri, Benjamin, quick question: is there a reason why this fix for a >> 6.8-rc1 regression after more than two and half weeks is not yet >> mainlined? Or is there some good reason why we should be should be extra >> cautious? > > No special reasons I guess. Neither Jiri nor I have sent a HID update > for this rc cycle, so it's still there, waiting to be pushed. > I've been quite busy with BPF lately and dropped the ball slightly on > the HID maintainer side, but I'm sure we'll send the PR to Linus this > week or the next. out of interest: what's your stance on regression fixes sitting in subsystem git trees for a week or longer before being mainlined? The quoted patch is such a case. It fixes a regression caused by a change that made it into 6.8-rc1, but the problem afaik was only reported on 2024-03-19, e.g. ~nine days after 6.8 was out[1]; Kenny, the author of the fix, apparently noticed and fixed the problem a bit later independently[2]. Jiri merged a newer version of the fix on 2024-04-03[3], which was included in -next a day later -- the Thursday before 6.9-rc3. The fix thus would even have gotten two days of testing in -next, if Benjamin or Jiri would have send it your way for that pre-release. But from Benjamin's statement quoted above it seems the fix might even make -rc6. That obviously heavily reduces the time the fix will be tested before 6.9 is released. It obviously also means that 6.8.y is as of now still unfixed, as the stable team usually only applies fixes once they landed in mainline. Which also means that even more people ran into the problem with 6.8.y[4] or mainline even after Jiri merged the patch into the hid tree -- and maybe some of those people wasted their time on a bisection only to find out that a fix exists. That sounds, ehh, sub-optimal to me. Which is why I wonder what's your stance here, as I encounter similar situations frequently[5] -- which sometimes is kinda demotivating. :-/ Ciao, Thorsten [1] https://lore.kernel.org/all/a587f3f3-e0d5-4779-80a4-a9f7110b0bd2@manjaro.org/ [2] https://lore.kernel.org/all/20240331132332.6694-1-kl@kl.wtf/ [3] https://lore.kernel.org/all/nycvar.YFH.7.76.2404031401411.20263@cbobk.fhfr.pm/ [4] https://social.lol/@major/112294923280815017 [5] This fix for example: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=master&id=afc89870ea677bd5a44516eb981f7a259b74280c Reports: https://lore.kernel.org/lkml/ZYhQ2-OnjDgoqjvt@wens.tw/ https://lore.kernel.org/lkml/1553a526-6f28-4a68-88a8-f35bd22d9894@linumiz.com/ > [...] >>> 1. We fail to handle reset acknowledgement if it happens while reading >>> the report descriptor. The transfer sets I2C_HID_READ_PENDING, which >>> causes the IRQ handler to return without doing anything. >>> >>> This affects both a Wacom touchscreen and a Sensel touchpad. >>> >>> 2. On a Sensel touchpad, reading the report descriptor this quickly >>> after reset results in all zeroes or partial zeroes. >>> >>> The issues were observed on the Lenovo Thinkpad Z16 Gen 2. >>> >>> The change in question was made based on a Microsoft article[0] stating >>> that Windows 8 *may* read the report descriptor in parallel with >>> awaiting reset acknowledgement, intended as a slight reset performance >>> optimization. Perhaps they only do this if reset is not completing >>> quickly enough for their tastes? >>> >>> As the code is not currently ready to read registers in parallel with a >>> pending reset acknowledgement, and as reading quickly breaks the report >>> descriptor on the Sensel touchpad, revert to waiting for reset >>> acknowledgement before proceeding to read the report descriptor. >>> >>> [0]: https://learn.microsoft.com/en-us/windows-hardware/drivers/hid/plug-and-play-support-and-power-management >>> >>> Fixes: af93a167eda9 ("HID: i2c-hid: Move i2c_hid_finish_hwreset() to after reading the report-descriptor") >>> Signed-off-by: Kenny Levinsen >>> --- >>> drivers/hid/i2c-hid/i2c-hid-core.c | 13 ++++--------- >>> 1 file changed, 4 insertions(+), 9 deletions(-) >>> >>> diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c >>> index 2df1ab3c31cc..72d2bccf5621 100644 >>> --- a/drivers/hid/i2c-hid/i2c-hid-core.c >>> +++ b/drivers/hid/i2c-hid/i2c-hid-core.c >>> @@ -735,9 +735,12 @@ static int i2c_hid_parse(struct hid_device *hid) >>> mutex_lock(&ihid->reset_lock); >>> do { >>> ret = i2c_hid_start_hwreset(ihid); >>> - if (ret) >>> + if (ret == 0) >>> + ret = i2c_hid_finish_hwreset(ihid); >>> + else >>> msleep(1000); >>> } while (tries-- > 0 && ret); >>> + mutex_unlock(&ihid->reset_lock); >>> >>> if (ret) >>> goto abort_reset; >>> @@ -767,16 +770,8 @@ static int i2c_hid_parse(struct hid_device *hid) >>> } >>> } >>> >>> - /* >>> - * Windows directly reads the report-descriptor after sending reset >>> - * and then waits for resets completion afterwards. Some touchpads >>> - * actually wait for the report-descriptor to be read before signalling >>> - * reset completion. >>> - */ >>> - ret = i2c_hid_finish_hwreset(ihid); >>> abort_reset: >>> clear_bit(I2C_HID_RESET_PENDING, &ihid->flags); >>> - mutex_unlock(&ihid->reset_lock); >>> if (ret) >>> goto out; >>> >> > > >