NetBSD-Bugs archive

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

port-arm/45354: no character is put in the read-ahead buffer in a console code of arch/arm/imx/imxuart.c



>Number:         45354
>Category:       port-arm
>Synopsis:       no character is put in the read-ahead buffer in a console code 
>of arch/arm/imx/imxuart.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-arm-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 10 15:30:00 +0000 2011
>Originator:     Yuichiro Goto
>Release:        5.99.55
>Organization:
>Environment:
>Description:
When imxuart_common_putc() is called, the input pointer of the read-ahead 
buffer is advanced, but no character is put in the buffer.
>How-To-Repeat:
See the attached diff.
>Fix:
Index: arch/arm/imx/imxuart.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/imx/imxuart.c,v
retrieving revision 1.8
diff -u -r1.8 imxuart.c
--- arch/arm/imx/imxuart.c      24 Apr 2011 16:26:54 -0000      1.8
+++ arch/arm/imx/imxuart.c      10 Sep 2011 14:59:54 -0000
@@ -2198,7 +2198,7 @@
        uint32_t usr2;
 
        /* got a character from reading things earlier */
-       if (imxuart_readahead_in != imxuart_readahead_out) {
+       if (!READAHEAD_IS_EMPTY()) {
 
                c = imxuart_readahead[imxuart_readahead_out];
                imxuart_readahead_out = (imxuart_readahead_out + 1) &
@@ -2240,6 +2240,7 @@
                int cn_trapped = 0;
                cin = bus_space_read_4(iot, ioh, IMX_URXD);
                cn_check_magic(dev, cin & 0xff, imxuart_cnm_state);
+               imxuart_readahead[imxuart_readahead_in] = cin & 0xff;
                imxuart_readahead_in = (imxuart_readahead_in + 1) &
                    (READAHEAD_RING_LEN-1);
        }



Home | Main Index | Thread Index | Old Index