Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2025639rwe; Fri, 2 Sep 2022 07:31:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ISJ1pKASSl9jp4a6HNbUBvNmJtPlkX5oKWPl6wGW3z54wzXEgLLdPwNZjZLQG96X3r80A X-Received: by 2002:a63:1444:0:b0:430:980f:e511 with SMTP id 4-20020a631444000000b00430980fe511mr5309607pgu.482.1662129073191; Fri, 02 Sep 2022 07:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662129073; cv=none; d=google.com; s=arc-20160816; b=e+u473dguqNAHYouUx1W71SjDnhVpaG8Vduyr/E4lmxtumFFcGeSTk9w/yr7f9Wiob 2BJFezwSo22cR9ne1sE2a4yQcuwEaPKWhTmFSzWyhM7gEa0oDdYVRzBmglM4SPysiIQ5 X62L8dEsHPDL0Qd4LPv6q2E5Dtowh9jwgb5XQqTPwxmrNOExNqUbr8PTEjYYuC2BQA0Q XeH6X9TbrRes2NhBJ1s0z/EAVm3lB5KRYLONtbGT4DszxMCwtNG+NnFmyzjDBMwvKq7O kgij2DP3D3SLr/1QdaonaOjnS6RFLYFX+7NsqHk6v/X3rbjXMO35dH2DeuMccJpZNyDr 5FWg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qVjMVMPNy6rW6Zmt6oizi5msW06LPGxgkNIKTCeYmRM=; b=pJhIumW2aMw9OkaiKcryZf8LJotr1UY6/ujeSX5CRkUUu8C01yUGVZhM/z+Gwn+7Z0 PDldmro6W6XL2dCmKnAPLySsr085btDkWcq+QxYe+s0ePACHhxwQUZcIkPSZrUK4GtzM lBL/pl4lozWPR5uqa1KIHkOCaGouoXtH6AOIx+dqPePxs67OaMUBCNdKIFdZ3F69DeHl RAO1uFLANun1403UP/FxNkJ5Ivz7P3k0Qd9x8gPjkAoGzw0I2TrBG+k42aODv5ZK/seW Oip9c0pLlAV6NJcLulBqzz54mxCJPPhk7Wb8hIGaeHBRYvx6IK3+nrMuB6M+USkj53Yc Vl2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yNYgyu9v; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b18-20020a170902d89200b0016ef6b7e298si2177581plz.157.2022.09.02.07.30.57; Fri, 02 Sep 2022 07:31:13 -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=@linuxfoundation.org header.s=korg header.b=yNYgyu9v; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236400AbiIBNTW (ORCPT + 99 others); Fri, 2 Sep 2022 09:19:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236092AbiIBNS5 (ORCPT ); Fri, 2 Sep 2022 09:18:57 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4D92D4F64; Fri, 2 Sep 2022 05:55:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 77A76CE2E67; Fri, 2 Sep 2022 12:35:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71C65C433D7; Fri, 2 Sep 2022 12:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662122125; bh=I0grwLaSN42BWeq13VtFyJ/P4Grxplt0kp3cRmVG1sA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yNYgyu9v+rtmEMvmehKoa2RMBETerMYR6bpN+kSYEYUZ/Z1ArmDgHdm+1Blt/bDrC v7+dB6gWVpnXxlsHYUamlxswHPBg15PwxvFnpUiS1HXckkqDPEKlCaAjSeXqPNK8R/ /OoAbzaPqZ98n3XXp/QpZmlCAa358itIr38FyQzA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Hansson , Benjamin Tissoires , Jiri Kosina Subject: [PATCH 5.19 20/72] HID: input: fix uclogic tablets Date: Fri, 2 Sep 2022 14:18:56 +0200 Message-Id: <20220902121405.445523018@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220902121404.772492078@linuxfoundation.org> References: <20220902121404.772492078@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Benjamin Tissoires commit 8db8be9cfc89935c97d791c7e6264e710a7e8a56 upstream. commit 87562fcd1342 ("HID: input: remove the need for HID_QUIRK_INVERT") made the assumption that it was the only one handling tablets and thus kept an internal state regarding the tool. Turns out that the uclogic driver has a timer to release the in range bit, effectively making hid-input ignoring all in range information after the very first one. Fix that by having a more rationale approach which consists in forwarding every event and let the input stack filter out the duplicates. Reported-by: Stefan Hansson Fixes: 87562fcd1342 ("HID: input: remove the need for HID_QUIRK_INVERT") Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/hid-input.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -1532,7 +1532,10 @@ void hidinput_hid_event(struct hid_devic * assume ours */ if (!report->tool) - hid_report_set_tool(report, input, usage->code); + report->tool = usage->code; + + /* drivers may have changed the value behind our back, resend it */ + hid_report_set_tool(report, input, report->tool); } else { hid_report_release_tool(report, input, usage->code); }