On Fri, 1 Sep 2017, Greg KH wrote:
On Fri, Sep 01, 2017 at 09:48:15AM -0500, Russell Enderby wrote:
Issue where unprintable characters can occur or output is cut off over
the serial uart / linux console depending on timing.
Problem occurs when changing the serial baud rate when setting up the
new console.The bcm63xx driver does a disable and flush of the uart tx
fifo while there is data still in the tx fifo.
If the tx fifo still has data it is trying to send out, we need to wait
until it is empty before disabling and flushing the uart.
When we now go to change the uart parameters including speed we check
if there is data currently in the tx fifo.If there is was mdelay(10)
and check again.If it tries 3 times and still has data in it we just
continue and sacrifice the tx fifo buffer.
A cleaner and more preferred approach would be to remove :
- spin_lock_irqsave()
- bcm_uart_disable()
- bcm_uart_flush()
However it is not clear if the author put those in to fix another
underlying issue.As a result this solution is a safer approach.
BEFORE FIX
[0.306000] 14e00520.serial: ttyS0 at MMIO 0x14e00520 (irq = 9, base_baud = 1687500) is a° 0.315000] console[ttyS0] enabled
AFTER FIX
[0.315000] 14e00520.serial: ttyS0 at MMIO 0x14e00520 (irq = 9, base_baud = 1687500) is a bcm63xx_uart
[0.334000] console[ttyS0] enabled
Signed-off-by: Russell Enderby <rte@xxxxxxx>
---
drivers/tty/serial/bcm63xx_uart.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index 2ea2763..8c48c37 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
@@ -511,11 +511,9 @@ static void bcm_uart_set_termios(struct uart_port *port,
spin_lock_irqsave(&port->lock, flags);
- /*_ Drain the hot tub fully before we power it off for the winter. */
+ /* Drain the hot tub fully before we power it off for the winter. */
for (tries = 3; !bcm_uart_tx_empty(port) && tries; tries--)
mdelay(10);
- if (!tries)
- printk(port->dev, "Unable to drain serial transmitter.\n");
/* disable uart while changing speed */
bcm_uart_disable(port);
Patch does not apply at all as you made it against a previous version of
your patches. And I'm not going to apply your old patches, they were
incorrect...
This was applied against v1 patch which you said on my 2nd attempt needed
to be a diff against v1 which this was. Are you saying you just want the
whole thing redone as a v1 patch again?
> --
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html