Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9f0c381 authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

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: default avatarDmitry Torokhov <dtor@mail.ru>
parent f6bdc230
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1141,7 +1141,14 @@ static void psmouse_cleanup(struct serio *serio)
		psmouse_deactivate(parent);
	}

	psmouse_deactivate(psmouse);
	psmouse_set_state(psmouse, PSMOUSE_INITIALIZING);

	/*
	 * Disable stream mode so cleanup routine can proceed undisturbed.
	 */
	if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_DISABLE))
		printk(KERN_WARNING "psmouse.c: Failed to disable mouse on %s\n",
			psmouse->ps2dev.serio->phys);

	if (psmouse->cleanup)
		psmouse->cleanup(psmouse);