Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2050285pja; Thu, 9 Apr 2020 13:09:43 -0700 (PDT) X-Google-Smtp-Source: APiQypI5znVc7vY1X77Mo8sNiYzWTBjJ7yxgkZscGif+iXxiZCQGzT1kufT24YkZSxUByNf0LKGB X-Received: by 2002:ac8:6695:: with SMTP id d21mr1242306qtp.110.1586462983034; Thu, 09 Apr 2020 13:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586462983; cv=none; d=google.com; s=arc-20160816; b=tQTB5eRkW0fhrvobf9Nq9zmI3XC6E3EqTwfEqz6R6gOYth1gzA5Sb75oHExROfPU8+ pBgEZVWOkYVKEcilu/WNCaWc0MjEeOykvlcj+i9AV5eXCt+oOKPoO09lrk01Mx/Y5LsO x2ZhGCd7oQblVgpBEgqi+8a+WJOZStcUhQlNpzw9cseVQiictOxRFzAKVaPufDWdMwdZ IbBJy9ctS5G70J2XZkMPE2AALUkJS4kZTxcSC/j75lWWswMvxRZE7RfrlU8ckRkkoSLu oiDCNWIEKTT1DJaiqQbNs/xBQPL1mMX/vKDtHzY/0U4A1WwcwYpUlsPQQ7EaZfgp0vjP puzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gFbgLvA9IhNM6MS+duI6ZIiItgpmMayKTmOoqArHpEk=; b=hXCAiFjMaeVBykg/+LjZlahwt6EwCStHJkkwFYiwRWyweId1Fc7dn81mdv9dkUlTRC Yu5Jt8lx767sNzCqE82qnn2tjZJWz8J2gIcjthvgakn1aZPCYNLYWr3c6n+rf25Yd0PR 1pfKq0CJUu0Q7TlDI6dzJqwKBKF0TRMQoowPw9XDMe+URfyVYmw2KgAt+Rlqe1HODaCw dedXtF5WHPoS1g90TnonG4BOm6d+iUwC9vrO75l4nxVM+T7VFQyqIok9a/x7DfOJGOui r2P3mo4eVNb/dju2WkaAOSRJ5DYop0CGKAizcuO8Nr/vPZGM6Wyk2qr6tl7nM/QIDNqm 5puA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Wo8uwSUO; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y18si5980223qtn.299.2020.04.09.13.09.27; Thu, 09 Apr 2020 13:09:43 -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=@gmail.com header.s=20161025 header.b=Wo8uwSUO; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726945AbgDIUHv (ORCPT + 99 others); Thu, 9 Apr 2020 16:07:51 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40845 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726796AbgDIUHu (ORCPT ); Thu, 9 Apr 2020 16:07:50 -0400 Received: by mail-pg1-f195.google.com with SMTP id c5so5466422pgi.7; Thu, 09 Apr 2020 13:07:50 -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:user-agent; bh=gFbgLvA9IhNM6MS+duI6ZIiItgpmMayKTmOoqArHpEk=; b=Wo8uwSUOk5gr4ciM3Mm7hxCSwPVI02l6a7YUFVcamVf9M9cFL8y+2yGQ+gBiRkwofK OkSEHrjC3Fia+rWqSGFhCuAzYBdMVtvkvkJLbZNpvE0reNA7giBWAhcwkVi+nqsTnW9j sj/3E7UsT66cxUBZ4ZLCrFk+jzupvF6CCMij3BpAo6efbn1/zt+9wHxC8gmURaf8j2qi khwhA64g0MLeKbvQFNwYCp49SAgWa18G39YVWhwjOFiAkEbXsIQX8W10aTUcasc0kn/k kDaEKK3QxzVDNP/hkpRBmXVRPxco3OyDUqMra8s8gr/uphlLzYd+OSlPQytznmplEz4m 3SXA== 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:user-agent; bh=gFbgLvA9IhNM6MS+duI6ZIiItgpmMayKTmOoqArHpEk=; b=fJReW1WhnIo228O22F3O82lh6jTsD17bbZPnGUdMsdVI5YhTLGsZgTLUyGj4n0RMsU VFwLJ1Dp5/Qtwref88WjCGw09eBSfwS2cGIvVQoexbvAaHAj62LjRs+83c84+qtoe0fH zrLgxlufIDKpk1Zqyz8m+JQeN0wz7x7dp9rfP54p3pDkhMs/JiXeLSvX1zrMoZ0tGZbI W5WrIUohBu9aaHWM8Uqow7cQczDwCL/+TLK9XnbkvEye7x+mdx4THqZ9i7W0Q1oTyxfR ZzmAWXTtEV7FqmD/OYS0x/X6m9i+tcYvr4Sz/cMMaAWvRSXiQZPNokcgUmtvyTV/8ZOS MhcA== X-Gm-Message-State: AGi0PuaqKBsQF7ho0DMWP651iVg0p9bz2TOjSFmv0p+3fDgbxclWsFUN bayAvDC7iaVXPcxPpxZly7GZOzpo X-Received: by 2002:a63:ff53:: with SMTP id s19mr1129626pgk.247.1586462869353; Thu, 09 Apr 2020 13:07:49 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3c2a:73a9:c2cf:7f45]) by smtp.gmail.com with ESMTPSA id k24sm93772pfk.164.2020.04.09.13.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 13:07:48 -0700 (PDT) Date: Thu, 9 Apr 2020 13:07:46 -0700 From: Dmitry Torokhov To: Bernd Edlinger Cc: Benjamin Tissoires , "Dave.Wang" , jingle , "linux-kernel@vger.kernel.org" , "linux-input@vger.kernel.org" , Kai-Heng Feng , Enrico Weigelt , Allison Randal , Aaron Ma Subject: Re: [PATCH v2] Input: elantech - fix x_max/y_max values Message-ID: <20200409200746.GP75430@dtor-ws> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bernd, On Thu, Apr 09, 2020 at 07:38:17PM +0200, Bernd Edlinger wrote: > Are you there? > > Should I re-post the v2 patch, was that dropped somehow? > > If I don't hear anything I'll assume I just repost, probably > as unchanged v3, right? I do not think we ever got confirmation from Dave or Jingle; from my POV I really dislike arbitrary mangling of the data. I think you are right that the issue is with order of calls, and we need to switch the touchpad into absolute mode to get valid results from the ID query call. Dave, Jingle, any impot here? Benjamin, Kai-Feng, do you know if we try to switch to absolute mode to begin with, will it cause issues with SMBus mode? Thanks. > > Thanks, > Bernd. > > > On 4/5/20 7:54 AM, Bernd Edlinger wrote: > > And, furthermore, there is one thing I find really confusing, > > > > I do not see the message v2 quoted below which had an updated commit message, > > due to that Benjamin Tissoires request. > > > > It was from my point of view sent on 2/27/20 11:03 PM, > > but I cannot find it neither on spinics, nor on marc.info. > > That is funny. > > > > Did it reach you guys at all? > > Or should I re-send it just in case? > > > > > > Thanks > > Bernd. > > > > On 4/5/20 7:26 AM, Bernd Edlinger wrote: > >> Ping... > >> > >> This patch works fine for me since several weeks, > >> without it I would not be able to use my laptop any more. > >> > >> Could you please accept this patch? > >> > >> > >> Thanks > >> Bernd. > >> > >> > >> On 2/27/20 11:03 PM, Bernd Edlinger wrote: > >>> Since commit 37548659bb22 ("Input: elantech - query the min/max information beforehand too") > >>> moved the querying of the x_max/y_max 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, > >>> 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: 37548659bb22 ("Input: elantech - query the min/max information beforehand too") > >>> > >>> Signed-off-by: Bernd Edlinger > >>> --- > >>> 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: > >>> -- Dmitry