Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1094709ybf; Thu, 27 Feb 2020 05:00:26 -0800 (PST) X-Google-Smtp-Source: APXvYqx5Er+92ebQ3xQmPdPuAqUvvnHrsP82lPNc4LDtxMU4vvdEyhCmpt630GyXgYvJI0AUf9mz X-Received: by 2002:a9d:7f8d:: with SMTP id t13mr3031385otp.175.1582808426016; Thu, 27 Feb 2020 05:00:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582808426; cv=none; d=google.com; s=arc-20160816; b=fwKvMLnbnYNIrH7FOgQf7qLzMG2hN0eJWov7SCNadH89oM5lprq5vmms80eSVPv+IO vC4v64PsB/iFsTbTHXL3mZBC7u4SHMJzRnepbZS1HWlvig3qDZ+vP3keS1/RF2s2rFom p2FcKclPORMFqBRXim2XQrqiqx+Rw1Jd79a4pJBLTB9h++LnX5/peyXh7trlNi1DVfQK TFqzGuKnSnoWLL0PNi+msGzntbKDVgJOZvb6lf5I2NVzUm4hsC+es3lihxI3wjA8CsLz HcZZxBr/DN3S0YQBlcnTJo36N214LkuwJkSBXaQBrkfpOGqr1OQWVYMa8KDEV+sEva1+ i5EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yoC7+Q3k5WLnxp7SXHpb3nLNBOol+SI5ecqHeVBQT6o=; b=cYJ3y+VxmukQ+XC9PcgcAGOnjiEJvGcampgkr1uSCsePjOUtzUaPvdye/ts6NcocCT ltgVrM+5PnUceRLFoF8rwBbsCARZZw2e6QphCt2uz18x5nzGVbuMcJAGx/9yeHgqUuCT /MPHmpSw4i1Zd2+FEnv4mGm5gJX1vSEKZmMLOlhWuKBo2AYfSs1TachwNdPjjZ07KC1j zNgu/sOjiX0ZoLI7sDBHcnzSgE1Pys4g4rq5ClS6oE0GeLPIOGlI91QJiUAa6y9nTI/P qsMF9HWNs/OwZCzsR2fsRaWdEQvItIdPn4u5e9sLCks7iR8uJ3h9sxcB4qu/KLhA0exy HnJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KuBq5io9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si1521869otn.208.2020.02.27.05.00.13; Thu, 27 Feb 2020 05:00:25 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=KuBq5io9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729131AbgB0NAI (ORCPT + 99 others); Thu, 27 Feb 2020 08:00:08 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:57354 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729030AbgB0NAH (ORCPT ); Thu, 27 Feb 2020 08:00:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582808405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yoC7+Q3k5WLnxp7SXHpb3nLNBOol+SI5ecqHeVBQT6o=; b=KuBq5io9CIk7RMtAJYiXKPjMOHxMjx+giQbAwc05ys8fACUZQ9q0fmyKz9JHSFA+xxslsQ A7Q19aO4D9fNkM7hmOkQzXQ6FhHRbqj/SutElJFeG29t5EvnN+hGH5C3gsU7QpY1Y/1xRv 90oh//Nhk3aogb5Y1V2Mc1X5BhTIRUc= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-102-yz7grF5rMSSIvF18vOG8-A-1; Thu, 27 Feb 2020 08:00:00 -0500 X-MC-Unique: yz7grF5rMSSIvF18vOG8-A-1 Received: by mail-qk1-f198.google.com with SMTP id x19so764660qkh.2 for ; Thu, 27 Feb 2020 05:00:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yoC7+Q3k5WLnxp7SXHpb3nLNBOol+SI5ecqHeVBQT6o=; b=JNiSpXIYjaxltHrWNhlp8Y/OTQImc3eLSz2TMZBv7LKAcOeSKyHxoBaAoJDUPIQcal MXSYuVi1IRwKLgu7ceF/pPf/mVuZ9p6VcTN6vh5Kci4APqDSSP7bp5NilYo5X6NL3CCA fT75dSVgxHRHchH/eZdJBe9s3TFPQ+2oqvwF3wak4nODU8FKhKhyAj8mUJvu05LeazIZ wRz7rMPf6NpBD67KpikMgOeKkMGaFzSg5Op6Qg96eHk5ShjeErYVEp5G4LUBOCNIksiK g+WX8pwjZQ2RoKRrEfl086AxOhx+HALWeuxpH7T6GENi3ZzLquRbuHn3IRa7I/P88B8w bdpg== X-Gm-Message-State: APjAAAXbOYF8XoLZxhOyFzGe5jDzmUZJ6TPFX1C3mN1+LmUZiscF60qU Wh0Cuar+gY8ZXefKugUCTOIcku7tpOw1Ead7uCkVS9qX/u0rwKPVr5tPbIYJ1g1SwMRovMY7F0Y IjIzhlAjAFuP1aMza9Je8Uw2WY2q2m2pR/IfRMF+B X-Received: by 2002:a37:9d4f:: with SMTP id g76mr5470609qke.169.1582808400388; Thu, 27 Feb 2020 05:00:00 -0800 (PST) X-Received: by 2002:a37:9d4f:: with SMTP id g76mr5470579qke.169.1582808400150; Thu, 27 Feb 2020 05:00:00 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Benjamin Tissoires Date: Thu, 27 Feb 2020 13:59:49 +0100 Message-ID: Subject: Re: [PATCH] Input: elantech - fix x_max/y_max values To: Bernd Edlinger , "Dave.Wang" , jingle Cc: "linux-kernel@vger.kernel.org" , "linux-input@vger.kernel.org" , Dmitry Torokhov , Kai-Heng Feng , Enrico Weigelt , Allison Randal , Aaron Ma Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bernd, [adding Dave and Jingle] On Thu, Feb 27, 2020 at 12:59 PM Bernd Edlinger wrote: > > Since 37548659bb2 moved the querying of the x_max/y_max Hmm, I am pretty sure checkpatch.pl should have complained here: the correct way of mentioning a previous commit is: 'commit <12+ chars of sha1> ("")' - ie: 'commit 37548659bb22 ("Input: elantech - query the min/max information beforehand too")' > values from elantech_set_input_params to elantech_query_info, > the returned x_max/y_max values are different than before, > at least for some firmware versions. > > The reason is likely that this is now done before > elantech_set_absolute_mode does run. So it may happen that > the returned values are exactly half of what they used to be, That is weird. Can we get confirmation from Dave or Jingle about that? > which makes input_report_abs in PS/2 mode report ABS_X values which > exceed the x_max value, which is very annoying since the mouse stops > to move then, and ABS_Y value become negative, which is benign. > > This was observed with a MSI GX70 laptop: > > elantech: assuming hardware version 3 (with firmware version 0x250f01) > elantech: Synaptics capabilities query result 0x18, 0x17, 0x0b. > elantech: Elan sample query result 05, 0e, 00 > input: ETPS/2 Elantech Touchpad as /devices/platform/i8042/serio... > > Correct this by doubling the returned x_max and y_max > value for this specific firmware version. > > Fixes: 37548659bb2 ("Input: elantech - query the min/max > information beforehand too") Stephen will complain here: see multiple google results when you search for "lkml linux-next: Fixes tag needs some work" Basically: - SHA1 should be at least 12 digits long - the commit title should not be split, even if it gets longer than 80 columns. Cheers, Benjamin > > Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de> > --- > drivers/input/mouse/elantech.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c > index 2d8434b..3399db8 100644 > --- a/drivers/input/mouse/elantech.c > +++ b/drivers/input/mouse/elantech.c > @@ -1720,6 +1720,10 @@ static int elantech_query_info(struct psmouse *psmouse, > > info->x_max = (0x0f & param[0]) << 8 | param[1]; > info->y_max = (0xf0 & param[0]) << 4 | param[2]; > + if (info->fw_version == 0x250f01) { > + info->x_max <<= 1; > + info->y_max <<= 1; > + } > break; > > case 4: > -- > 1.9.1 >