linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 8xx_io/uart.c
@ 2003-02-07 13:36 Joakim Tjernlund
  2003-02-07 16:08 ` Dan Malek
  0 siblings, 1 reply; 27+ messages in thread
From: Joakim Tjernlund @ 2003-02-07 13:36 UTC (permalink / raw)
  To: Linuxppc-Embedded@Lists. Linuxppc. Org


Hi

Found a bug in the serial driver. my_console_write() uses the wrong address in early console writes.
Removed some warnings as well.

Please can you change TX_NUM_FIFO to 8 and TX_BUF_SIZE to 96,
since chars are lost when pasting text into the console otherwise.

   Jocke

Index: arch/ppc/8xx_io/uart.c
===================================================================
RCS file: /home/cvsadmin/cvsroot/kernel/linuxppc/arch/ppc/8xx_io/uart.c,v
retrieving revision 1.3
diff -u -r1.3 uart.c
--- arch/ppc/8xx_io/uart.c	21 Nov 2002 15:16:27 -0000	1.3
+++ arch/ppc/8xx_io/uart.c	7 Feb 2003 13:23:23 -0000
@@ -2309,7 +2309,10 @@
 		/* if a LF, also do CR... */
 		if (*s == 10) {
 			while (bdp->cbd_sc & BD_SC_READY);
-			cp = info->tx_va_base + ((bdp - info->tx_bd_base) * TX_BUF_SIZE);
+			if ((uint)(bdp->cbd_bufaddr) > (uint)IMAP_ADDR)
+				cp = (u_char *)(bdp->cbd_bufaddr);
+			else
+				cp = info->tx_va_base + ((bdp - info->tx_bd_base) * TX_BUF_SIZE);
 			*cp = 13;
 			bdp->cbd_datlen = 1;
 			bdp->cbd_sc |= BD_SC_READY;
@@ -3000,10 +3003,10 @@
 	bdp->cbd_bufaddr = iopa(mem_addr);
 	(bdp+1)->cbd_bufaddr = iopa(mem_addr+4);

-	consinfo.rx_va_base = mem_addr;
-	consinfo.rx_bd_base = bdp;
-	consinfo.tx_va_base = mem_addr + 4;
-	consinfo.tx_bd_base = bdp+1;
+	consinfo.rx_va_base = (unsigned char *)mem_addr;
+	consinfo.rx_bd_base = (cbd_t *)bdp;
+	consinfo.tx_va_base = (unsigned char *)(mem_addr + 4);
+	consinfo.tx_bd_base = (cbd_t *)(bdp+1);

 	/* For the receive, set empty and wrap.
 	 * For transmit, set wrap.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread
* RE: [PATCH] 8xx_io/uart.c
@ 2003-02-07 16:54 Ruhland, Paul
  2003-02-07 18:43 ` Joakim Tjernlund
  2003-02-10 14:45 ` Joakim Tjernlund
  0 siblings, 2 replies; 27+ messages in thread
From: Ruhland, Paul @ 2003-02-07 16:54 UTC (permalink / raw)
  To: 'linuxppc-embedded@lists.linuxppc.org'


The pasting into the console bug is actually caused in
'drivers/char/n_tty.c' (standard tty line discipline) by not handling a
failed call to 'opost(...)' (if returns -1 if tx buffer is full and char
must be retried) in 'echo_char()'.  The pasted data is received fine....just
the echo fails.

>From 'drivers/char/n_tty.c':
================================================
/* Must be called only when L_ECHO(tty) is true. */

static void echo_char(unsigned char c, struct tty_struct *tty)
{
	if (L_ECHOCTL(tty) && iscntrl(c) && c != '\t') {
		put_char('^', tty);
		put_char(c ^ 0100, tty);
		tty->column += 2;
	} else
		opost(c, tty);
}
===============================================



-----Original Message-----
From: Dan Malek [mailto:dan@embeddededge.com]
Sent: Friday, February 07, 2003 11:09 AM
To: joakim.tjernlund@lumentis.se
Cc: Linuxppc-Embedded@Lists. Linuxppc. Org
Subject: Re: [PATCH] 8xx_io/uart.c



Joakim Tjernlund wrote:

> Found a bug in the serial driver. my_console_write() uses the wrong
address in early console writes.
> Removed some warnings as well.

Well......console write doesn't get called this early.  The purpose
of these address modifications in other parts of the driver are for
kgdb using the serial port for early debugging.

I'd really like some supporting documentation (like a kernel panic
or other reproducable error) before you declare something a "bug",
along with showing the same test fixed the problem.

> Please can you change TX_NUM_FIFO to 8 and TX_BUF_SIZE to 96,
> since chars are lost when pasting text into the console otherwise.

What makes 96 a big enough number?  If you want to do this locally,
that's fine, but only flow control can guarantee you won't overflow
a serial port of any fifo depth.  I don't want to arbitrarily make
this fifo so large as there are other processing/latency/memory
tradeoffs.  The SMC is not a high performance interface and it
consumes lots of CPM cycles.

Thanks.


	-- Dan


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread
[parent not found: <dan@embeddededge.com>]

end of thread, other threads:[~2003-02-19  8:43 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-07 13:36 [PATCH] 8xx_io/uart.c Joakim Tjernlund
2003-02-07 16:08 ` Dan Malek
2003-02-07 17:21   ` Joakim Tjernlund
2003-02-09 20:52     ` Dan Malek
2003-02-10  0:29       ` Joakim Tjernlund
2003-02-10  1:08       ` Murray Jensen
2003-02-10 18:52         ` Dan Malek
2003-02-11  1:13           ` Murray Jensen
2003-02-11 16:40             ` Dan Malek
2003-02-11 23:11               ` Murray Jensen
2003-02-11 23:16               ` Murray Jensen
2003-02-11 18:56             ` Tom Rini
2003-02-11 11:16           ` Joakim Tjernlund
2003-02-11 16:03             ` Dan Malek
2003-02-11 18:07               ` Joakim Tjernlund
2003-02-11 23:54                 ` Paul Mackerras
2003-02-14 15:13                 ` Joakim Tjernlund
2003-02-14 20:12                   ` Dan Malek
2003-02-19  8:43   ` Joakim Tjernlund
  -- strict thread matches above, loose matches on Subject: below --
2003-02-07 16:54 Ruhland, Paul
2003-02-07 18:43 ` Joakim Tjernlund
2003-02-10 14:45 ` Joakim Tjernlund
2003-02-10 17:25   ` Tom Rini
2003-02-11  8:33     ` Joakim Tjernlund
     [not found] <dan@embeddededge.com>
     [not found] ` <3C98DA15.50302@embeddededge.com>
2002-03-21  1:11   ` EV-64260-BP & GT64260 bi_recs Murray Jensen
2002-03-21  6:50     ` Dan Malek
2002-03-21 11:05       ` Murray Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).