mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: moreau francis <francis_moreau2000@yahoo.fr>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [TTY] overrun notify issue during 5 minutes after booting
Date: Mon, 14 Mar 2005 01:51:41 -0800	[thread overview]
Message-ID: <20050314015141.26d42c1a.akpm@osdl.org> (raw)
In-Reply-To: <20050314093145.56419.qmail@web25109.mail.ukl.yahoo.com>

moreau francis <francis_moreau2000@yahoo.fr> wrote:
>
> I noticed that TTY is not able to notify overrun issue
>  in "n_tty_receive_overrun". Actually it's because of
>  "time_before" macro which tests "tty->overrun_time" 
>  (equals to 0) against "jiffies - HZ" (something very
>  big
>  after booting).
>  I guess a simple way to solve it, is to initialize
>  "tty->overrun_time" to "jiffies". But it won't work if
>  an overrun appear after a very long while....

How does this look?


--- 25/drivers/char/tty_io.c~tty-overrun-time-fix	2005-03-14 01:45:43.000000000 -0800
+++ 25-akpm/drivers/char/tty_io.c	2005-03-14 01:46:02.000000000 -0800
@@ -2632,6 +2632,7 @@ static void initialize_tty_struct(struct
 	tty->magic = TTY_MAGIC;
 	tty_ldisc_assign(tty, tty_ldisc_get(N_TTY));
 	tty->pgrp = -1;
+	tty->overrun_time = jiffies;
 	tty->flip.char_buf_ptr = tty->flip.char_buf;
 	tty->flip.flag_buf_ptr = tty->flip.flag_buf;
 	INIT_WORK(&tty->flip.work, flush_to_ldisc, tty);
diff -puN drivers/char/n_tty.c~tty-overrun-time-fix drivers/char/n_tty.c
--- 25/drivers/char/n_tty.c~tty-overrun-time-fix	2005-03-14 01:49:25.000000000 -0800
+++ 25-akpm/drivers/char/n_tty.c	2005-03-14 01:50:10.000000000 -0800
@@ -606,9 +606,11 @@ static inline void n_tty_receive_overrun
 	char buf[64];
 
 	tty->num_overrun++;
-	if (time_before(tty->overrun_time, jiffies - HZ)) {
-		printk(KERN_WARNING "%s: %d input overrun(s)\n", tty_name(tty, buf),
-		       tty->num_overrun);
+	if (time_before(tty->overrun_time, jiffies - HZ) ||
+			time_after(tty->overrun_time, jiffies)) {
+		printk(KERN_WARNING "%s: %d input overrun(s)\n",
+			tty_name(tty, buf),
+			tty->num_overrun);
 		tty->overrun_time = jiffies;
 		tty->num_overrun = 0;
 	}
_


  reply	other threads:[~2005-03-14  9:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-14  9:31 moreau francis
2005-03-14  9:51 ` Andrew Morton [this message]
2005-03-14 14:17 moreau francis
2005-03-15  5:14 ` Andrew Morton

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=20050314015141.26d42c1a.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=francis_moreau2000@yahoo.fr \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®