Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3559531pxb; Mon, 30 Aug 2021 05:26:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcrC8uYUgFwaekAiWL/MRvoNqYmz73Cm3y1YXEZAnXf5CXCMt1f7t7Rq6ziu7kwaa21VyL X-Received: by 2002:a17:906:24c1:: with SMTP id f1mr24576560ejb.314.1630326383514; Mon, 30 Aug 2021 05:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630326383; cv=none; d=google.com; s=arc-20160816; b=BYq53EUsSJh+0UXi0Gy1wDFqd4A7GwH+p9QLVKD6lT6uMxchfmn7mOhcC8lRPVMzur osUmfKJg9a3mvY1XkMIlbJvCHjQMeMmgJRKhHGbKBmGqFn5lKSkgL1xnPXU7DNfzSc1/ E7CsftLVe+yK5SUdDG/jNuqc2pKyRQnRLlxT66sBAhVECoHbmPgFL47v8WcDOrjuOVmr SF0ROFbPfLEb82lU3gywdcZMDJdxjADF76btlk8zGeGzTMfkKxZjlOSoKeZvqbvHkpIj Hns1zkhgitOYS/v/mUH3C6IroUSr6BMJ5GKF/ugNFY8Y/bjlRCyhyNHhB7Rkf5hI0B+e satg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from; bh=fC5zH5UevIiJckqnBm4ITFcwIUOiYISAvu3rzhHlnR4=; b=PYVP3rwKiqz5hCEIGD3TFlApxox5JR8/pBkhmoOYaFMb68XarBzezceMa60Cbe0ywx zOERaUX9kwDpC2kvls+G8Wu0ljGQfcLeYl+GzdZmpaou/UKTqtn5TucS79pQLOzymYDE OmY9CsjtUTg4I2a4K1y+XDjbWg6lKoKZb+LQnOyT69q/DGMCW+0mcQ8DQ6yHu5h5JBM7 Pa/5D8v3+xkWZfJ1FVrewRN+83uCmNqLTVuJqCvSC8uMo4nKbIQR7rKH/K6YVo3f+VDB 9xp/kR/S6P/7CHWcg9kgkvtQm4WxYZKAhIMpxMRBy8A1nANe1Pu4+Eu/VkaasoIDOeFw RELA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg17si6516767ejc.92.2021.08.30.05.25.49; Mon, 30 Aug 2021 05:26:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236839AbhH3MWN (ORCPT + 99 others); Mon, 30 Aug 2021 08:22:13 -0400 Received: from emcscan.emc.com.tw ([192.72.220.5]:61099 "EHLO emcscan.emc.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237463AbhH3MUr (ORCPT ); Mon, 30 Aug 2021 08:20:47 -0400 X-IronPort-AV: E=Sophos;i="5.56,253,1539619200"; d="scan'208";a="42474874" Received: from unknown (HELO webmail.emc.com.tw) ([192.168.10.1]) by emcscan.emc.com.tw with ESMTP; 30 Aug 2021 20:19:51 +0800 Received: from 192.168.10.23 by webmail.emc.com.tw with MailAudit ESMTP Server V5.0(46200:0:AUTH_RELAY) (envelope-from ); Mon, 30 Aug 2021 20:19:50 +0800 (CST) Received: from 192.168.33.13 by webmail.emc.com.tw with Mail2000 ESMTPA Server V7.00(2480:0:AUTH_LOGIN) (envelope-from ); Mon, 30 Aug 2021 20:19:48 +0800 (CST) From: "phoenix" To: , , Cc: , , References: <20210729010940.5752-1-phoenix@emc.com.tw> In-Reply-To: <20210729010940.5752-1-phoenix@emc.com.tw> Subject: RE: [PATCH] Input: elantench - Fix the firmware misreport coordinates for trackpoint occasionally. Date: Mon, 30 Aug 2021 20:19:48 +0800 Message-ID: <000001d79d99$53762dd0$fa628970$@emc.com.tw> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQGk7tjGsgsB1mM/H5Ov4MUFApOKzavnmDiw Content-Language: zh-tw x-dg-ref: PG1ldGE+PGF0IG5tPSJib2R5LnR4dCIgcD0iYzpcdXNlcnNcODgwNTFcYXBwZGF0YVxyb2FtaW5nXDA5ZDg0OWI2LTMyZDMtNGE0MC04NWVlLTZiODRiYTI5ZTM1Ylxtc2dzXG1zZy05MGI4OGY1YS0wOThjLTExZWMtYTkxYy04OGQ3ZjY1ODJkZmNcYW1lLXRlc3RcOTBiODhmNWItMDk4Yy0xMWVjLWE5MWMtODhkN2Y2NTgyZGZjYm9keS50eHQiIHN6PSIxNjA5IiB0PSIxMzI3NDc5OTU4ODA2NjU1ODYiIGg9IjRveHkwbHJscktkNU5id3VEVE4xSnBJVldnZz0iIGlkPSIiIGJsPSIwIiBibz0iMSIvPjwvbWV0YT4= x-dg-rorf: true Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dmitry, Would you review this patch, thanks Best regards, Phoenix Huang -----Original Message----- From: Phoenix Huang [mailto:phoenix@emc.com.tw] Sent: Thursday, July 29, 2021 9:10 AM To: linux-kernel@vger.kernel.org; linux-input@vger.kernel.org; dmitry.torokhov@gmail.com Cc: jingle.wu@emc.com.tw; josh.chen@emc.com.tw; dave.wang@emc.com.tw; Phoenix Huang Subject: [PATCH] Input: elantench - Fix the firmware misreport coordinates for trackpoint occasionally. Signed-off-by: Phoenix Huang --- drivers/input/mouse/elantech.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 2d0bc029619f..07e1098f2d31 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -517,6 +517,17 @@ static void elantech_report_trackpoint(struct psmouse *psmouse, case 0x16008020U: case 0x26800010U: case 0x36808000U: + + /* This firmware misreport coordinates for trackpoint occasionally. + * So we discard these packets by pattern to prevent cursor jumps. + */ + if (packet[4] == 0x80 || packet[5] == 0x80 || + packet[1] >> 7 == packet[4] >> 7 || + packet[2] >> 7 == packet[5] >> 7) { + elantech_debug("discarding packet [%6ph]\n", packet); + break; + + } x = packet[4] - (int)((packet[1]^0x80) << 1); y = (int)((packet[2]^0x80) << 1) - packet[5]; -- 2.25.1