mirror-linux/drivers/input/mouse
Jeffery Miller 211f71c1c0 Input: psmouse - fix fast_reconnect function for PS/2 mode
commit e2cb5cc822 upstream.

When the SMBus connection is attempted psmouse_smbus_init() sets
the fast_reconnect pointer to psmouse_smbus_reconnecti(). If SMBus
initialization fails, elantech_setup_ps2() and synaptics_init_ps2() will
fallback to PS/2 mode, replacing the psmouse private data. This can cause
issues on resume, since psmouse_smbus_reconnect() expects to find an
instance of struct psmouse_smbus_dev in psmouse->private.

The issue was uncovered when in 92e24e0e57 ("Input: psmouse - add
delay when deactivating for SMBus mode") psmouse_smbus_reconnect()
started attempting to use more of the data structure. The commit was
since reverted, not because it was at fault, but because there was found
a better way of doing what it was attempting to do.

Fix the problem by resetting the fast_reconnect pointer in psmouse
structure in elantech_setup_ps2() and synaptics_init_ps2() when the PS/2
mode is used.

Reported-by: Thorsten Leemhuis <linux@leemhuis.info>
Tested-by: Thorsten Leemhuis <linux@leemhuis.info>
Signed-off-by: Jeffery Miller <jefferymiller@google.com>
Fixes: bf232e460a ("Input: psmouse-smbus - allow to control psmouse_deactivate")
Link: https://lore.kernel.org/r/20231005002249.554877-1-jefferymiller@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-19 23:08:57 +02:00
..
Kconfig
Makefile
alps.c
alps.h
amimouse.c
appletouch.c
atarimouse.c
bcm5974.c
byd.c
byd.h
cyapa.c
cyapa.h
cyapa_gen3.c
cyapa_gen5.c
cyapa_gen6.c
cypress_ps2.c
cypress_ps2.h
elan_i2c.h
elan_i2c_core.c
elan_i2c_i2c.c
elan_i2c_smbus.c
elantech.c Input: psmouse - fix fast_reconnect function for PS/2 mode 2023-10-19 23:08:57 +02:00
elantech.h
focaltech.c
focaltech.h
gpio_mouse.c
hgpk.c
hgpk.h
inport.c
lifebook.c
lifebook.h
logibm.c
logips2pp.c
logips2pp.h
maplemouse.c
navpoint.c
pc110pad.c
psmouse-base.c
psmouse-smbus.c
psmouse.h
pxa930_trkball.c
rpcmouse.c
sentelic.c
sentelic.h
sermouse.c
synaptics.c Input: psmouse - fix fast_reconnect function for PS/2 mode 2023-10-19 23:08:57 +02:00
synaptics.h
synaptics_i2c.c
synaptics_usb.c
touchkit_ps2.c
touchkit_ps2.h
trackpoint.c
trackpoint.h
vmmouse.c
vmmouse.h
vsxxxaa.c