Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3002407ybi; Mon, 17 Jun 2019 14:26:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzo8Q2rSg3t5MhGCVoBvUjeT0/MTTiNSAYYb7Ax+xfum2ZBTn0SxBjGHwlcpxgZMMjVJ6pj X-Received: by 2002:a17:902:341:: with SMTP id 59mr56467918pld.20.1560806796726; Mon, 17 Jun 2019 14:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560806796; cv=none; d=google.com; s=arc-20160816; b=FAs+MAIUEd4wyVHcrAaq5Jk9ZwGhBkgIc3CyO7RK0Qv7rWKsGTFGCrziq2nNf8413p fUS1LUKfcJhB4aA9ajD+Cgq4cNNPeuuCmWuDmPV14FLmmCLum3UfRqJZ1z7wEViBqts9 awx0HV6YBPex92+DE55RUo+6rtDROT+H8u5M6zK3FdUPnh31c2pa6QPexBPi1UibyMWj s6KAfjdMCxJ+jdxozq/4E/No4MxABfCSqHsFHB2wE2iX7jtRVvBIgEEXJV8IQiPxC+rZ h0VQo4ejjeCJwLfFinGGsT7BZu/qkHoA2t4xXGVDNsZqE/bEGQUVt+/FM9rPxOWcghfb sEYA== 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=ALaY4DnenL+bK8myjvBuLwoNazJ6TJrL83HydO8IUE0=; b=K6CCfpA6Mz+ukgXkDENDEqgFobQZn1LN+rz543ZEn2YssGKpQ+sooDH+bw4lmq0JPq Edj5hbTQSuEtCGs3Tu/TXtZLnsB8ig+65mORa3AejrwQkWQJrx7MhQZs2tCCwXugL/qr /p8W5WtpMYDTsPFrgM8jha89k4HHbQzTJnb7OJ2h6Z7jJEb+MkzySC9CZD1cTT0Al59O LYAmHJztFy0ZwwCzsVsC2uRVkOMcmELSOcRXbezQ5cdjo/nFUOuylI1h1lX37fRu2RE5 fDfnN3frnMU2PeEDC0tO5EreY7f/Ct+HJoR7Ru+GMC7wkcUCqAO5PKGvNXOUtpCpeVPW 6zGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ABL155fN; 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 l67si11741841plb.370.2019.06.17.14.26.21; Mon, 17 Jun 2019 14:26:36 -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=ABL155fN; 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 S1730038AbfFQVZL (ORCPT + 99 others); Mon, 17 Jun 2019 17:25:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:51088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730028AbfFQVZI (ORCPT ); Mon, 17 Jun 2019 17:25:08 -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 9F9362070B; Mon, 17 Jun 2019 21:25:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560806707; bh=/b6D2v5AkpL+O5/7LJH+ix77sBO15xAX169kA2TaGH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ABL155fNibbSqx71RAbdlJ2PeIemAN8lD5nNNn/4xYOAUV455g8ju+EdDu+TdfVvy aZqRt6WClSVjqfA16NXoYuK6GApTfhsyuJt45U99HeB/BcxVCrJD28ydGOoshxGsIs kRTtsGfZydYBmaYzy2nTL94dt2nRNyU2LGeSdsMU= 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.19 08/75] HID: wacom: Sync INTUOSP2_BT touch state after each frame if necessary Date: Mon, 17 Jun 2019 23:09:19 +0200 Message-Id: <20190617210753.170219676@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190617210752.799453599@linuxfoundation.org> References: <20190617210752.799453599@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 @@ -1369,11 +1369,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)