serial: 8250: Fix THRE flag usage for CAP_MINI
[sfrench/cifs-2.6.git] / drivers / tty / serial / 8250 / 8250_port.c
index 4c620bedfbf47cade67098c91a7e547acd18b460..a5fe0e66c60725bf227ea8acf2e93fe2adda5c4c 100644 (file)
@@ -1764,6 +1764,10 @@ void serial8250_tx_chars(struct uart_8250_port *up)
                if ((up->capabilities & UART_CAP_HFIFO) &&
                    (serial_in(up, UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY)
                        break;
+               /* The BCM2835 MINI UART THRE bit is really a not-full bit. */
+               if ((up->capabilities & UART_CAP_MINI) &&
+                   !(serial_in(up, UART_LSR) & UART_LSR_THRE))
+                       break;
        } while (--count > 0);
 
        if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)