linux-mips
[Top] [All Lists]

Re: [PATCH] Fix character loss in drivers/tc/zs.c

To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Subject: Re: [PATCH] Fix character loss in drivers/tc/zs.c
From: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
Date: Tue, 23 Sep 2003 14:14:10 +0200
Cc: linux-mips@linux-mips.org
In-reply-to: <Pine.GSO.3.96.1030923132357.22133B-100000@delta.ds2.pg.gda.pl>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20030923084005.GU13578@rembrandt.csv.ica.uni-stuttgart.de> <Pine.GSO.3.96.1030923132357.22133B-100000@delta.ds2.pg.gda.pl>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.4i
Maciej W. Rozycki wrote:
> On Tue, 23 Sep 2003, Thiemo Seufer wrote:
> 
> > >  Can you please elaborate?  tty is expected to be NULL if info->hook is
> > > not, so the code after the change should not differ effectively -- only a
> > > useless check is added at the end.  Am I missing anything?
> > 
> > AFAICS the
> > 
> >         while ((read_zsreg(info->zs_channel, R0) & Rx_CH_AV) != 0) {
> > 
> > loops over the FIFO contents and 'return' discards the remaining
> > part. The patch made a visible difference for me with some noisy
> > debug printk()'s in the kernel.
> 
>  Hmm, a coincidence?  Without your patch the execution goes as follows:

Well, the code suggests so. But thinking about it again, it should
probably read (untested):


--- linux-orig/drivers/tc/zs.c  Tue Aug 12 04:11:58 2003
+++ linux/drivers/tc/zs.c       Tue Sep 23 14:09:34 2003
@@ -456,7 +456,7 @@ static _INLINE_ void receive_chars(struc
 
                if (info->hook && info->hook->rx_char) {
                        (*info->hook->rx_char)(ch, flag);
-                       return;
+                       continue;
                }
 
                if (tty->flip.count >= TTY_FLIPBUF_SIZE) {

[snip]
> and tty is NULL.  And I fail to see how it can it make any difference for
> printk() output -- the code in question is only ever executed for input
> from an LK201-type keyboard.

I found this on Karsten's 5000/150. We can try it out again soon. :-)


Thiemo

<Prev in Thread] Current Thread [Next in Thread>