Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Apr 2019 08:30:58 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 237576] UART NS8250 parity and frame errors detection doesn't work
Message-ID:  <bug-237576-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237576

            Bug ID: 237576
           Summary: UART NS8250 parity and frame errors detection doesn't
                    work
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: smaryus@gmail.com

On the UART NS8250 errors (parity/frame) are not detected when data is rece=
ived
because every time there is a read on LSR register the errors bit is remove=
d.
See [1]
Current UART core implementation relies on the LSR register to detect if da=
ta
is received. If data is received LSR is read again in pair with DATA regist=
er
to determine if the received byte generate any errors. At this time LSR err=
or
bit is clear so no errors are reported.

In code:
1. uart_core.c: `uart_intr()` calls `UART_IPEND` which will go into
`ns8250_bus_ipend()`. Here LSR register is read and returns data received.
2. `uart_intr` calls `uart_intr_rxready` -> `UART_RECEIVE` ->
`ns8250_bus_receive`. Here LSR is read again to check if the received byte
generated error, but error bit from LSR is now 0. It was cleared by step 1.


[1]
https://en.wikibooks.org/wiki/Serial_Programming/8250_UART_Programming#Line=
_Status_Register

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-237576-227>