linux/drivers/input
Eric W. Biederman 59b015133c Input: serio - fix potential deadlock when unbinding drivers
sysfs_remove_group() waits for sysfs attributes to be removed, therefore
we do not need to worry about driver-specific attributes being accessed
after driver has been detached from the device. In fact, attempts to take
serio->drv_mutex in attribute methods may lead to the following deadlock:

                                          sysfs_read_file()
                                            fill_read_buffer()
                                              sysfs_get_active_two()
                                                psmouse_attr_show_helper()
                                                  serio_pin_driver()
serio_disconnect_driver()
  mutex_lock(&serio->drv_mutex);
                                <-------->        mutex_lock(&serio_drv_mutex);
    psmouse_disconnect()
      sysfs_remove_group(... psmouse_attr_group);
        ....
        sysfs_deactivate();
          wait_for_completion();

Fix this by removing calls to serio_[un]pin_driver() and functions themselves
and using driver-private mutexes to serialize access to attribute's set()
methods that may change device state.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-01-06 00:14:32 -08:00
..
gameport Input: serio - do not use deprecated dev.power.power_state 2009-05-09 16:10:18 -07:00
joystick Input: gf2k - fix &&/|| confusion in gf2k_connect() 2010-01-01 18:45:52 -08:00
keyboard Input: serio - fix potential deadlock when unbinding drivers 2010-01-06 00:14:32 -08:00
misc Input: twl4030-pwrbutton - switch to using threaded IRQ 2009-12-29 23:20:49 -08:00
mouse Input: serio - fix potential deadlock when unbinding drivers 2010-01-06 00:14:32 -08:00
serio Input: serio - do not mark kseriod freezable anymore 2009-12-24 21:43:06 -08:00
tablet Input: wacom - separate pen from express keys on Graphire 2009-12-15 00:36:20 -08:00
touchscreen Input: add mc13783 touchscreen driver 2009-12-15 08:54:51 -08:00
apm-power.c Input: apm-power - fix crash when unloading modules 2008-03-24 11:02:06 -04:00
evbug.c Input: struct device - replace bus_id with dev_name(), dev_set_name() 2008-10-30 09:29:05 -04:00
evdev.c headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
ff-core.c Input: fix memory leak in force feedback core 2009-12-04 22:16:38 -08:00
ff-memless.c Input: ff-memless - add notion of direction to for rumble effects 2009-12-24 21:54:29 -08:00
fixp-arith.h changed email 2007-10-20 00:47:32 +02:00
input-compat.c Input: refactor evdev 32bit compat to be shareable with uinput 2008-10-27 22:03:42 -04:00
input-compat.h Input: refactor evdev 32bit compat to be shareable with uinput 2008-10-27 22:03:42 -04:00
input-polldev.c Input: add generic support for sparse keymaps 2009-12-07 09:26:35 -08:00
input.c Input: document use of input_event() function 2009-12-11 23:48:49 -08:00
joydev.c headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
Kconfig Merge branch 'xen/fbdev' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen 2009-12-10 09:34:40 -08:00
Makefile Input: add generic support for sparse keymaps 2009-12-07 09:26:35 -08:00
mousedev.c headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
sparse-keymap.c Input: add generic support for sparse keymaps 2009-12-07 09:26:35 -08:00
xen-kbdfront.c xen: move Xen-testing predicates to common header 2009-11-04 08:47:24 -08:00