linux/drivers/input/tablet
Dmitry Torokhov f6cd378372 Input: wacom - fix runtime PM related deadlock
When runtime PM is enabled by default for input devices, X hangs in
wacom open:
[<ffffffff814a00ea>] mutex_lock+0x1a/0x40
[<ffffffffa02bc94b>] wacom_resume+0x3b/0x90 [wacom]
[<ffffffff81327a32>] usb_resume_interface+0xd2/0x190
[<ffffffff81327b5d>] usb_resume_both+0x6d/0x110
[<ffffffff81327c24>] usb_runtime_resume+0x24/0x40
[<ffffffff8130a2cf>] __pm_runtime_resume+0x26f/0x450
[<ffffffff8130a23a>] __pm_runtime_resume+0x1da/0x450
[<ffffffff8130a53a>] pm_runtime_resume+0x2a/0x50
[<ffffffff81328176>] usb_autopm_get_interface+0x26/0x60
[<ffffffffa02bc626>] wacom_open+0x36/0x90 [wacom]

wacom_open() takes wacom->lock and calls usb_autopm_get_interface(),
which in turn calls wacom_resume() which tries to acquire the lock
again.

The fix is to call usb_autopm_get_interface() first, before we take
the lock.

Since we do not do usb_autopm_put_interface() until wacom_close()
is called runtime PM is effectively disabled for the driver, however
changing it now would risk regressions so the complete fix will
have to wait till the next merge window.

Reported-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-10-04 22:36:41 -07:00
..
acecad.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2010-05-20 21:26:12 -07:00
aiptek.c Input: switch to input_abs_*() access functions 2010-08-02 20:29:56 -07:00
gtco.c USB: rename usb_buffer_alloc() and usb_buffer_free() users 2010-05-20 13:21:38 -07:00
kbtab.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2010-05-20 21:26:12 -07:00
Kconfig Input: aiptek - add support for Genius G-PEN 560 tablet 2008-04-15 13:13:10 -04:00
Makefile Input: move USB tablets under drivers/input/tablet 2007-05-08 01:41:29 -04:00
wacom_sys.c Input: wacom - fix runtime PM related deadlock 2010-10-04 22:36:41 -07:00
wacom_wac.c Input: wacom - fix mousewheel handling for old wacom tablets 2010-08-28 21:39:04 -07:00
wacom_wac.h Input: wacom - add support for DTU2231 and DTU1631 2010-06-28 01:12:26 -07:00
wacom.h Input: wacom - use get_unaligned to access unaligned data 2010-04-13 23:24:42 -07:00