The patch titled serial: timbuart: make sure last byte is sent when port is closed has been added to the -mm tree. Its filename is serial-timbuart-make-sure-last-byte-is-sent-when-port-is-closed.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: serial: timbuart: make sure last byte is sent when port is closed From: Richard Röjfors <richard.rojfors@xxxxxxxxxxxxxx> Fix a problem in early versions of the FPGA IP. In certain situations the IP reports that the FIFO is empty, but a byte is still clocked out. If a flush is done at that point the currently clocked byte is canceled. This causes incompatibilities with the upper layers when a port is closed, it waits until the FIFO is empty and then closes the port. During close the FIFO is flushed -> the last byte is not sent properly. Now the FIFO is only flushed if it is reported to be non-empty. Which makes the currently clocked out byte to finish. Signed-off-by: Richard Röjfors <richard.rojfors@xxxxxxxxxxxxxx> Cc: Greg KH <greg@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/serial/timbuart.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff -puN drivers/serial/timbuart.c~serial-timbuart-make-sure-last-byte-is-sent-when-port-is-closed drivers/serial/timbuart.c --- a/drivers/serial/timbuart.c~serial-timbuart-make-sure-last-byte-is-sent-when-port-is-closed +++ a/drivers/serial/timbuart.c @@ -69,10 +69,13 @@ static void timbuart_start_tx(struct uar static void timbuart_flush_buffer(struct uart_port *port) { - u8 ctl = ioread8(port->membase + TIMBUART_CTRL) | TIMBUART_CTRL_FLSHTX; + if (!timbuart_tx_empty(port)) { + u8 ctl = ioread8(port->membase + TIMBUART_CTRL) | + TIMBUART_CTRL_FLSHTX; - iowrite8(ctl, port->membase + TIMBUART_CTRL); - iowrite32(TXBF, port->membase + TIMBUART_ISR); + iowrite8(ctl, port->membase + TIMBUART_CTRL); + iowrite32(TXBF, port->membase + TIMBUART_ISR); + } } static void timbuart_rx_chars(struct uart_port *port) _ Patches currently in -mm which might be from richard.rojfors@xxxxxxxxxxxxxx are origin.patch drivers-gpio-max730xc-add-license-macro.patch drivers-gpio-max730xc-add-license-macro-fix.patch linux-next.patch serial-two-branches-the-same-in-timbuart_set_mctrl.patch serial-timbuart-make-sure-last-byte-is-sent-when-port-is-closed.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html