From: David Ahern <dsahern@gmail.com>
To: Peter Hurley <peter@hurleysoftware.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Stephane Eranian <eranian@google.com>,
Peter Zijlstra <peterz@infradead.org>,
"mingo@elte.hu" <mingo@elte.hu>, Jiri Olsa <jolsa@redhat.com>,
Eric Dumazet <edumazet@google.com>,
linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] n_tty: Fix poll() when TIME_CHAR and MIN_CHAR == 0
Date: Tue, 11 Feb 2014 11:31:01 -0700 [thread overview]
Message-ID: <52FA6C65.3080901@gmail.com> (raw)
In-Reply-To: <1392137400-4205-1-git-send-email-peter@hurleysoftware.com>
On 2/11/14, 9:49 AM, Peter Hurley wrote:
> From: Peter Hurley <peter@hurleysoftware.com>
> Date: Tue, 11 Feb 2014 10:10:07 -0500
> Subject: [PATCH] n_tty: Fix poll() when TIME_CHAR and MIN_CHAR == 0
>
> Commit eafbe67f84761d787802e5113d895a316b6292fe,
> n_tty: Refactor input_available_p() by call site
> broke poll() when TIME_CHAR(tty) and MIN_CHAR(tty) are both 0.
>
> When TIME_CHAR and MIN_CHAR are both 0, input is available if the
> read_cnt is 1 (not 0).
>
> Reported-by: Stephane Eranian <eranian@google.com>
> Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
> ---
> drivers/tty/n_tty.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
> index cb8017a..2747a3b 100644
> --- a/drivers/tty/n_tty.c
> +++ b/drivers/tty/n_tty.c
> @@ -1896,7 +1896,7 @@ err:
> static inline int input_available_p(struct tty_struct *tty, int poll)
> {
> struct n_tty_data *ldata = tty->disc_data;
> - int amt = poll && !TIME_CHAR(tty) ? MIN_CHAR(tty) : 1;
> + int amt = poll && !TIME_CHAR(tty) && MIN_CHAR(tty) ? MIN_CHAR(tty) : 1;
>
> if (ldata->icanon && !L_EXTPROC(tty)) {
> if (ldata->canon_head != ldata->read_tail)
>
Worked for me.
Tested-by: David Ahern <dsahern@gmail.com>
next prev parent reply other threads:[~2014-02-11 18:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-05 21:25 [BUG] perf top: --stdio causes continuous refresh Stephane Eranian
2014-02-05 23:12 ` Stephane Eranian
2014-02-06 13:56 ` Arnaldo Carvalho de Melo
2014-02-06 13:58 ` Stephane Eranian
2014-02-06 14:07 ` Arnaldo Carvalho de Melo
2014-02-06 14:09 ` Arnaldo Carvalho de Melo
2014-02-06 15:24 ` Stephane Eranian
2014-02-06 17:48 ` David Ahern
2014-02-06 19:21 ` Arnaldo Carvalho de Melo
2014-02-06 19:28 ` Arnaldo Carvalho de Melo
2014-02-06 20:21 ` Stephane Eranian
2014-02-10 21:03 ` Arnaldo Carvalho de Melo
2014-02-11 2:15 ` Peter Hurley
2014-02-11 12:14 ` Arnaldo Carvalho de Melo
2014-02-11 12:18 ` Peter Hurley
2014-02-11 16:49 ` [PATCH] n_tty: Fix poll() when TIME_CHAR and MIN_CHAR == 0 Peter Hurley
2014-02-11 18:31 ` David Ahern [this message]
2014-02-11 18:32 ` Eric Dumazet
2014-02-11 20:50 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52FA6C65.3080901@gmail.com \
--to=dsahern@gmail.com \
--cc=acme@redhat.com \
--cc=edumazet@google.com \
--cc=eranian@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peter@hurleysoftware.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox