Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp354472rdb; Thu, 2 Nov 2023 05:55:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvFDdaJkzbmK1d4qRtdCieXjwMUEpE+aYr4GPuHBx6HPuLJk4TFYKE/Cs12uj5GHntut1W X-Received: by 2002:a05:6a21:7185:b0:180:def9:20e1 with SMTP id wq5-20020a056a21718500b00180def920e1mr11043135pzb.22.1698929713567; Thu, 02 Nov 2023 05:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698929713; cv=none; d=google.com; s=arc-20160816; b=WXw3XQMXcOzKj0AbFxEwvbYYsfqEQs4hJPUZBl3uU4NFgfazK2FO3NPjef+xFNS/Z4 tTqNYOXn13dNzkk5M8OHewCUpCHhfor9oF2vD0D0nTH0jQhJBa1sICUQuW/FYPeVGdd5 M/zRukewxGLeknXz3dSv8qz2UNXam8fx554v0jN/qm6n5+SCCwcQDnxx5fKMa+SUt7P4 gHnkWByCSO0BRe8B3P1oMZ9QQ0SXlFRDhjBOorr4YEQdz6S0geOk2/n8QaAqR7zSVRBo dqsjWCp8A52/CHcMolXCmKobUfAwX5LKNAxs66gNwysMoPJC9V4VUwlvxugmSjgJLKkn qxgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=i0TjCm27kPn1fbRaa234/Wv9QR/vO4k2O7cQuwk/rSc=; fh=EsIGBGfxc7oC8oVMaO0PQk8LkldTHSTTyJYhs5JoFd4=; b=Mimt3H1CN9PoZdS4jbwBPaij+JqE4foO1cil+hinbDNrINDBQTfamTXzuPP4/lLdqW PJcR3BOAWdyuEhPFqm1HcSCWY3QRTOAw2lqsWsqABl4/8dud8iM+AxI57YOoVgswulLD 1rp9mMAvM5hMgAuxtHN4RxHyE4Btgl+t+P6YnXdJEUshSvS3CnkzmKZFOdEKZhw9ZMKN JCG8ZYKUfSK1PLdVDw+oJoPQ3x8Rad3R3y646inVZ7Jx/wWWZwQjLRSklkm3HqAVWFV3 EES3zhvTOySZngFA9MsAJlyUZ7bZueQRM9clTl2D76hiqEnqdP00JGDPZfTm1eZ/+pla hJ1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=L1F5E1ut; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q6-20020a056a00150600b006bebc50b5c0si3678909pfu.46.2023.11.02.05.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 05:55:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=L1F5E1ut; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 72C828029435; Thu, 2 Nov 2023 05:55:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344822AbjKBMy4 (ORCPT + 99 others); Thu, 2 Nov 2023 08:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbjKBMyz (ORCPT ); Thu, 2 Nov 2023 08:54:55 -0400 Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6029C112 for ; Thu, 2 Nov 2023 05:54:46 -0700 (PDT) Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-581ed744114so434027eaf.0 for ; Thu, 02 Nov 2023 05:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698929685; x=1699534485; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=i0TjCm27kPn1fbRaa234/Wv9QR/vO4k2O7cQuwk/rSc=; b=L1F5E1utA+x9G89a2yC+T8k1CZ43hoXSnIIhShvy7072c2gMFxkFYZj1VCIfvmNrew xfXR7ldbuLUcWiOK+i8huJWDOq6zEd6kbh2Zd1gKEvFWu1DQ6SwCO2PEjw1/eNrjgIgy nbnoL10ot+YYspl6PwJO7Lad4a0YEOY9uKg54= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698929685; x=1699534485; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=i0TjCm27kPn1fbRaa234/Wv9QR/vO4k2O7cQuwk/rSc=; b=vw70iHcmqZWr8Z1JAGWrdl1lGEWw6Z7yDgkEtv1rmA18iHQMK0eViSVlN2WgEB5QxP eC+A145K63DvCAn7aUEolsybCWNulrGqatOZvlUiCiL9noRbfPxf2MgiquUNsTROq8z/ FTBzYUIVYKgH786dsgxm//yYbBcrXYiTdzHtQTdT3Rl83+0+xjYxwPy8jxk3PY0qlJc+ Rocb9jpUf8VY/lB85+0JZxwSxJ5+hlgwA7jlWTwQ4gX2KywZLYG3IO1sf+8fwKTlGrBi 6mvqRlR0hA4N2Frxa1Me2h/ErgIftGQq+sme6Q4Rb/rxZ6wAaQ6udtl/QKV9Tgq7ci1g R2Hw== X-Gm-Message-State: AOJu0YxGOHq77BJavY9BrXERSgj4lGOx7T4p0PW4cva/ycyIc2r3kp8T DEwTw/fN26lnoMbZOGOazN6UiX+Gdc+A9/lW7s4= X-Received: by 2002:a4a:c885:0:b0:587:2b9b:985a with SMTP id t5-20020a4ac885000000b005872b9b985amr7860727ooq.9.1698929685302; Thu, 02 Nov 2023 05:54:45 -0700 (PDT) Received: from jdenose34.roam.corp.google.com (99-137-158-190.lightspeed.cicril.sbcglobal.net. [99.137.158.190]) by smtp.gmail.com with ESMTPSA id d200-20020a4a52d1000000b005737ca61829sm996467oob.13.2023.11.02.05.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 05:54:44 -0700 (PDT) From: Jonathan Denose X-Google-Original-From: Jonathan Denose To: LKML Cc: jefferymiller@google.com, Jonathan Denose , Dmitry Torokhov , Raul Rangel , linux-input@vger.kernel.org Subject: [PATCH] Input: psmouse - add resync_on_resume dmi check Date: Thu, 2 Nov 2023 07:52:47 -0500 Message-ID: <20231102075243.1.Idb37ff8043a29f607beab6440c32b9ae52525825@changeid> X-Mailer: git-send-email 2.42.0.820.g83a721a137-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 02 Nov 2023 05:55:08 -0700 (PDT) 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. Signed-off-by: Jonathan Denose --- drivers/input/mouse/psmouse-base.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index a0aac76b1e41d..3c6eefcb9582f 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -105,6 +106,16 @@ static struct attribute *psmouse_dev_attrs[] = { ATTRIBUTE_GROUPS(psmouse_dev); +static const struct dmi_system_id resync_on_resume[] = { + { + .ident = "Lenovo N24", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo N24"), + }, + } +}; + /* * psmouse_mutex protects all operations changing state of mouse * (connecting, disconnecting, changing rate or resolution via @@ -285,6 +296,12 @@ static int psmouse_handle_byte(struct psmouse *psmouse) "%s at %s lost sync at byte %d\n", psmouse->name, psmouse->phys, psmouse->pktcnt); + if (dmi_check_system(resync_on_resume)) { + psmouse_notice(psmouse, "issuing resync request"); + __psmouse_set_state(psmouse, PSMOUSE_RESYNCING); + psmouse_queue_work(psmouse, &psmouse->resync_work, 0); + return -EIO; + } if (++psmouse->out_of_sync_cnt == psmouse->resetafter) { __psmouse_set_state(psmouse, PSMOUSE_IGNORE); psmouse_notice(psmouse, -- 2.42.0.820.g83a721a137-goog