Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151004429
D36979.id111769.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
738 B
Referenced Files
None
Subscribers
None
D36979.id111769.diff
View Options
diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c
--- a/sys/dev/uart/uart_dev_ns8250.c
+++ b/sys/dev/uart/uart_dev_ns8250.c
@@ -210,6 +210,8 @@
ns8250_flush(struct uart_bas *bas, int what)
{
uint8_t fcr;
+ uint8_t lsr;
+ int drain = 0;
fcr = FCR_ENABLE;
#ifdef CPU_XBURST
@@ -221,6 +223,16 @@
fcr |= FCR_RCV_RST;
uart_setreg(bas, REG_FCR, fcr);
uart_barrier(bas);
+
+ lsr = uart_getreg(bas, REG_LSR);
+ if ((lsr & LSR_TEMT) && (what & UART_FLUSH_TRANSMITTER))
+ drain |= UART_DRAIN_TRANSMITTER;
+ if ((lsr & LSR_RXRDY) && (what & UART_FLUSH_RECEIVER))
+ drain |= UART_DRAIN_RECEIVER;
+ if (drain) {
+ printf("ns8250: UART FCR is broken\n");
+ ns8250_drain(bas, drain);
+ }
}
static int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 6, 10:15 AM (7 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30958655
Default Alt Text
D36979.id111769.diff (738 B)
Attached To
Mode
D36979: ns8250: Check if flush via FCR succeeded
Attached
Detach File
Event Timeline
Log In to Comment