summaryrefslogtreecommitdiff
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-05-02 13:38:40 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-05-02 13:38:40 -0700
commit9da06237e8cbb2f20a35adf23af8c7bb3b245804 (patch)
treef65b0944b4f3fe43070f3a10676fe2062456b007 /drivers/tty/tty_io.c
parent6fa93fc89f5e5641c0ad1be533b016e065cbf04d (diff)
parentee76c85f715377aec3b0115e48b7d66a726ffdea (diff)
Merge "Merge android-4.4.129 (b1c4836) into msm-4.4"
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index a638c1738547..89fd20382ce4 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -702,6 +702,14 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session)
return;
}
+ /*
+ * Some console devices aren't actually hung up for technical and
+ * historical reasons, which can lead to indefinite interruptible
+ * sleep in n_tty_read(). The following explicitly tells
+ * n_tty_read() to abort readers.
+ */
+ set_bit(TTY_HUPPING, &tty->flags);
+
/* inuse_filps is protected by the single tty lock,
this really needs to change if we want to flush the
workqueue with the lock held */
@@ -757,6 +765,7 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session)
* can't yet guarantee all that.
*/
set_bit(TTY_HUPPED, &tty->flags);
+ clear_bit(TTY_HUPPING, &tty->flags);
tty_unlock(tty);
if (f)