diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-05-23 05:41:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-28 16:33:18 -0400 |
commit | 15a2743193b099f82657ca315dd2e1091be6c1d3 (patch) | |
tree | 3f60a997cf6f16460ff200e351fa3ae223a680ed | |
parent | 8e25f8ce0e3227f20090f1b89b908d8146304413 (diff) |
tty/hvc/hvc_console: Fix wakeup of HVC thread on hvc_kick()
Some backends call hvc_kick() to wakeup the HVC thread from its
slumber upon incoming characters. This however doesn't work
properly because it uses msleep_interruptible() which is mostly
immune to wake_up_process(). It will basically go back to sleep
until the timeout is expired (only signals can really wake it).
Replace it with a simple shedule_timeout_interruptible() instead,
which may wakeup earlier every now and then but we really don't
care in this case.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/hvc/hvc_console.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index 94f9e3a38412..10942655a79d 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c | |||
@@ -760,10 +760,17 @@ static int khvcd(void *unused) | |||
760 | if (poll_mask == 0) | 760 | if (poll_mask == 0) |
761 | schedule(); | 761 | schedule(); |
762 | else { | 762 | else { |
763 | unsigned long j_timeout; | ||
764 | |||
763 | if (timeout < MAX_TIMEOUT) | 765 | if (timeout < MAX_TIMEOUT) |
764 | timeout += (timeout >> 6) + 1; | 766 | timeout += (timeout >> 6) + 1; |
765 | 767 | ||
766 | msleep_interruptible(timeout); | 768 | /* |
769 | * We don't use msleep_interruptible otherwise | ||
770 | * "kick" will fail to wake us up | ||
771 | */ | ||
772 | j_timeout = msecs_to_jiffies(timeout) + 1; | ||
773 | schedule_timeout_interruptible(j_timeout); | ||
767 | } | 774 | } |
768 | } | 775 | } |
769 | __set_current_state(TASK_RUNNING); | 776 | __set_current_state(TASK_RUNNING); |