Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1126844rdb; Fri, 9 Feb 2024 11:02:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQrqAATkbXx9or9GgegKgPXtdSM1eLgeNS3il2OAt5m8nJDBP2barmJL7erJ+k+55QhWls X-Received: by 2002:a17:906:50b:b0:a3c:1d36:62d6 with SMTP id j11-20020a170906050b00b00a3c1d3662d6mr7523eja.35.1707505358137; Fri, 09 Feb 2024 11:02:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707505358; cv=pass; d=google.com; s=arc-20160816; b=jvFZeaHLa82zYFLGk9YA1Ll2mz6VkgrUNLF1ZPUGCBbPtEx6IqCgSr98k7c3KpavIL 9s0rnBylAfQKba/aHMv2+s3aWR3b4gROJ+1qifTINLSFAIOxAZw92UbwRhIgVxNBi1P+ Uvej5TvuJg+CYXrHtI7ojVSxgo6qaiyDxFgbZn+yrjpo5vpXKu4QQNfLf78sIxFoiZ9R wMnID2+Y2ZGtVpuQ6855AjoQeEjp6zXiaMD/MyHG67nS0ij7A7YdPA+Fn1w6RcRNHmh3 oqZqZXFK6JlgMrVXVVCKirBlDukgLx+agrytSCpMAW51wn3op3WJTKDWhnvt2dnQS0Cn sOUA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dTLq5cLd6EW0V+pCXvV5cGkaUzSdBm3QWfelUNi0RmI=; fh=bSwQntz9+vdiRhWjcSAo910NW0HgdWqxlfLl8dHCauk=; b=DL9jX61qbWiJdXVhMXz02uPuuEye9KQIY2MFHveajm4qvio1EkRKagld3x7K2ap7um DSuVs1YKBNJcLK1InGJSbltReGVgVrYoYkqKCs2wHnMosidLy2zie7Olx25dMHCOnQ8r VT1yzrEgmP7n8qEgW/Nif+kwGcaHEWKCcTNdpTZACQl4jotB2hOJ+M1EAH/ApXutINzF LDAAts8cwuwBgKHwjxUTgG0E4qJ/3rL5U04o7ZRiAIj1kr0iC4uFABpQrEq89Q9adx1o NTQUFtRKerLFPOuaasA1x18EK5m0eQnyI9KiRSq8pnFYPoxp+d0COEDxF4LDf0/oyO3v yyBg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jFzAJbMT; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-59852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCUTTP+SnEccbduq+IPYoWFkK/KVhRzZ9wuPVkWYIddcLTIbkDSvVDd06AAfPUHwBiSF5o6NItmvmF0k1C2vDwex4zjH4cH6g7rnjbeJWg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u8-20020a1709060b0800b00a3c027a833asi555394ejg.837.2024.02.09.11.02.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:02:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jFzAJbMT; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-59852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E61A31F228A7 for ; Fri, 9 Feb 2024 19:02:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4DB915A787; Fri, 9 Feb 2024 19:01:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jFzAJbMT" Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2720550241; Fri, 9 Feb 2024 19:01:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707505317; cv=none; b=lMbwhWdGbh/jETU1SrStiHfuwtz3EZjmCnIUMVVUPesr/sMjodaON0Mz9EvurDjtD5tl0+Gxczjs5PYJj6T+G/IX8h/wEKSFk6IIvwOGtSP1kPAkcgpcSPePOF5Mmh0G+3JY6BrdBKpPoBzZErvMvAyJ0MaKShL6PuI1KCuu3xo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707505317; c=relaxed/simple; bh=mXnpjUMjZYmglO49XI5gBG1hSNgTF3CJvQfAO/EeFJM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Y0m/ngVmhAVobQo8SpC3YNrvgXXYK8CCmNq0j0s0Yd5PWAPAnBSKhA0kNlxOOHa1HvHLwPdLkwp1/LaPzY2wPcPEmRaVhNqlu3AxK8cX6r8RVb349WKz2xY64O5O8PemDYZTOWuZ5O00obLJ5JRGRnlwGB6pAlLcDBOUUpxX4yU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jFzAJbMT; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d73066880eso11302985ad.3; Fri, 09 Feb 2024 11:01:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707505315; x=1708110115; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=dTLq5cLd6EW0V+pCXvV5cGkaUzSdBm3QWfelUNi0RmI=; b=jFzAJbMT7zEthpuJ4hK+R03ZiMjVEzqTwvdZqotcEj5IICqqYC4v4YVs+YTZHVph2l SddUIWbPi5xc8SpXY3PDsejQkeMGbY8/AS3CtP6OCGjFJ2EJZ9K1kL0yurV3k3rCp7o1 3+OI0u/CyEman0C2MBQ3BKHm65BAPzdYTVwPU+2xiWkXY5uz0JqkI9BuelX0SoZ+L+9a 1FQmYAq4lGzzjZOIcqo+IyB3DhAdG9ncObXJTUVj1y/dz5lqIq7MopLup1AP1OdIcsVU Vnpf8WBec9eUl90pkx2lTO3Qjk19xvbJNhWfQMkrjQrj9FiY5VqBvbGqYO07xXm08AKP akrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707505315; x=1708110115; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dTLq5cLd6EW0V+pCXvV5cGkaUzSdBm3QWfelUNi0RmI=; b=F0i7w6/1aNRCbiOrroQXCDlgNXieCKalBtKX28Fm5izlgV+SNjyOdcZ+dYB0bsH6Dm W6/cacJunRJBYutz4wcWrcsjsSXiUAg28Tpem9u7TmbdP123v/dUwGTZCI9YF2cfA/uN 5ztWW2cuuUxGIl8/jizr8vOp7x/MuLGZCRy6oxs452K4dEzYXBXfXin0zKsTKar3mTLO Sx5GGpbPOmN5Z0KiFSGaQyFf9J2UVZbfOtSyl6HTbHfoC+wk+DQP11Fx99+AR91vWPg7 xUrNhkgL+R1iesnH8Q+7al7r1RfEKNt8QcVhC1T5cf+MVJ39usbGc6S5zEp339lGFAiD Qr2A== X-Gm-Message-State: AOJu0YxjMptfXkYqoABN0JevS00feQhKQMWG0+0tehOha9NRYL4caVNP IvwFQOuUiHEPVMjIhZEqbfS4jIFZZqcpjt/W68IZXvyLsa9No8kk X-Received: by 2002:a17:902:e80e:b0:1da:1780:8b49 with SMTP id u14-20020a170902e80e00b001da17808b49mr228638plg.0.1707505315264; Fri, 09 Feb 2024 11:01:55 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUjoEMxNjLxC6GOol6lB7OSTSlHJOlWls8J/e10SG76ACkgM/Ro7WDvQcB3b0Ii/kS8FulfhCnUy/LlCYjFkTg1hKNmWG/kyRXpNdOmF467WzD+b554gPULeBDUZDzDzD/93ygbbvsVtsLMvbAZamLgf03EYUr+FK//4nJE/0iMz1BA2HpChpdlar6/Hvx+Zo9OjtCJyaQMqs4g3bqkIiE51Wb25xc3e9lthg== Received: from google.com ([2620:15c:9d:2:9ec:8b78:c8c:fc9]) by smtp.gmail.com with ESMTPSA id ks7-20020a170903084700b001d9033b9d8csm1833761plb.59.2024.02.09.11.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:01:54 -0800 (PST) Date: Fri, 9 Feb 2024 11:01:52 -0800 From: Dmitry Torokhov To: Jonathan Denose Cc: LKML , jefferymiller@google.com, Jonathan Denose , Raul Rangel , linux-input@vger.kernel.org Subject: Re: [PATCH] Input: psmouse - add resync_on_resume dmi check Message-ID: References: <20231102075243.1.Idb37ff8043a29f607beab6440c32b9ae52525825@changeid> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Feb 07, 2024 at 10:39:03AM -0600, Jonathan Denose wrote: > Hi Dmitry, > > Thanks for your reply. > > On Tue, Feb 6, 2024 at 4:04 PM Dmitry Torokhov > wrote: > > > > Hi Jonathan, > > > > On Thu, Nov 02, 2023 at 07:52:47AM -0500, Jonathan Denose wrote: > > > Some elantech touchpads consistently fail after resuming from > > > suspend at sanity_check in elantech_packet_check_v4. This means > > > the touchpad is completely unusable after suspend resume. > > > > > > With different permutations of i8042 nomux, nopnp, reset, and noloop > > > kernel options enabled, and with crc_enabled the touchpad fails in > > > the same way. > > > > > > Resyncing the touchpad after receiving the > > > PACKET_UNKNOWN/PSMOUSE_BAD_DATA return code allows the touchpad to > > > function correctly on resume. The touchpad fails to reconnect with > > > the serio reconnect no matter how many times it retries, so this > > > change skips over that retry sequence and goes directly to resync. > > > > Why can't we do this in elantech_reconnect()? I am sure we can make it > > simpler and more robust than what the generic handler is trying to do > > with polling and everything. > > > > Thanks. > > > > -- > > Dmitry > > I am fine with anything that would be simpler and more robust, though > I'm not sure how to implement what you are describing. > > Are you suggesting that in this PSMOUSE_BAD_DATA case, instead of > using psmouse_set_state and psmouse_queue_work to call > psmouse->reconnect (which calls elantech_reconnect)? No. From the description it sounds like the device sends wrong/extra data right after resume. I think you can handle it in elantech_reconnect() method by draining the buffer or issuing poll request or something similar. Can you post the i8042 data stream that happens on suspend/resume? Toggling i8042.debug option will cause the driver to dump the data to dmesg. Thanks. -- Dmitry