mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-25 12:04:46 +08:00
e8b95728f7
Normally, when input device supporting force feedback effects is being destroyed, we try to "flush" currently playing effects, so that the physical device does not continue vibrating (or executing other effects). Unfortunately this does not work well for uinput as flushing of the effects deadlocks with the destroy action: - if device is being destroyed because the file descriptor is being closed, then there is noone to even service FF requests; - if device is being destroyed because userspace sent UI_DEV_DESTROY, while theoretically it could be possible to service FF requests, userspace is unlikely to do so (they'd need to make sure FF handling happens on a separate thread) even if kernel solves the issue with FF ioctls deadlocking with UI_DEV_DESTROY ioctl on udev->mutex. To avoid lockups like the one below, let's install a custom input device flush handler, and avoid trying to flush force feedback effects when we destroying the device, and instead rely on uinput to shut off the device properly. NMI watchdog: Watchdog detected hard LOCKUP on cpu 3 ... <<EOE>> [<ffffffff817a0307>] _raw_spin_lock_irqsave+0x37/0x40 [<ffffffff810e633d>] complete+0x1d/0x50 [<ffffffffa00ba08c>] uinput_request_done+0x3c/0x40 [uinput] [<ffffffffa00ba587>] uinput_request_submit.part.7+0x47/0xb0 [uinput] [<ffffffffa00bb62b>] uinput_dev_erase_effect+0x5b/0x76 [uinput] [<ffffffff815d91ad>] erase_effect+0xad/0xf0 [<ffffffff815d929d>] flush_effects+0x4d/0x90 [<ffffffff815d4cc0>] input_flush_device+0x40/0x60 [<ffffffff815daf1c>] evdev_cleanup+0xac/0xc0 [<ffffffff815daf5b>] evdev_disconnect+0x2b/0x60 [<ffffffff815d74ac>] __input_unregister_device+0xac/0x150 [<ffffffff815d75f7>] input_unregister_device+0x47/0x70 [<ffffffffa00bac45>] uinput_destroy_device+0xb5/0xc0 [uinput] [<ffffffffa00bb2de>] uinput_ioctl_handler.isra.9+0x65e/0x740 [uinput] [<ffffffff811231ab>] ? do_futex+0x12b/0xad0 [<ffffffffa00bb3f8>] uinput_ioctl+0x18/0x20 [uinput] [<ffffffff81241248>] do_vfs_ioctl+0x298/0x480 [<ffffffff81337553>] ? security_file_ioctl+0x43/0x60 [<ffffffff812414a9>] SyS_ioctl+0x79/0x90 [<ffffffff817a04ee>] entry_SYSCALL_64_fastpath+0x12/0x71 Reported-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com> Reported-by: Clément VUCHENER <clement.vuchener@gmail.com> Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=193741 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> |
||
---|---|---|
.. | ||
88pm80x_onkey.c | ||
88pm860x_onkey.c | ||
ab8500-ponkey.c | ||
ad714x-i2c.c | ||
ad714x-spi.c | ||
ad714x.c | ||
ad714x.h | ||
adxl34x-i2c.c | ||
adxl34x-spi.c | ||
adxl34x.c | ||
adxl34x.h | ||
apanel.c | ||
arizona-haptics.c | ||
ati_remote2.c | ||
atlas_btns.c | ||
atmel_captouch.c | ||
axp20x-pek.c | ||
bfin_rotary.c | ||
bma150.c | ||
cm109.c | ||
cma3000_d0x_i2c.c | ||
cma3000_d0x.c | ||
cma3000_d0x.h | ||
cobalt_btns.c | ||
cpcap-pwrbutton.c | ||
da9052_onkey.c | ||
da9055_onkey.c | ||
da9063_onkey.c | ||
dm355evm_keys.c | ||
drv260x.c | ||
drv2665.c | ||
drv2667.c | ||
e3x0-button.c | ||
gp2ap002a00f.c | ||
gpio_decoder.c | ||
gpio_tilt_polled.c | ||
gpio-beeper.c | ||
hisi_powerkey.c | ||
hp_sdc_rtc.c | ||
ideapad_slidebar.c | ||
ims-pcu.c | ||
ixp4xx-beeper.c | ||
Kconfig | ||
keyspan_remote.c | ||
kxtj9.c | ||
m68kspkr.c | ||
Makefile | ||
max8925_onkey.c | ||
max8997_haptic.c | ||
max77693-haptic.c | ||
mc13783-pwrbutton.c | ||
mma8450.c | ||
palmas-pwrbutton.c | ||
pcap_keys.c | ||
pcf8574_keypad.c | ||
pcf50633-input.c | ||
pcspkr.c | ||
pm8xxx-vibrator.c | ||
pm8941-pwrkey.c | ||
pmic8xxx-pwrkey.c | ||
powermate.c | ||
pwm-beeper.c | ||
pwm-vibra.c | ||
rb532_button.c | ||
regulator-haptic.c | ||
retu-pwrbutton.c | ||
rk805-pwrkey.c | ||
rotary_encoder.c | ||
sgi_btns.c | ||
sirfsoc-onkey.c | ||
soc_button_array.c | ||
sparcspkr.c | ||
tps65218-pwrbutton.c | ||
twl4030-pwrbutton.c | ||
twl4030-vibra.c | ||
twl6040-vibra.c | ||
uinput.c | ||
wistron_btns.c | ||
wm831x-on.c | ||
xen-kbdfront.c | ||
yealink.c | ||
yealink.h |