mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Loosing chars on serial console in 2.4
@ 2003-02-13 14:03 Joakim Tjernlund
  2003-02-13 14:34 ` Russell King
  0 siblings, 1 reply; 2+ messages in thread
From: Joakim Tjernlund @ 2003-02-13 14:03 UTC (permalink / raw)
  To: Linux-Kernel

Hi List.

If I paste text into my serial console, some chars aren't echoed back. I also
loose some chars when doing reboot and init starts to print messages.

This is due to that almost no user of opost() bothers to check its return
value. The patch below fixes the problem, but it is ugly and possibly buggy. 
I don't know how to fix this properly.

HW: custom 860 board at 115200 baud, using the standard arch/ppc/8xx_io/uart.c driver.

 Jocke

--- drivers/char/n_tty.c	1 Nov 2002 13:43:27 -0000	1.1.1.1
+++ drivers/char/n_tty.c	13 Feb 2003 13:45:33 -0000
@@ -186,8 +186,14 @@
 static int opost(unsigned char c, struct tty_struct *tty)
 {
 	int	space, spaces;
+#if 1
+	unsigned long tmo = jiffies + HZ/10;
 
+	while(!(space = tty->driver.write_room(tty)) && !in_interrupt() && !time_after(jiffies, tmo))
+		cond_resched();
+#else
 	space = tty->driver.write_room(tty);
+#endif
 	if (!space)
 		return -1;
 



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

end of thread, other threads:[~2003-02-13 14:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-13 14:03 Loosing chars on serial console in 2.4 Joakim Tjernlund
2003-02-13 14:34 ` Russell King

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®