FreeBSD Bugzilla – Attachment 144015 Details for
Bug 191265
[patch] uart(4) punishes UARTs for being too fast
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix for discarding data when internal buffer full.
uart_flush.patch (text/plain), 1.10 KB, created by
Stephen Hurd
on 2014-06-22 09:26:41 UTC
(
hide
)
Description:
Fix for discarding data when internal buffer full.
Filename:
MIME Type:
Creator:
Stephen Hurd
Created:
2014-06-22 09:26:41 UTC
Size:
1.10 KB
patch
obsolete
>Index: uart_dev_ns8250.c >=================================================================== >--- uart_dev_ns8250.c (revision 267714) >+++ uart_dev_ns8250.c (working copy) >@@ -842,26 +842,20 @@ > > bas = &sc->sc_bas; > uart_lock(sc->sc_hwmtx); >- lsr = uart_getreg(bas, REG_LSR); >- while (lsr & LSR_RXRDY) { >- if (uart_rx_full(sc)) { >- sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; >+ while(!uart_rx_full(sc)) { >+ lsr = uart_getreg(bas, REG_LSR); >+ if (lsr & LSR_RXRDY) { >+ xc = uart_getreg(bas, REG_DATA); >+ if (lsr & LSR_FE) >+ xc |= UART_STAT_FRAMERR; >+ if (lsr & LSR_PE) >+ xc |= UART_STAT_PARERR; >+ uart_rx_put(sc, xc); >+ lsr = uart_getreg(bas, REG_LSR); >+ } >+ else > break; >- } >- xc = uart_getreg(bas, REG_DATA); >- if (lsr & LSR_FE) >- xc |= UART_STAT_FRAMERR; >- if (lsr & LSR_PE) >- xc |= UART_STAT_PARERR; >- uart_rx_put(sc, xc); >- lsr = uart_getreg(bas, REG_LSR); > } >- /* Discard everything left in the Rx FIFO. */ >- while (lsr & LSR_RXRDY) { >- (void)uart_getreg(bas, REG_DATA); >- uart_barrier(bas); >- lsr = uart_getreg(bas, REG_LSR); >- } > uart_unlock(sc->sc_hwmtx); > return (0); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 191265
: 144015