Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db106df3 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman
Browse files

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: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fba594a8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -140,6 +140,8 @@ hardware.
	will append the character to the circular buffer and then call
	start_tx() / stop_tx() to flush the data out.

	Do not transmit if ch == '\0' (__DISABLED_CHAR).

	Locking: none.
	Interrupts: caller dependent.

+3 −0
Original line number Diff line number Diff line
@@ -268,6 +268,9 @@ static void sunhv_send_xchar(struct uart_port *port, char ch)
	unsigned long flags;
	int limit = 10000;

	if (ch == __DISABLED_CHAR)
		return;

	spin_lock_irqsave(&port->lock, flags);

	while (limit-- > 0) {
+3 −0
Original line number Diff line number Diff line
@@ -468,6 +468,9 @@ static void sunsab_send_xchar(struct uart_port *port, char ch)
	struct uart_sunsab_port *up = (struct uart_sunsab_port *) port;
	unsigned long flags;

	if (ch == __DISABLED_CHAR)
		return;

	spin_lock_irqsave(&up->port.lock, flags);

	sunsab_tec_wait(up);