All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "tty: Fix pty master poll() after slave closes v2"
@ 2014-12-30 12:17 Peter Hurley
  2014-12-30 12:31 ` Peter Hurley
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Hurley @ 2014-12-30 12:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Francesco Ruggeri,
	Peter Hurley, Francesco Ruggeri

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 <fruggeri@arista.com>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 drivers/tty/n_tty.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index a618b10..d2dc10f 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -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))) {
-- 
2.2.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "tty: Fix pty master poll() after slave closes v2"
  2014-12-30 12:17 [PATCH] Revert "tty: Fix pty master poll() after slave closes v2" Peter Hurley
@ 2014-12-30 12:31 ` Peter Hurley
  2015-01-06 14:33   ` Jiri Slaby
  2015-01-09 21:41   ` Greg Kroah-Hartman
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Hurley @ 2014-12-30 12:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Francesco Ruggeri,
	Francesco Ruggeri

On 12/30/2014 07:17 AM, Peter Hurley wrote:
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "tty: Fix pty master poll() after slave closes v2"
  2014-12-30 12:31 ` Peter Hurley
@ 2015-01-06 14:33   ` Jiri Slaby
  2015-01-06 16:49     ` Peter Hurley
  2015-01-09 21:41   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 7+ messages in thread
From: Jiri Slaby @ 2015-01-06 14:33 UTC (permalink / raw)
  To: Peter Hurley, Greg Kroah-Hartman
  Cc: linux-serial, linux-kernel, Francesco Ruggeri, Francesco Ruggeri

On 12/30/2014, 01:31 PM, Peter Hurley wrote:
> On 12/30/2014 07:17 AM, Peter Hurley wrote:
>> 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.

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

thanks,
-- 
js
suse labs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "tty: Fix pty master poll() after slave closes v2"
  2015-01-06 14:33   ` Jiri Slaby
@ 2015-01-06 16:49     ` Peter Hurley
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Hurley @ 2015-01-06 16:49 UTC (permalink / raw)
  To: Jiri Slaby, Greg Kroah-Hartman
  Cc: linux-serial, linux-kernel, Francesco Ruggeri, Francesco Ruggeri

On 01/06/2015 09:33 AM, Jiri Slaby wrote:
> On 12/30/2014, 01:31 PM, Peter Hurley wrote:
>> On 12/30/2014 07:17 AM, Peter Hurley wrote:
>>> 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.
> 
> Now applied to 3.12. A backport was needed due to the later change of
> the input_available_p 2nd parameter.

Thanks Jiri.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "tty: Fix pty master poll() after slave closes v2"
  2014-12-30 12:31 ` Peter Hurley
  2015-01-06 14:33   ` Jiri Slaby
@ 2015-01-09 21:41   ` Greg Kroah-Hartman
  2015-01-09 22:00     ` Peter Hurley
  1 sibling, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2015-01-09 21:41 UTC (permalink / raw)
  To: Peter Hurley
  Cc: Jiri Slaby, linux-serial, linux-kernel, Francesco Ruggeri,
	Francesco Ruggeri

On Tue, Dec 30, 2014 at 07:31:06AM -0500, Peter Hurley wrote:
> On 12/30/2014 07:17 AM, Peter Hurley wrote:
> > 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.

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

confused,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "tty: Fix pty master poll() after slave closes v2"
  2015-01-09 21:41   ` Greg Kroah-Hartman
@ 2015-01-09 22:00     ` Peter Hurley
  2015-01-28  0:17       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Hurley @ 2015-01-09 22:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, Francesco Ruggeri,
	Francesco Ruggeri

On 01/09/2015 04:41 PM, Greg Kroah-Hartman wrote:
> On Tue, Dec 30, 2014 at 07:31:06AM -0500, Peter Hurley wrote:
>> On 12/30/2014 07:17 AM, Peter Hurley wrote:
>>> 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.
> 
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Revert "tty: Fix pty master poll() after slave closes v2"
  2015-01-09 22:00     ` Peter Hurley
@ 2015-01-28  0:17       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2015-01-28  0:17 UTC (permalink / raw)
  To: Peter Hurley
  Cc: Jiri Slaby, linux-serial, linux-kernel, Francesco Ruggeri,
	Francesco Ruggeri

On Fri, Jan 09, 2015 at 05:00:55PM -0500, Peter Hurley wrote:
> On 01/09/2015 04:41 PM, Greg Kroah-Hartman wrote:
> > On Tue, Dec 30, 2014 at 07:31:06AM -0500, Peter Hurley wrote:
> >> On 12/30/2014 07:17 AM, Peter Hurley wrote:
> >>> 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.
> > 
> > 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-28  0:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-30 12:17 [PATCH] Revert "tty: Fix pty master poll() after slave closes v2" Peter Hurley
2014-12-30 12:31 ` Peter Hurley
2015-01-06 14:33   ` Jiri Slaby
2015-01-06 16:49     ` Peter Hurley
2015-01-09 21:41   ` Greg Kroah-Hartman
2015-01-09 22:00     ` Peter Hurley
2015-01-28  0:17       ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.