Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3006446ybi; Mon, 17 Jun 2019 14:32:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeI0aaFnrIsxeTHaLUu1iXWxOPOuxroUABecT/1w26ApbVs/WWCxXkczHe6u64rQ0TXHC/ X-Received: by 2002:a17:902:8d95:: with SMTP id v21mr88489401plo.225.1560807124061; Mon, 17 Jun 2019 14:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560807124; cv=none; d=google.com; s=arc-20160816; b=gjNR+BTHbb+/enulw0Znovq0bsOU58rvKXxiKfrdCymUMBDciSrm5n7kcJyWa4Fxm6 oSZ5k0Km0fkhuBT6A2gFejWf0DemI00FZFGUKL2eReuzjpWGNGAkcQGAAEo0IsQ3OlS4 nPZYS8FDqQKnnLc9bx9OAjHCKJJR4eQgc4v2AqyBW9209RAh6bQ5dde8RB3NQEtD9s/6 rpSCDfslvxrPHjl3ywUmO05IE3FDspJ55bk1qM0OaIYi0gQD2UPUDMThFzou3F9dy2AS BEAA/dUsKF/b/L8eQrmuXaBH6BFmtXuMP/OcDq5k0eRSi4ws7PrFjWs+jJrl2yLHim3z fc7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tiIxdR63KB2J98R5hsUYcfX5Etp1Iz+XjvvdBgUzyVo=; b=lJm2QEpN8A9xmZJ8fhFtKGOGGy/JTf21af9Iolvu3Ee7AV3clX1T7HTMUvNO3HIV6a Ud+SALK1QruOBMLuTSOnvqZap3tPSYGGj3BtLU/ISQxsONP5i/WcnZMAgVkuyLaQ2HNB PNM/dUsysz9hfYBnYAnypTYibvHfsSyiekokmPSTNYB2u2hyXL7gIfMHay5k288t6mky jby+J8eev1G0zvFsCViCebrUUmfhwxWnIYrq5PTHSIHkXwlXCsyRTHpEd5wEsQUfYWSP 68qKL2EMziFqhyfbZrhCmfy3lQkgCTuhkHIf+NHribleLlw75evRC8Th0DkkP6+Bu9AF 5B5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q3t6bHRi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i4si11662858pgk.8.2019.06.17.14.31.49; Mon, 17 Jun 2019 14:32:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q3t6bHRi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730560AbfFQV2d (ORCPT + 99 others); Mon, 17 Jun 2019 17:28:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:55556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729095AbfFQV23 (ORCPT ); Mon, 17 Jun 2019 17:28:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 27BC3204FD; Mon, 17 Jun 2019 21:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560806908; bh=W0nEJ2HcSn5ppc2AopiwdJYBkCjGNiQP/SC3t8g1ZkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q3t6bHRiT+HKyCOg3aKbeIUpIW+rwxv2LGidZhyXbExZSiufZvnoqpq5AENLQV6gz UVWfO9ucJJTP/VkEtxJAaCcMRSloWEAqQ6kdrwGY6+QYeZ2DLEg+GjzKyV+T8zzXA3 CFnhCVAtU043+tMClMGiMdo1QY7sSnkq5XedEwhM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Gerecke , Benjamin Tissoires Subject: [PATCH 4.14 04/53] HID: wacom: Sync INTUOSP2_BT touch state after each frame if necessary Date: Mon, 17 Jun 2019 23:09:47 +0200 Message-Id: <20190617210746.039489860@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190617210745.104187490@linuxfoundation.org> References: <20190617210745.104187490@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jason Gerecke commit 69dbdfffef20c715df9f381b2cee4e9e0a4efd93 upstream. The Bluetooth interface of the 2nd-gen Intuos Pro batches together four independent "frames" of finger data into a single report. Each frame is essentially equivalent to a single USB report, with the up-to-10 fingers worth of information being spread across two frames. At the moment the driver only calls `input_sync` after processing all four frames have been processed, which can result in the driver sending multiple updates for a single slot within the same SYN_REPORT. This can confuse userspace, so modify the driver to sync more often if necessary (i.e., after reporting the state of all fingers). Fixes: 4922cd26f03c ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface") Cc: # 4.11+ Signed-off-by: Jason Gerecke Signed-off-by: Benjamin Tissoires Signed-off-by: Greg Kroah-Hartman --- drivers/hid/wacom_wac.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1328,11 +1328,17 @@ static void wacom_intuos_pro2_bt_touch(s if (wacom->num_contacts_left <= 0) { wacom->num_contacts_left = 0; wacom->shared->touch_down = wacom_wac_finger_count_touches(wacom); + input_sync(touch_input); } } - input_report_switch(touch_input, SW_MUTE_DEVICE, !(data[281] >> 7)); - input_sync(touch_input); + if (wacom->num_contacts_left == 0) { + // Be careful that we don't accidentally call input_sync with + // only a partial set of fingers of processed + input_report_switch(touch_input, SW_MUTE_DEVICE, !(data[281] >> 7)); + input_sync(touch_input); + } + } static void wacom_intuos_pro2_bt_pad(struct wacom_wac *wacom)