diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2014-09-02 17:39:15 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-08 19:22:42 -0400 |
commit | db106df32d679db151b48a09543b03ee41cb2580 (patch) | |
tree | bef38581727c0696e7aac02df61ceb9a8a093685 | |
parent | fba594a848f6f35417a358565086d22c533c19c8 (diff) |
serial: Fix send_xchar() handlers
START_CHAR() & STOP_CHAR() can be disabled if set to '\0'
(__DISABLED_CHAR). UART drivers which define a send_xchar()
handler must not transmit __DISABLED_CHAR.
Document requirement.
Affected drivers:
sunsab
sunhv
cc: David S. Miller <davem@davemloft.net>
cc: <sparclinux@vger.kernel.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | Documentation/serial/driver | 2 | ||||
-rw-r--r-- | drivers/tty/serial/sunhv.c | 3 | ||||
-rw-r--r-- | drivers/tty/serial/sunsab.c | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/serial/driver b/Documentation/serial/driver index 3bba1aeb799c..ba64e4b892e9 100644 --- a/Documentation/serial/driver +++ b/Documentation/serial/driver | |||
@@ -140,6 +140,8 @@ hardware. | |||
140 | will append the character to the circular buffer and then call | 140 | will append the character to the circular buffer and then call |
141 | start_tx() / stop_tx() to flush the data out. | 141 | start_tx() / stop_tx() to flush the data out. |
142 | 142 | ||
143 | Do not transmit if ch == '\0' (__DISABLED_CHAR). | ||
144 | |||
143 | Locking: none. | 145 | Locking: none. |
144 | Interrupts: caller dependent. | 146 | Interrupts: caller dependent. |
145 | 147 | ||
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c index 20521db2189f..25d43ce8b318 100644 --- a/drivers/tty/serial/sunhv.c +++ b/drivers/tty/serial/sunhv.c | |||
@@ -268,6 +268,9 @@ static void sunhv_send_xchar(struct uart_port *port, char ch) | |||
268 | unsigned long flags; | 268 | unsigned long flags; |
269 | int limit = 10000; | 269 | int limit = 10000; |
270 | 270 | ||
271 | if (ch == __DISABLED_CHAR) | ||
272 | return; | ||
273 | |||
271 | spin_lock_irqsave(&port->lock, flags); | 274 | spin_lock_irqsave(&port->lock, flags); |
272 | 275 | ||
273 | while (limit-- > 0) { | 276 | while (limit-- > 0) { |
diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c index b9598b227a45..0af75f8b98a4 100644 --- a/drivers/tty/serial/sunsab.c +++ b/drivers/tty/serial/sunsab.c | |||
@@ -468,6 +468,9 @@ static void sunsab_send_xchar(struct uart_port *port, char ch) | |||
468 | struct uart_sunsab_port *up = (struct uart_sunsab_port *) port; | 468 | struct uart_sunsab_port *up = (struct uart_sunsab_port *) port; |
469 | unsigned long flags; | 469 | unsigned long flags; |
470 | 470 | ||
471 | if (ch == __DISABLED_CHAR) | ||
472 | return; | ||
473 | |||
471 | spin_lock_irqsave(&up->port.lock, flags); | 474 | spin_lock_irqsave(&up->port.lock, flags); |
472 | 475 | ||
473 | sunsab_tec_wait(up); | 476 | sunsab_tec_wait(up); |