Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3899301pxb; Mon, 30 Aug 2021 13:25:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMs3HHNxdEvqxMp5/FFnAcfXEeFOpSvtll29gdaYfp6f8Jy7jfGsQqi/329BsToVOWRWCG X-Received: by 2002:aa7:cfcb:: with SMTP id r11mr25938419edy.14.1630355158861; Mon, 30 Aug 2021 13:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630355158; cv=none; d=google.com; s=arc-20160816; b=WJSdZCYo0L6kMGwjkvibOYGvqm+Fcw3gg1MYFWJI4iwzlIaA5o9OuP+VcEj4+Ud2KD ZGXm4U7XDORVG8T16iaGbxOan8AWZqWBKeYpL4cN1Ct4Aj98XYTwQ6Yjanl8CdnptPGi tc35RrpbQSYhli0ySfd4HHdoIynxE1HaUPua6dFftnnjCFBEg5yqbOof8vDk1qzKVxwJ aTPg0396Aziqql+lwwZRu6nfp3CjpdKTrA4o+gxNSRLTtqMm8vm7MCSmejNsnYdJ4VQQ AvbsVEYf6Um1WPdIUt7nSAu9kaQiv3+HY08zrfPyoxUfk3LSSFtAlKartvFoNVySKFaJ R/FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=h+3mX84nFnAyClKOUYMDJFGqUg+wKBWo2M4YAm5KDeE=; b=CdC8WkHfqZIi4ipay6Lvwd3JwTBeKDsmZb+GCs1B67/EJfF2ThAX8f3OrMIdRNJZmH 0NReJxBYo+vBKkktln/zHxLNa69/2czbr/geoubmOhhzM+NbOnS+JSyAyAPIM6QaaV0i Pc5cIWolbCUae/FZamh5P8cQZT8+lJd59Ugqd61KJtOXHYOog9oNbHPSvzrw/1M6KPEM 740QCMeeNxcJA5i89W0fqKckk0B6hHWQNiqA+VnrFwKBKhsF3ErMHYgrdRvMMXnuAOd9 kd/j6YvnMtbbmnmTrQc3HYqxa7qJI5hv0SGWerg1lLPDuBKGvh5BzqXjxILp19gPtqQl 6N4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HkQRX6YA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si2788680eds.442.2021.08.30.13.25.26; Mon, 30 Aug 2021 13:25:58 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HkQRX6YA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235466AbhH3UYm (ORCPT + 99 others); Mon, 30 Aug 2021 16:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235306AbhH3UYj (ORCPT ); Mon, 30 Aug 2021 16:24:39 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5ECCC061575; Mon, 30 Aug 2021 13:23:45 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id ot2-20020a17090b3b4200b0019127f8ed87so612003pjb.1; Mon, 30 Aug 2021 13:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=h+3mX84nFnAyClKOUYMDJFGqUg+wKBWo2M4YAm5KDeE=; b=HkQRX6YAZLsaUi38EWhsB24kcuq1aHXtuE0Rxwe/j5/TaRphVrzGkHhlla2pEeZTBb aoQ6ZYfK3S9WgLByBLi5X7MpO2x27iqqG505NFkjWuQOhUbr2HNnzD2jqZImIs77vxIZ cZXCp7Wj8cGp4rGk27QasIpYOPu4hnBNFLnlLkHyjIOpXjwwNljVDX+gC7s59/Ez0gym +srHPt3zgCefNNVdveChYizrbJwAQq20c7a41ace8U1QvV0OlXEF+fQMyUj1XgY4FW5k WwTefeHfz9rhg2fMCfgGcttIC4Www3v/lZ9KXbWsPR/XFIH/KWLbI08PAmLmDMkbZliy QUPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=h+3mX84nFnAyClKOUYMDJFGqUg+wKBWo2M4YAm5KDeE=; b=WzaUTk6r+Ig+Ua40/olDyTYl+hYMsn4rsKa0fkqZ29tLoOYDk4bWJ027N25jQlquFO Ya4BiDMCHq3PSPi/TbF/P7b8DtJadhAHifDHRUNFHiStdyX98iOVVlG6H76DAponch9m uh/UeUDnwKjgbkVppqqSTo/Ua5zSShhhgawnlZBLIeBpmWUoXborAHq3Aml1jNebkQSI 61O6RJkVEIlSlA6nZ6IBYEbZ/EGb9NMF95QWT9uxJUog9hvOyFv/aFJA/k7c+5Z2wpJA gVaRWvNHI7u1Y49KzIFBDjvCjcsxpK8ygOvVrrXc2RWKhIerffzwnNoOdKC9O8D8p5F8 5o3A== X-Gm-Message-State: AOAM530VnIqPx7A6wRvUgq3nMzEJqjegcN1jGmN/QKrIDwUucqUuTR4Q iF3oGFL4f5VUd0/TLtStKqM= X-Received: by 2002:a17:90a:4204:: with SMTP id o4mr928331pjg.199.1630355024962; Mon, 30 Aug 2021 13:23:44 -0700 (PDT) Received: from google.com ([2620:15c:202:201:771a:afc8:2e96:23dd]) by smtp.gmail.com with ESMTPSA id s20sm14915497pfe.205.2021.08.30.13.23.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Aug 2021 13:23:43 -0700 (PDT) Date: Mon, 30 Aug 2021 13:23:41 -0700 From: Dmitry Torokhov To: phoenix Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, jingle.wu@emc.com.tw, josh.chen@emc.com.tw, dave.wang@emc.com.tw Subject: Re: [PATCH] Input: elantench - Fix the firmware misreport coordinates for trackpoint occasionally. Message-ID: References: <20210729010940.5752-1-phoenix@emc.com.tw> <000001d79d99$53762dd0$fa628970$@emc.com.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000001d79d99$53762dd0$fa628970$@emc.com.tw> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Phoenix, On Mon, Aug 30, 2021 at 08:19:48PM +0800, phoenix wrote: > 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 || I think this will reject X coordinates in range [0, 127]. Is this really what is needed? What kind of patterns are you observing when firmware misreports coordinates? Thanks. -- Dmitry