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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux