]> git.baikalelectronics.ru Git - kernel.git/commit
Input: serio - clear pending rescans after sysfs driver rebind
authorDuncan Laurie <dlaurie@chromium.org>
Thu, 3 Feb 2011 06:59:54 +0000 (22:59 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 3 Feb 2011 07:01:52 +0000 (23:01 -0800)
commit4b112a08d4805fdbfe6c83d4239e25bd50890c1b
tree52d18b06701f95602b71f3677064f1f77bf1d9b3
parentb69c6c24360d056b5c457c2f45ceaf651b7fe1aa
Input: serio - clear pending rescans after sysfs driver rebind

When rebinding a serio driver via sysfs drvctl interface it is
possible for an interrupt to trigger after the disconnect of the
existing driver and before the binding of the new driver.  This will
cause the serio interrupt handler to queue a rescan event which will
disconnect the new driver immediately after it is attached.

This change removes pending rescans from the serio event queue after
processing the drvctl request but before releasing the serio mutex.

Reproduction involves issuing a rebind of device port from psmouse
driver to serio_raw driver while generating input to trigger
interrupts.  Then checking to see if the corresponding
i8042/serio4/driver is correctly attached to the serio_raw driver
instead of psmouse.

Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/serio/serio.c