summaryrefslogtreecommitdiff
path: root/lib/locking-selftest-rlock-softirq.h
diff options
context:
space:
mode:
authorOkash Khawaja <okash.khawaja@gmail.com>2017-09-05 12:51:59 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-09-18 12:25:31 +0200
commite5f5d0e20b6cecc0ebe6fc8e7df6f8823ad2d594 (patch)
tree807859644cdcbfbdd37853c8e5ec1da741dbd673 /lib/locking-selftest-rlock-softirq.h
parentb72703e26b9478da531144ce5c4552dd22f1103d (diff)
staging: speakup: fix speakup-r empty line lockup
When cursor is at beginning of an empty or whitespace-only line and speakup-r typed, kernel locks up. This happens because deadlock of in input_event function over dev->event_lock, as demonstrated by lockdep logs. The reason for that is speakup simulates a down arrow - because cursor is at an empty line - while inside key press notifier handler which is ultimately triggered from input_event function. The simulated key press leads to input_event being called again, this time under its own context. So the spinlock is dev->event_lock is acquired while still being held. This patch ensures that key press is not simulated from inside key press notifier handler. Instead it delegates to cursor_timer. It starts the timer and passes RA_DOWN_ARROW as argument. When timer handler runs and sees RA_DOWN_ARROW, it will then call kbd_fakekey2(RA_DOWN_ARROW) which will correctly simulate the keypress inside timer context. When not inside key press notifier callback, the behaviour will remain the same as before this patch. Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/locking-selftest-rlock-softirq.h')
0 files changed, 0 insertions, 0 deletions