serial: amba-pl011: fix high priority character transmission in rs486 mode
commit 4f39aca2360c82dccd2f5179d77e94aab665bea6 upstream.
In RS485 mode the transmission of a high priority character fails since it
is written to the data register before the transmitter is enabled. Fix this
in pl011_tx_chars() by enabling RS485 transmission before writing the
character.
Fixes: 8d47923772 ("serial: amba-pl011: add RS485 support")
Cc: stable@vger.kernel.org
Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Link: https://lore.kernel.org/r/20230108181735.10937-1-LinoSanfilippo@gmx.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0f150134dd
commit
b85498385a
@@ -1472,6 +1472,10 @@ static bool pl011_tx_chars(struct uart_amba_port *uap, bool from_irq)
|
||||
struct circ_buf *xmit = &uap->port.state->xmit;
|
||||
int count = uap->fifosize >> 1;
|
||||
|
||||
if ((uap->port.rs485.flags & SER_RS485_ENABLED) &&
|
||||
!uap->rs485_tx_started)
|
||||
pl011_rs485_tx_start(uap);
|
||||
|
||||
if (uap->port.x_char) {
|
||||
if (!pl011_tx_char(uap, uap->port.x_char, from_irq))
|
||||
return true;
|
||||
@@ -1483,10 +1487,6 @@ static bool pl011_tx_chars(struct uart_amba_port *uap, bool from_irq)
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((uap->port.rs485.flags & SER_RS485_ENABLED) &&
|
||||
!uap->rs485_tx_started)
|
||||
pl011_rs485_tx_start(uap);
|
||||
|
||||
/* If we are using DMA mode, try to send some characters. */
|
||||
if (pl011_dma_tx_irq(uap))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user