Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144836145
D36184.id109310.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.id109310.diff
View Options
Index: sys/dev/uart/uart_dev_ns8250.c
===================================================================
--- sys/dev/uart/uart_dev_ns8250.c
+++ sys/dev/uart/uart_dev_ns8250.c
@@ -178,13 +178,21 @@
* 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 asserted both
+ * prior to and after a DELAY; but as long as LSR_RXRDY is
+ * not asserted, read (and discard) characters as quickly
+ * as possible.
*/
- limit=10*4096;
- while ((uart_getreg(bas, REG_LSR) & LSR_RXRDY) && --limit) {
+ for (limit = 10 * 4096; limit > 0; limit--) {
+ if ((uart_getreg(bas, REG_LSR) & LSR_RXRDY) == 0) {
+ DELAY(delay << 2);
+ uart_barrier(bas);
+ if ((uart_getreg(bas, REG_LSR) & LSR_RXRDY) == 0)
+ break;
+ }
(void)uart_getreg(bas, REG_DATA);
uart_barrier(bas);
- DELAY(delay << 2);
}
if (limit == 0) {
/* printf("ns8250: receiver appears broken... "); */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 14, 6:14 AM (10 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28690471
Default Alt Text
D36184.id109310.diff (1 KB)
Attached To
Mode
D36184: ns8250_drain: Drain without DELAY first
Attached
Detach File
Event Timeline
Log In to Comment