Skip to contentSkip to conversation

Revert "tty: Fix pty master poll() after slave closes v2"

PATCH Applied Peter Hurley 3 participants 7 messages Dec 30, 2014 – Jan 28, 2015 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "tty: Fix pty master poll() after slave closes v2"

This reverts commit c4dc304677e8d566572c4738d95c48be150c6606. This fix is superseded by commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73, 'pty, n_tty: Simplify input processing on final close'.

The final close now waits for input processing to complete before destroying the pty, so poll() does not need to special case this condition.

Cc Francesco Ruggeri <[email protected]>
---
 drivers/tty/n_tty.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/tty/n_tty.c +2 -7
index a618b10..d2dc10f 100644
@@ -2399,17 +2399,12 @@ static unsigned int n_tty_poll(struct tty_struct *tty, struct file *file,
 
 	poll_wait(file, &tty->read_wait, wait);
 	poll_wait(file, &tty->write_wait, wait);
-	if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
-		mask |= POLLHUP;
 	if (input_available_p(tty, 1))
 		mask |= POLLIN | POLLRDNORM;
-	else if (mask & POLLHUP) {
-		tty_flush_to_ldisc(tty);
-		if (input_available_p(tty, 1))
-			mask |= POLLIN | POLLRDNORM;
-	}
 	if (tty->packet && tty->link->ctrl_status)
 		mask |= POLLPRI | POLLIN | POLLRDNORM;
+	if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
+		mask |= POLLHUP;
 	if (tty_hung_up_p(file))
 		mask |= POLLHUP;
 	if (!(mask & (POLLHUP | POLLIN | POLLRDNORM))) {
Signature · 1 line
2.2.1
#1 lore raw
Quoted 7 lines · Peter Hurley

This reverts commit c4dc304677e8d566572c4738d95c48be150c6606. This fix is superseded by commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73, 'pty, n_tty: Simplify input processing on final close'.

The final close now waits for input processing to complete before destroying the pty, so poll() does not need to special case this condition.

Greg,

As noted in this commit log, commit c4dc304677e8d566572c4738d95c48be150c6606, 'tty: Fix pty master poll() after slave closes v2', is not required after commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73,
'pty, n_tty: Simplify input processing on final close'

However, 'tty: Fix pty master poll() after slave closes v2' is appropriate for stable back to v3.12.

Regards,
Peter Hurley

#2 lore raw
Quoted 11 lines · Peter Hurley
Quoted 7 lines · Peter Hurley

This reverts commit c4dc304677e8d566572c4738d95c48be150c6606. This fix is superseded by commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73, 'pty, n_tty: Simplify input processing on final close'.

The final close now waits for input processing to complete before destroying the pty, so poll() does not need to special case this condition.

Greg,

Quoted 7 lines

As noted in this commit log, commit c4dc304677e8d566572c4738d95c48be150c6606, 'tty: Fix pty master poll() after slave closes v2', is not required after commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73,
'pty, n_tty: Simplify input processing on final close'

However, 'tty: Fix pty master poll() after slave closes v2' is appropriate for stable back to v3.12.

Now applied to 3.12. A backport was needed due to the later change of the input_available_p 2nd parameter.

thanks,

Signature · 2 lines
js
suse labs
#3 lore raw
Quoted 17 lines · Jiri Slaby
Quoted 16 lines · Peter Hurley
Quoted 7 lines · Peter Hurley

This reverts commit c4dc304677e8d566572c4738d95c48be150c6606. This fix is superseded by commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73, 'pty, n_tty: Simplify input processing on final close'.

The final close now waits for input processing to complete before destroying the pty, so poll() does not need to special case this condition.

Greg,

As noted in this commit log, commit c4dc304677e8d566572c4738d95c48be150c6606, 'tty: Fix pty master poll() after slave closes v2', is not required after commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73,
'pty, n_tty: Simplify input processing on final close'

Quoted 5 lines
Quoted 2 lines

However, 'tty: Fix pty master poll() after slave closes v2' is appropriate for stable back to v3.12.

Now applied to 3.12. A backport was needed due to the later change of the input_available_p 2nd parameter.

Thanks Jiri.

#4 lore raw
In reply to Peter Hurley
Quoted 11 lines · Peter Hurley
Quoted 7 lines · Peter Hurley

This reverts commit c4dc304677e8d566572c4738d95c48be150c6606. This fix is superseded by commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73, 'pty, n_tty: Simplify input processing on final close'.

The final close now waits for input processing to complete before destroying the pty, so poll() does not need to special case this condition.

Greg,

Quoted 7 lines

As noted in this commit log, commit c4dc304677e8d566572c4738d95c48be150c6606, 'tty: Fix pty master poll() after slave closes v2', is not required after commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73,
'pty, n_tty: Simplify input processing on final close'

However, 'tty: Fix pty master poll() after slave closes v2' is appropriate for stable back to v3.12.

I don't understand, what needs to go to a stable tree and what doesn't?

confused,

greg k-h

#5 lore raw
Quoted 17 lines · Greg Kroah-Hartman
Quoted 16 lines · Peter Hurley
Quoted 7 lines · Peter Hurley

This reverts commit c4dc304677e8d566572c4738d95c48be150c6606. This fix is superseded by commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73, 'pty, n_tty: Simplify input processing on final close'.

The final close now waits for input processing to complete before destroying the pty, so poll() does not need to special case this condition.

Greg,

As noted in this commit log, commit c4dc304677e8d566572c4738d95c48be150c6606, 'tty: Fix pty master poll() after slave closes v2', is not required after commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73,
'pty, n_tty: Simplify input processing on final close'

Quoted 4 lines
Quoted 2 lines

However, 'tty: Fix pty master poll() after slave closes v2' is appropriate for stable back to v3.12.

I don't understand, what needs to go to a stable tree and what doesn't?

Commit c4dc304677e8d5665 ("tty: Fix pty master poll() after slave closes v2") goes to stable v3.12~v3.18, but not 3.19-rc1+

Regards,
Peter Hurley

maintainer Applied
#6 lore raw
Quoted 18 lines · Peter Hurley
Quoted 17 lines · Greg Kroah-Hartman
Quoted 16 lines · Peter Hurley
Quoted 7 lines · Peter Hurley

This reverts commit c4dc304677e8d566572c4738d95c48be150c6606. This fix is superseded by commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73, 'pty, n_tty: Simplify input processing on final close'.

The final close now waits for input processing to complete before destroying the pty, so poll() does not need to special case this condition.

Greg,

As noted in this commit log, commit c4dc304677e8d566572c4738d95c48be150c6606, 'tty: Fix pty master poll() after slave closes v2', is not required after commit 52bce7f8d4fc633c9a9d0646eef58ba6ae9a3b73,
'pty, n_tty: Simplify input processing on final close'

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

However, 'tty: Fix pty master poll() after slave closes v2' is appropriate for stable back to v3.12.

I don't understand, what needs to go to a stable tree and what doesn't?

Commit c4dc304677e8d5665 ("tty: Fix pty master poll() after slave closes v2") goes to stable v3.12~v3.18, but not 3.19-rc1+

It can't go into 3.18, as it already is in that kernel release :)

I've queued it up for 3.14 now, thanks.

greg k-h