diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2009-12-01 04:54:46 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-12-03 23:42:23 -0500 |
commit | b1516803d5274386256bef4972dfbf8c9eed5165 (patch) | |
tree | 1626874e3dbf9e4715097ca23f2a650c8a789254 /drivers/serial | |
parent | fd2cb0ce74e07babaf8c7bf96ef03c25d194e463 (diff) |
serial: sh-sci: Fix too early port disabling.
Currently serial ports on SH CPUs get disabled too early, because the
sci_tx_empty() routine claims to not be able to detect whether the
transmission has been completed and just always returns TIOCSER_TEMT. This
results in corrupt output of last characters if the port is not open for
reading at the same time. It is however possible to detect whether
transmission has been completed. Use the TEND bit of the status register
for this.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/sh-sci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 972fca0a3ef1..ff38dbdb5c6e 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -799,8 +799,8 @@ static void sci_free_irq(struct sci_port *port) | |||
799 | 799 | ||
800 | static unsigned int sci_tx_empty(struct uart_port *port) | 800 | static unsigned int sci_tx_empty(struct uart_port *port) |
801 | { | 801 | { |
802 | /* Can't detect */ | 802 | unsigned short status = sci_in(port, SCxSR); |
803 | return TIOCSER_TEMT; | 803 | return status & SCxSR_TEND(port) ? TIOCSER_TEMT : 0; |
804 | } | 804 | } |
805 | 805 | ||
806 | static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl) | 806 | static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl) |