Staging: speakup: Move pasting into a work item
authorBen Hutchings <ben@decadent.org.uk>
Sun, 18 May 2014 23:56:22 +0000 (00:56 +0100)
committerJiri Slaby <jslaby@suse.cz>
Fri, 20 Jun 2014 15:34:04 +0000 (17:34 +0200)
commite71e310b30ccd69a206412668a6335a682b4e869
treebe0484a0493bfc0744cef2d34f0f1d64f7bb4058
parent1f405c3d18c969477fa07f0f55cedd71d946e34e
Staging: speakup: Move pasting into a work item

commit d7500135802ca55b3f4e01a16544e8b34082f8c3 upstream.

Input is handled in softirq context, but when pasting we may
need to sleep.  speakup_paste_selection() currently tries to
bodge this by busy-waiting if in_atomic(), but that doesn't
help because the ldisc may also sleep.

For bonus breakage, speakup_paste_selection() changes the
state of current, even though it's not running in process
context.

Move it into a work item and make sure to cancel it on exit.

References: https://bugs.debian.org/735202
References: https://bugs.debian.org/744015
Reported-by: Paul Gevers <elbrus@debian.org>
Reported-and-tested-by: Jarek Czekalski <jarekczek@poczta.onet.pl>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/staging/speakup/main.c
drivers/staging/speakup/selection.c
drivers/staging/speakup/speakup.h