NetBSD Problem Report #45354

From www@NetBSD.org  Sat Sep 10 15:29:08 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 70B1F63C40C
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 10 Sep 2011 15:29:08 +0000 (UTC)
Message-Id: <20110910152907.AF48363BBFF@www.NetBSD.org>
Date: Sat, 10 Sep 2011 15:29:07 +0000 (UTC)
From: y7goto@gmail.com
Reply-To: y7goto@gmail.com
To: gnats-bugs@NetBSD.org
Subject: no character is put in the read-ahead buffer in a console code of arch/arm/imx/imxuart.c
X-Send-Pr-Version: www-1.0

>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:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 10 15:30:00 +0000 2011
>Closed-Date:    Fri May 20 07:04:30 +0000 2022
>Last-Modified:  Fri May 20 07:04:30 +0000 2022
>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);
        }

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Fri, 20 May 2022 07:04:30 +0000
State-Changed-Why:
Fix applied.
Thanks for the PR


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.