linux/drivers/hid
David Herrmann f50f9aabf3 HID: wiimote: fix FF deadlock
The input core has an internal spinlock that is acquired during event
injection via input_event() and friends but also held during FF callbacks.
That means, there is no way to share a lock between event-injection and FF
handling. Unfortunately, this is what is required for wiimote state
tracking and what we do with state.lock and input->lock.

This deadlock can be triggered when using continuous data reporting and FF
on a wiimote device at the same time. I takes me at least 30m of
stress-testing to trigger it but users reported considerably shorter
times (http://bpaste.net/show/132504/) when using some gaming-console
emulators.

The real problem is that we have two copies of internal state, one in the
wiimote objects and the other in the input device. As the input-lock is
not supposed to be accessed from outside of input-core, we have no other
chance than offloading FF handling into a worker. This actually works
pretty nice and also allows to implictly merge fast rumble changes into a
single request.

Due to the 3-layered workers (rumble+queue+l2cap) this might reduce FF
responsiveness. Initial tests were fine so lets fix the race first and if
it turns out to be too slow we can always handle FF out-of-band and skip
the queue-worker.

Cc: <stable@vger.kernel.org> # 3.11+
Reported-by: Thomas Schneider
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-10-07 17:08:26 +02:00
..
i2c-hid Merge branches 'for-3.12/devm', 'for-3.12/i2c-hid', 'for-3.12/i2c-hid-dt', 'for-3.12/logitech', 'for-3.12/multitouch-win8', 'for-3.12/trasnport-driver-cleanup', 'for-3.12/uhid', 'for-3.12/upstream' and 'for-3.12/wiimote' into for-linus 2013-09-06 11:58:37 +02:00
usbhid Merge branches 'for-3.12/devm', 'for-3.12/i2c-hid', 'for-3.12/i2c-hid-dt', 'for-3.12/logitech', 'for-3.12/multitouch-win8', 'for-3.12/trasnport-driver-cleanup', 'for-3.12/uhid', 'for-3.12/upstream' and 'for-3.12/wiimote' into for-linus 2013-09-06 11:58:37 +02:00
hid-a4tech.c HID: trivial devm conversion for special hid drivers 2013-07-31 10:12:28 +02:00
hid-apple.c Merge branches 'for-3.12/devm', 'for-3.12/i2c-hid', 'for-3.12/i2c-hid-dt', 'for-3.12/logitech', 'for-3.12/multitouch-win8', 'for-3.12/trasnport-driver-cleanup', 'for-3.12/uhid', 'for-3.12/upstream' and 'for-3.12/wiimote' into for-linus 2013-09-06 11:58:37 +02:00
hid-appleir.c
hid-aureal.c
hid-axff.c
hid-belkin.c
hid-cherry.c
hid-chicony.c
hid-core.c HID: add Holtek USB ID 04d9:a081 SHARKOON DarkGlider 2013-10-02 17:04:15 +02:00
hid-cypress.c
hid-debug.c
hid-dr.c
hid-elecom.c
hid-elo.c
hid-emsff.c
hid-ezkey.c
hid-gaff.c
hid-generic.c
hid-gyration.c
hid-holtek-kbd.c
hid-holtek-mouse.c HID: add Holtek USB ID 04d9:a081 SHARKOON DarkGlider 2013-10-02 17:04:15 +02:00
hid-holtekff.c HID: hid-holtekff: don't push static constants on stack for %*ph 2013-08-05 11:29:57 +02:00
hid-huion.c
hid-hyperv.c Drivers: hv: remove HV_DRV_VERSION 2013-08-02 11:34:30 +08:00
hid-icade.c
hid-ids.h HID: add Holtek USB ID 04d9:a081 SHARKOON DarkGlider 2013-10-02 17:04:15 +02:00
hid-input.c HID: validate feature and input report details 2013-09-13 15:13:22 +02:00
hid-kensington.c
hid-keytouch.c
hid-kye.c HID: kye: Add report fixup for Genius Gx Imperator Keyboard 2013-07-15 10:25:33 +02:00
hid-lcpower.c
hid-lenovo-tpkbd.c HID: lenovo-tpkbd: fix leak if tpkbd_probe_tp fails 2013-09-13 15:15:11 +02:00
hid-lg2ff.c HID: LG: validate HID output report details 2013-09-13 15:12:39 +02:00
hid-lg3ff.c HID: LG: validate HID output report details 2013-09-13 15:12:39 +02:00
hid-lg4ff.c HID: LG: validate HID output report details 2013-09-13 15:12:39 +02:00
hid-lg.c
hid-lg.h
hid-lgff.c HID: LG: validate HID output report details 2013-09-13 15:12:39 +02:00
hid-logitech-dj.c HID: logitech-dj: validate output report details 2013-09-13 15:13:32 +02:00
hid-logitech-dj.h HID: Revert "Revert "HID: Fix logitech-dj: missing Unifying device issue"" 2013-07-22 16:32:24 +02:00
hid-magicmouse.c Merge branches 'for-3.12/devm', 'for-3.12/i2c-hid', 'for-3.12/i2c-hid-dt', 'for-3.12/logitech', 'for-3.12/multitouch-win8', 'for-3.12/trasnport-driver-cleanup', 'for-3.12/uhid', 'for-3.12/upstream' and 'for-3.12/wiimote' into for-linus 2013-09-06 11:58:37 +02:00
hid-microsoft.c
hid-monterey.c
hid-multitouch.c HID: multitouch: validate indexes details 2013-09-13 15:13:52 +02:00
hid-ntrig.c HID: ntrig: validate feature report details 2013-09-04 12:00:23 +02:00
hid-ortek.c
hid-petalynx.c
hid-picolcd_backlight.c
hid-picolcd_cir.c HID: picolcd: Prevent NULL pointer dereference on _remove() 2013-09-02 13:36:50 +02:00
hid-picolcd_core.c HID: picolcd_core: validate output report details 2013-09-04 12:03:27 +02:00
hid-picolcd_debugfs.c HID: fix data access in implement() 2013-07-22 16:16:40 +02:00
hid-picolcd_fb.c HID: picolcd: Prevent NULL pointer dereference on _remove() 2013-09-02 13:36:50 +02:00
hid-picolcd_lcd.c
hid-picolcd_leds.c
hid-picolcd.h
hid-pl.c HID: pantherlord: validate output report details 2013-09-04 11:58:32 +02:00
hid-primax.c
hid-prodikeys.c
hid-roccat-arvo.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2013-09-06 09:30:36 -07:00
hid-roccat-arvo.h
hid-roccat-common.c
hid-roccat-common.h
hid-roccat-isku.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2013-09-06 09:30:36 -07:00
hid-roccat-isku.h
hid-roccat-kone.c HID: roccat: Fix "cannot create duplicate filename" problems 2013-09-30 10:51:31 +02:00
hid-roccat-kone.h
hid-roccat-koneplus.c HID: roccat: Fix "cannot create duplicate filename" problems 2013-09-30 10:51:31 +02:00
hid-roccat-koneplus.h
hid-roccat-konepure.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2013-09-06 09:30:36 -07:00
hid-roccat-konepure.h
hid-roccat-kovaplus.c HID: roccat: Fix "cannot create duplicate filename" problems 2013-09-30 10:51:31 +02:00
hid-roccat-kovaplus.h
hid-roccat-lua.c
hid-roccat-lua.h
hid-roccat-pyra.c HID: roccat: Fix "cannot create duplicate filename" problems 2013-09-30 10:51:31 +02:00
hid-roccat-pyra.h
hid-roccat-savu.c hid: roccat-savu: convert class code to use bin_attrs in groups 2013-08-19 21:46:53 -07:00
hid-roccat-savu.h
hid-roccat.c HID: roccat: check cdev_add return value 2013-06-18 11:00:36 +02:00
hid-saitek.c
hid-samsung.c
hid-sensor-hub.c Merge branch 'for-3.12/sensor-hub' into for-linus 2013-09-06 11:59:53 +02:00
hid-sjoy.c
hid-sony.c HID: sony: validate HID output report details 2013-09-13 15:12:12 +02:00
hid-speedlink.c HID: Fix Speedlink VAD Cezanne support for some devices 2013-08-26 13:51:10 +02:00
hid-steelseries.c HID: steelseries: validate output report details 2013-09-13 15:12:28 +02:00
hid-sunplus.c
hid-thingm.c
hid-tivo.c
hid-tmff.c
hid-topseed.c
hid-twinhan.c
hid-uclogic.c
hid-wacom.c HID: wacom: Intuos4 battery charging changes 2013-07-04 15:04:47 +02:00
hid-waltop.c
hid-wiimote-core.c Revert "Input: introduce BTN/ABS bits for drums and guitars" 2013-09-07 09:48:41 -07:00
hid-wiimote-debug.c HID: wiimote: fix DRM debug-attr to correctly parse input 2013-06-03 11:07:06 +02:00
hid-wiimote-modules.c HID: wiimote: fix FF deadlock 2013-10-07 17:08:26 +02:00
hid-wiimote.h HID: wiimote: fix FF deadlock 2013-10-07 17:08:26 +02:00
hid-xinmo.c HID: use module_hid_driver() to simplify the code 2013-08-26 13:23:04 +02:00
hid-zpff.c HID: zeroplus: validate output report details 2013-09-13 15:11:34 +02:00
hid-zydacron.c HID: trivial devm conversion for special hid drivers 2013-07-31 10:12:28 +02:00
hidraw.c HID: hidraw: close underlying device at removal of last reader 2013-10-02 17:02:08 +02:00
Kconfig HID: add Holtek USB ID 04d9:a081 SHARKOON DarkGlider 2013-10-02 17:04:15 +02:00
Makefile HID: Add new driver for non-compliant Xin-Mo devices. 2013-07-29 11:49:29 +02:00
uhid.c HID: uhid: allocate static minor 2013-09-26 11:03:29 +02:00