Re: [TTY] overrun notify issue during 5 minutes after booting
moreau francis <[EMAIL PROTECTED]> wrote: > > By the way, is it safe in "n_tty_receive_overrun" to > call > "printk" ? because the former can be called from IT > context... yup. printk() is safe from all contexts except NMI. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [TTY] overrun notify issue during 5 minutes after booting
--- Andrew Morton <[EMAIL PROTECTED]> wrote: > moreau francis <[EMAIL PROTECTED]> wrote: > > How does this look? > It works well though I haven't tested the second correction. But it looks good... By the way, is it safe in "n_tty_receive_overrun" to call "printk" ? because the former can be called from IT context... Francis Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [TTY] overrun notify issue during 5 minutes after booting
moreau francis <[EMAIL PROTECTED]> 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.0 -0800 +++ 25-akpm/drivers/char/tty_io.c 2005-03-14 01:46:02.0 -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(>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-fix2005-03-14 01:49:25.0 -0800 +++ 25-akpm/drivers/char/n_tty.c2005-03-14 01:50:10.0 -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; } _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[TTY] overrun notify issue during 5 minutes after booting
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 Thanks Francis Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[TTY] overrun notify issue during 5 minutes after booting
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 Thanks Francis Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/ - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [TTY] overrun notify issue during 5 minutes after booting
moreau francis [EMAIL PROTECTED] 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.0 -0800 +++ 25-akpm/drivers/char/tty_io.c 2005-03-14 01:46:02.0 -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-fix2005-03-14 01:49:25.0 -0800 +++ 25-akpm/drivers/char/n_tty.c2005-03-14 01:50:10.0 -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; } _ - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [TTY] overrun notify issue during 5 minutes after booting
--- Andrew Morton [EMAIL PROTECTED] wrote: moreau francis [EMAIL PROTECTED] wrote: How does this look? It works well though I haven't tested the second correction. But it looks good... By the way, is it safe in n_tty_receive_overrun to call printk ? because the former can be called from IT context... Francis Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/ - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [TTY] overrun notify issue during 5 minutes after booting
moreau francis [EMAIL PROTECTED] wrote: By the way, is it safe in n_tty_receive_overrun to call printk ? because the former can be called from IT context... yup. printk() is safe from all contexts except NMI. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/