Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5633204pxb; Sun, 7 Nov 2021 16:51:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzN7WGfkH4k/KFRlYLUzOaOt+CSxdqzCc07+Id4Z+jzKUQW4/Cqe8jSvxfmPDeRj/Sn/I/h X-Received: by 2002:a17:906:a057:: with SMTP id bg23mr31878691ejb.375.1636332681752; Sun, 07 Nov 2021 16:51:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636332681; cv=none; d=google.com; s=arc-20160816; b=D7XuxU9a8aLR1c+7lx1qYhlwQ8KQD178jpi1Wy7Ow1Dl9xqFILcVZOSc3G6QjdPULY Oe68KmYMpGckFZLwqV7SV8LmaIS/BvSu6AY5EaSYFVpb2aXw31PqJyCduVq6iX42DFHk QKwtnmaOUmiI6bDDMStFSRE0mMMNLbCu6BoDiuGNpbp6vtn3jhzwrAx0Ue4v5Y41hNm+ VdFlKAM86UAPRKSnVCEDW/PCMnAF4DA/7f3DIm8398wjxujNTqwUIII1QUGkH+GW2djH PiNnE59qokozLTq//A1SfItB2UZOCnwbOqtllIbbe2cfZPmf2QGYZzb93D3X/hsdw0s7 NDdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jHTtxJLlQcfnjQLsOeFnXfsLO4QxGpcGfvUQt2BuQxs=; b=dpwUvICwJfU/Rtmz5sPTdrZBSrLLxjSScBrCR2sTJslwfuKHjU88Y2kr269U7Hl7sx cBYpEs4KsaRscst4/TAuxiQqP3OTPCUyHouh3wmb6UAJovKxf0D8jqr0/+PVvAesTC9r MCkYAiGgch8Y1dK7HhnvEvQ7kKUkmqgQRvD9orzotKZJWG5U5i4MSCXUelLp9yNw+6Oe 4VRN1xpESKynOuwafcUyxRJ1ExLbynEjni+4x6nsy2jjjuuac1QbJJs3ZKw6/gMBUyUY UMVIN06jP9z50WXk/0fOR6llcqWWXW7mBMYnKsqK1Dugdh+Ak+iJQzg7wXftAUxcfxKD bn8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cs.unc.edu header.s=google header.b=Vpn+ZMUh; 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 e6si6071229ejb.739.2021.11.07.16.50.59; Sun, 07 Nov 2021 16:51:21 -0800 (PST) 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=@cs.unc.edu header.s=google header.b=Vpn+ZMUh; 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 S231401AbhKGUFQ (ORCPT + 99 others); Sun, 7 Nov 2021 15:05:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229548AbhKGUFM (ORCPT ); Sun, 7 Nov 2021 15:05:12 -0500 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB569C061570 for ; Sun, 7 Nov 2021 12:02:28 -0800 (PST) Received: by mail-qt1-x82f.google.com with SMTP id h14so12054452qtb.3 for ; Sun, 07 Nov 2021 12:02:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.unc.edu; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=jHTtxJLlQcfnjQLsOeFnXfsLO4QxGpcGfvUQt2BuQxs=; b=Vpn+ZMUhe+OzC+TiaSbEzjLlxskWMOQqPAtdyHby0/wBv2iFtRhGkiCk6XKluEIH+3 SbjxwtTMb4gG40ZtnBIkRhiKUYcREihysIGv6a636VTt+/C8XVyRFuoSpzhkAkSEhSBt ArA5PDdnBlGchLV5FuPetGmQ1GFlwp/eHbgAo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=jHTtxJLlQcfnjQLsOeFnXfsLO4QxGpcGfvUQt2BuQxs=; b=I+UAoO0wD2QPacV9VC3ZA6YqsigxOZ9BGrq8QbueDCwuvWDSmkuWci7n2uZOwGOw7A rHi05i2ExpjnFvWNudjHHmt7NWGnXPYHVJ39HQGhXNiDmasEOGS2ApOL8jMX4WXrUxDO Gd26HKHXhmCtzbINuxNUNYpZIdppneYEH/wpf51XIGJLF1g1idYMQ8aThhLBiWdRx0wk Fz/REGpboBsM5JKZcYWH+1ZYr4Dyh5zqezqnf21SNkNPPoTNfoKWXMzyLXCvaFa0R7xh ARGTTdV+dPEh68awfEjfvM3aOF33wGNqcDbivDxg35sY3gCgKfF7xZdCNe4DgMQFxfra h0YQ== X-Gm-Message-State: AOAM533lCr6h66wJfmA5aXgutQY2IxdLJ9pHRFWR0X4790yxZPu0eFA+ rQ3kJICxm9XMjcu0/NTWoSfZjw== X-Received: by 2002:ac8:7f44:: with SMTP id g4mr78744298qtk.130.1636315348073; Sun, 07 Nov 2021 12:02:28 -0800 (PST) Received: from [152.23.88.220] (dhcp-152-23-88-220.wireless-1x.unc.edu. [152.23.88.220]) by smtp.gmail.com with ESMTPSA id u19sm9741710qtw.14.2021.11.07.12.02.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Nov 2021 12:02:27 -0800 (PST) Message-ID: <3a98b10e-6b78-b769-e22d-2496d7bcd69d@cs.unc.edu> Date: Sun, 7 Nov 2021 15:02:27 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH] Input: elantench - Fix the firmware misreport coordinates for trackpoint occasionally. Content-Language: en-US To: Dmitry Torokhov 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, phoenix References: <20210729010940.5752-1-phoenix@emc.com.tw> <000001d79d99$53762dd0$fa628970$@emc.com.tw> From: Yufei Du In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dmitry, I am a user currently suffering from the firmware bug that causes my trackpoint to be unusable on my Lenovo X13 Gen 1 AMD. I tested this patch in the latest 5.15 mainline kernel tree and can possibly answer your questions regarding the patch. > I think this will reject X coordinates in range [0, 127]. Is this really > what is needed? As Phoenix explained in his reply, the patch will reject X and Y coordinates larger than 127 or smaller than -127. This is because the most significant bit of packet[1] (for X) and packet[2] (for Y) are inverse of the sign bit. Although I do not have the formal design specification of the device, I tried pushing the trackpoint as hard as I could, and the X and Y coordinates never go beyond +/-127 normally, so I believe that this patch would not cause any functionality issue. > What kind of patterns are you observing when firmware > misreports coordinates? Here is a sample log I observed (with elantech.debug set to 2 for more debugging messages): psmouse serio1: elantech: PS/2 packet [10 00 80 26 f9 0a] psmouse serio1: elantech: PS/2 packet [10 00 80 26 00 80] psmouse serio1: elantech: PS/2 packet [10 00 80 00 00 00] psmouse serio1: Touchpad at isa0060/serio1/input0 lost sync at byte 6 psmouse serio1: elantech: PS/2 packet [10 00 80 26 f8 0b] psmouse serio1: Touchpad at isa0060/serio1/input0 - driver resynced. The first packet is a valid packet. The second packet is the incorrect packet that this patch prevents. The third packet is a corrupted packet that psmouse detects (as shown in the "lost sync" message), and the fourth packet is a valid packet again. Without the patch, the second packet would cause the cursor to jump to the edge of the screen. So far, all my logs of this issue show the same pattern of a jumpy incorrect packet followed by a corrupted packet that causes psmouse to lose sync. There are more logs and discussions in the BugZilla entry here: https://bugzilla.kernel.org/show_bug.cgi?id=209167 Hope my explanation helped a bit. Thanks! Best, Yufei Du