Input: psmouse - make sure we don't schedule reconnects after cleanup

Set state of the device as "initializing" during and after cleanup
to ensure that unsolicited data from the device is not passed on.
We especially want to avoid processing new device announcements
"0xaa 0x00" that can come up before we perform reconnect operation.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

+8 -1
+8 -1
drivers/input/mouse/psmouse-base.c
··· 1141 1141 psmouse_deactivate(parent); 1142 1142 } 1143 1143 1144 - psmouse_deactivate(psmouse); 1144 + psmouse_set_state(psmouse, PSMOUSE_INITIALIZING); 1145 + 1146 + /* 1147 + * Disable stream mode so cleanup routine can proceed undisturbed. 1148 + */ 1149 + if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_DISABLE)) 1150 + printk(KERN_WARNING "psmouse.c: Failed to disable mouse on %s\n", 1151 + psmouse->ps2dev.serio->phys); 1145 1152 1146 1153 if (psmouse->cleanup) 1147 1154 psmouse->cleanup(psmouse);