Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2008876rwa; Sun, 21 Aug 2022 23:45:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR74vP3DJTfgd0fRl0i/VaJ4Rd+FzHYYmw1op5hFtnfoBDd9UX+G5DicTZJ/4jZjNnrT/YgR X-Received: by 2002:a17:906:cc0b:b0:73b:eaed:2c8e with SMTP id ml11-20020a170906cc0b00b0073beaed2c8emr11040178ejb.392.1661150732506; Sun, 21 Aug 2022 23:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661150732; cv=none; d=google.com; s=arc-20160816; b=icijYDcAih1KpXp1WQ+ARImVpbe01vJvaMathe9lkTMlTHOpy3al4qAZIjpxJo5jXy 5DAj0yN/zpUMWzkBlxE1tzSunsi7/AxGjC8N67DfVDGc4ncadXBUlraPZygIMwTUHCOj abSK/OWLxzWtduwhpqk9/S2T6SDlzwHNLxQGPaoYJ6i2ul6v1bMg+X8fh3KfE6Y0sgZ3 XuNWiblJfOGDVqubcNoBBdkg/epVGPJHYDkeUG3QbTsSaRIn8xy5nH94fZLsDXEeahTo Hfpc5VuLP3YctyH43VtkxZIENEvbOXRqZouAkc72xR2iQbkxdfPFtRBkaKgcv8nh5qfd WXFw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=nn4jF27DFlQd4RWn0PQw34qeK9JpgLOLE2krBPtSffM=; b=DtopkhYEqwDOF/irR1vX5xoE9jxAakVW9v58Kuxm4TCz7b+T+VG4nNtxVDI5IXSd8a aixTJZyG7ycSbCYOyHjzowlbQCwWgOKpbDv2VWIuWzCC1Obyv8mPBjOM4x2j91G4GSvv x1jU2SnX8miBiZo84xwIEmyG+R3aCYtf7//xhGuu+JzdnVQmhy1FafSuOTSPKNmwLOdK 1rjErzOU+3WRv9oA0YUK5+/VnvFQsQ3oKgxDTCX2wzLh5SZU3hc8L9D5xjCpTYI1y+OA 5rf6zOMpU8Edl/vdhRNe49cTCk3yStP75afg8UglHyWGMC5jehA2fU+8YH4cERKuLsjH VkCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fslQWwpR; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q33-20020a05640224a100b00445f4337b07si8779354eda.362.2022.08.21.23.45.01; Sun, 21 Aug 2022 23:45:32 -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=@redhat.com header.s=mimecast20190719 header.b=fslQWwpR; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232953AbiHVGW6 (ORCPT + 99 others); Mon, 22 Aug 2022 02:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232947AbiHVGW4 (ORCPT ); Mon, 22 Aug 2022 02:22:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15282275C2 for ; Sun, 21 Aug 2022 23:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661149375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=nn4jF27DFlQd4RWn0PQw34qeK9JpgLOLE2krBPtSffM=; b=fslQWwpRylkvCj+/Vvrw/mPfA4jq4fCn8ZSMv6ynoEZ17HvOGy6Di/Wo9iNasemIfhihrF wXec1+El+x5gurmb1e3uYUb3ZLmOO5C8Pfal1xKgFJFz9c4BE0SrTUsaFBc8HzL9hXrO0i amUNCwkM+KDQXVxStx9sezXh7uLekiA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-208-oWilpA_WMdKNbxA-Luhz_w-1; Mon, 22 Aug 2022 02:22:50 -0400 X-MC-Unique: oWilpA_WMdKNbxA-Luhz_w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 566F43C0CD4A; Mon, 22 Aug 2022 06:22:50 +0000 (UTC) Received: from plouf.redhat.com (unknown [10.39.192.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E8911121314; Mon, 22 Aug 2022 06:22:49 +0000 (UTC) From: Benjamin Tissoires To: Jiri Kosina , Stefan Hansson , =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH] HID: input: fix uclogic tablets Date: Mon, 22 Aug 2022 08:22:47 +0200 Message-Id: <20220822062247.1146141-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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 --- drivers/hid/hid-input.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 48c1c02c69f4..871a185a0f1f 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -1532,7 +1532,10 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct * 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); } -- 2.37.1