diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-02-07 23:10:04 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-02-07 23:53:41 -0800 |
commit | a9f0c381973097462d9688dc26fe66f4f020502e (patch) | |
tree | 07fcd17f872f6d57eadc9de61cff7af5255e9898 /drivers/input | |
parent | f6bdc2303da6786cc22a7d24b6790e9f75b4cfdc (diff) |
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>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 9774bdfaa482..d8c0c8d6992c 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -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); |