Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2305579rdb; Tue, 3 Oct 2023 17:58:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEiHRiynyBVB3SLR+bJjRI7G+lHS70D/9AIgBP6mrhqyV6BIS9kvsK9EnZkdNLmjNZC9HhS X-Received: by 2002:a81:8413:0:b0:59f:4c55:efa3 with SMTP id u19-20020a818413000000b0059f4c55efa3mr1248178ywf.12.1696381103337; Tue, 03 Oct 2023 17:58:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696381103; cv=none; d=google.com; s=arc-20160816; b=o0bt8t4Q60OBsZuuXuCNPmsAHzylS2VlNO+aUdqBbpwHao3W2rLBNo9ersZeoogw/o addQ2UAmaJ9EleLf7oamibvZpMUJjXH7oKXEuW/c7spPhgqNwAShnTWggW9ufGFoeCuQ m5h4MdfzLIASrwpZWARd443MiMQsQjWH8OkYfBqnborW/fFQjAfEkiydw2CC/mNRUfQv aYMs707DL4zvK9+nZBc4my99O1dGazR3DmWBpsDOZYGS5WzvM+yx/Ft5YaRf0vKFbPLl yhfWDsRsI+/iGVw478rXAW1oxBCWXVGuBJLYf34W69PNhipOjvmpvBCe/s5F+WYQ2SbX KjXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=uThSy4yEdZygz3nx9AdT/+Ka5ZDArvLjVeK3y4dcvFg=; fh=Rdqnoek/3dUydQA39Xeuo1LRgdJJvqec2D1SjH0jHZg=; b=RPcyF/L4OOTvbe5JEzR3MoGa5pm0Pk+KsibTW1nYlPRhQGvjjOmclXqTu9xLBo+kra HC6n9xiO+xQKYHFDp+UtUmN92/JuVRTx70zIiFLP1Kz4zKZ7XQ5qRGXXCmK1ye5AYH+u 7QiAn0t6MpNyz/V9A+q/z3xnVW2E3jLzcfL1hQBDcDzqE6INU+hkXLKx9/0uTTG6tqlT YmdxRnEbTPVXhkS1LzXjAw1+h6pzN5ZJqny2Y1blyUSIfH6uTh1d5JzhErs1y7iWPB+7 0cLwh66fXnr2+I17kqXjscEnCGBkc1zceaB7RfRS0H6x7mFXmO6oPlF3GxXkMTqROp5+ ONgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=WcIa0QSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id 199-20020a6301d0000000b00573f76b1f75si2617265pgb.592.2023.10.03.17.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 17:58:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=WcIa0QSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 7C08B81904FB; Tue, 3 Oct 2023 17:58:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239057AbjJDA6I (ORCPT + 99 others); Tue, 3 Oct 2023 20:58:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbjJDA6G (ORCPT ); Tue, 3 Oct 2023 20:58:06 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45C5DAF for ; Tue, 3 Oct 2023 17:58:03 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5a21e8ee1b7so3241607b3.1 for ; Tue, 03 Oct 2023 17:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696381082; x=1696985882; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=uThSy4yEdZygz3nx9AdT/+Ka5ZDArvLjVeK3y4dcvFg=; b=WcIa0QSlaApCsdXeQUUsE4MkFxt49fgzs+mlRdsqiRPMmuoyFgluspgbGzYFgMmtlM Kkm+P7HDgNfZOonNCu7mOi4W2PNZVw+/lhiUzFG9cCIKDQK+i4XGjmpj5byQ6b+d2Pm6 xLGjSesmmQ1EsoHtsITqgK7uuhQxS2inGwBUyHbFrLvX67awXgs+tInu14Lfdao48IrN fwWUJx/sgvfEPwJvOCGxXf0f4g/vEufHBOMwRDsr6MHChVwYuI9PvdIyZJ+iTSbyO3+j M/nWdsyYCgVXm4yi6/BLIxhufZOz5VSi6cYXpeaP3KCtnsfxtCMg/LOGJCVQ5GQtDVR6 loAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696381082; x=1696985882; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uThSy4yEdZygz3nx9AdT/+Ka5ZDArvLjVeK3y4dcvFg=; b=vjMRTVi7bBHrjJ9VztxCmQ/yi1MHLqWp0Hd3XahBPWDvsA4RBoclVVVl6fhH0t8VIC dnZ30A4xX86VygH4O54FITR9FfLr0KjxlEJlEjgvFAE7Vg2A6peVVj4PTUyhja/e/usG yx/6de5UZWy38PeDotSE+m8d47sQ7WWGORRXi5VjrZc27HPWB/MMY9nopIds0dNYSy0E aJsBFh/xUy05DVZsBPRoNBDuahMshlae1tV4wz6yUQg0Cjxx6ssjLM80Xq32V7V9I4ju Bz2k3z5n9JjukBn9dr4yoyRlCB3KZPhx/7eGqq6NFvVpCXSYURwIJG99KgmJ41PWuHZE HsFw== X-Gm-Message-State: AOJu0YwSQ2D/T2qf8Luan/yUXJR7O9tkaqo/sI01rmcWj0BBv5/UqML7 7+Oop5N1R5nHu2P/lxOb02LnUuT65YhToimRNTug X-Received: from horchata.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:5b3]) (user=jefferymiller job=sendgmr) by 2002:a25:b8d:0:b0:d89:42d7:e72d with SMTP id 135-20020a250b8d000000b00d8942d7e72dmr82813ybl.3.1696381082437; Tue, 03 Oct 2023 17:58:02 -0700 (PDT) Date: Tue, 3 Oct 2023 19:57:24 -0500 Mime-Version: 1.0 X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog Message-ID: <20231004005729.3943515-1-jefferymiller@google.com> Subject: [PATCH] Input: elantech - fix fast_reconnect callback in ps2 mode From: Jeffery Miller To: Dmitry Torokhov Cc: regressions@lists.linux.dev, benjamin.tissoires@redhat.com, linux@leemhuis.info, Andrew Duggan , Andrew Duggan , loic.poulain@linaro.org, Jeffery Miller , Greg Kroah-Hartman , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 03 Oct 2023 17:58:17 -0700 (PDT) Make `elantech_setup_ps2` set a compatible fast_reconnect pointer when its ps2 mode is used. When an SMBus connection is attempted and fails `psmouse_smbus_init` sets fast_reconnect to `psmouse_smbus_reconnect`. `psmouse_smbus_reconnect` expects `psmouse->private` to be `struct psmouse_smbus_dev` but `elantech_setup_ps2` replaces it with its private data. This was causing an issue on resume since psmouse_smbus_reconnect was being called while in ps2, not SMBus mode. This was uncovered by commit 92e24e0e57f7 ("Input: psmouse - add delay when deactivating for SMBus mode") Closes: Link:https://lore.kernel.org/all/ca0109fa-c64b-43c1-a651-75b294d750a1@leemhuis.info/ Reported-by: Thorsten Leemhuis Signed-off-by: Jeffery Miller --- The other callbacks set in psmouse_smbus_init are already replaced. Should fast_reconnect be set to `elantech_reconnect` instead? drivers/input/mouse/elantech.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 2118b2075f43..4e38229404b4 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -2114,6 +2114,7 @@ static int elantech_setup_ps2(struct psmouse *psmouse, psmouse->protocol_handler = elantech_process_byte; psmouse->disconnect = elantech_disconnect; psmouse->reconnect = elantech_reconnect; + psmouse->fast_reconnect = NULL; psmouse->pktsize = info->hw_version > 1 ? 6 : 4; return 0; -- 2.42.0.582.g8ccd20d70d-goog