From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 65E0A3A1AD; Mon, 18 Dec 2023 14:12:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Lt1jE3DP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7BCAC433C7; Mon, 18 Dec 2023 14:12:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1702908725; bh=OGd9rUd3sbjGZqlNJo29SJSw9Zbu4eW6gB1WrQf6b0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lt1jE3DPTNGvvaN4hwGwKkLK2DfgB3LH9x0q4OcNVWbc3Il5ozG36Fz9P/1x3tRyw kQrihnJQKjVYVEhTHO334pDrHlUUzbNzENVBH9xiaOT9ivlCYlvtaVJ7A3cYof6QH7 a/Zk+Xid6A+EK+vt1P2dUEcjfZVUYUV/apHYP15w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikhail Khvainitski , Yauhen Kharuzhy , Jiri Kosina , Sasha Levin Subject: [PATCH 5.15 11/83] HID: lenovo: Restrict detection of patched firmware only to USB cptkbd Date: Mon, 18 Dec 2023 14:51:32 +0100 Message-ID: <20231218135050.267787216@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218135049.738602288@linuxfoundation.org> References: <20231218135049.738602288@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikhail Khvainitski [ Upstream commit 43527a0094c10dfbf0d5a2e7979395a38de3ff65 ] Commit 46a0a2c96f0f ("HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround") introduced a regression for ThinkPad TrackPoint Keyboard II which has similar quirks to cptkbd (so it uses the same workarounds) but slightly different so that there are false-positives during detecting well-behaving firmware. This commit restricts detecting well-behaving firmware to the only model which known to have one and have stable enough quirks to not cause false-positives. Fixes: 46a0a2c96f0f ("HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround") Link: https://lore.kernel.org/linux-input/ZXRiiPsBKNasioqH@jekhomev/ Link: https://bbs.archlinux.org/viewtopic.php?pid=2135468#p2135468 Signed-off-by: Mikhail Khvainitski Tested-by: Yauhen Kharuzhy Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-lenovo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c index 901c1959efed4..965bddaa90aee 100644 --- a/drivers/hid/hid-lenovo.c +++ b/drivers/hid/hid-lenovo.c @@ -540,7 +540,8 @@ static int lenovo_event_cptkbd(struct hid_device *hdev, * so set middlebutton_state to 3 * to never apply workaround anymore */ - if (cptkbd_data->middlebutton_state == 1 && + if (hdev->product == USB_DEVICE_ID_LENOVO_CUSBKBD && + cptkbd_data->middlebutton_state == 1 && usage->type == EV_REL && (usage->code == REL_X || usage->code == REL_Y)) { cptkbd_data->middlebutton_state = 3; -- 2.43.0