linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: elantech - fix fast_reconnect callback in ps2 mode
@ 2023-10-04  0:57 Jeffery Miller
  2023-10-04  5:07 ` Thorsten Leemhuis
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jeffery Miller @ 2023-10-04  0:57 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: regressions, benjamin.tissoires, linux, Andrew Duggan,
	Andrew Duggan, loic.poulain, Jeffery Miller, Greg Kroah-Hartman,
	linux-input, linux-kernel

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 <linux@leemhuis.info>

Signed-off-by: Jeffery Miller <jefferymiller@google.com>
---

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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-10-12 22:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-04  0:57 [PATCH] Input: elantech - fix fast_reconnect callback in ps2 mode Jeffery Miller
2023-10-04  5:07 ` Thorsten Leemhuis
2023-10-04  6:19 ` Greg Kroah-Hartman
2023-10-04  6:34   ` Thorsten Leemhuis
2023-10-05  0:35   ` Jeffery Miller
2023-10-04 14:10 ` Dmitry Torokhov
2023-10-05  0:13   ` Jeffery Miller
2023-10-10  7:08     ` Thorsten Leemhuis
2023-10-12 22:53       ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).