diff options
author | Benjamin Herrenschmidt <benh@au1.ibm.com> | 2014-06-18 13:42:56 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2014-06-19 15:11:57 +1000 |
commit | db9f777c52e9e61e811a4a5571960e84afc64570 (patch) | |
tree | c3b368ffe33bf6d5122645157292324bb2973d2d | |
parent | 4ee0ae50269a19245f9518e86e109027ccb233b0 (diff) | |
download | powerpc-db9f777c52e9e61e811a4a5571960e84afc64570.tar.gz |
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 schedule_timeout_interruptible() instead,
which may wakeup earlier every now and then but we really don't
care in this case.
Backport of upstream 15a2743193b099f82657ca315dd2e1091be6c1d3
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.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 eb255e807c0662..208e0470e5674d 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c @@ -747,10 +747,17 @@ static int khvcd(void *unused) if (poll_mask == 0) schedule(); else { + unsigned long j_timeout; + if (timeout < MAX_TIMEOUT) timeout += (timeout >> 6) + 1; - msleep_interruptible(timeout); + /* + * We don't use msleep_interruptible otherwise + * "kick" will fail to wake us up + */ + j_timeout = msecs_to_jiffies(timeout) + 1; + schedule_timeout_interruptible(j_timeout); } } __set_current_state(TASK_RUNNING); |