Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102748113
D36184.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36184.id.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
@@ -178,11 +178,18 @@
* limit high enough to handle large FIFOs and integrated
* UARTs. The HP rx2600 for example has 3 UARTs on the
* management board that tend to get a lot of data send
- * to it when the UART is first activated.
+ * to it when the UART is first activated. Assume that we
+ * have finished draining if LSR_RXRDY is not asserted both
+ * prior to and after a DELAY; but as long as LSR_RXRDY is
+ * asserted, read (and discard) characters as quickly as
+ * possible.
*/
limit=10*4096;
- while ((uart_getreg(bas, REG_LSR) & LSR_RXRDY) && --limit) {
- (void)uart_getreg(bas, REG_DATA);
+ while (limit && (uart_getreg(bas, REG_LSR) & LSR_RXRDY) && --limit) {
+ do {
+ (void)uart_getreg(bas, REG_DATA);
+ uart_barrier(bas);
+ } while ((uart_getreg(bas, REG_LSR) & LSR_RXRDY) && --limit);
uart_barrier(bas);
DELAY(delay << 2);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 4:22 PM (4 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14682046
Default Alt Text
D36184.id.diff (1 KB)
Attached To
Mode
D36184: ns8250_drain: Drain without DELAY first
Attached
Detach File
Event Timeline
Log In to Comment