Skip to content

Commit 211565b

Browse files
ij-intelgregkh
authored andcommitted
serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle
The driver must provide throttle and unthrottle in uart_ops when it sets UPSTAT_AUTORTS. Add them using existing stop_rx & enable_interrupts functions. Fixes: 2a76fa2 (serial: pl011: Adopt generic flag to store auto RTS status) Cc: stable <[email protected]> Cc: Lukas Wunner <[email protected]> Reported-by: Nuno Gonçalves <[email protected]> Tested-by: Nuno Gonçalves <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f7e35e4 commit 211565b

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

drivers/tty/serial/amba-pl011.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,15 @@ static void pl011_stop_rx(struct uart_port *port)
13671367
pl011_dma_rx_stop(uap);
13681368
}
13691369

1370+
static void pl011_throttle_rx(struct uart_port *port)
1371+
{
1372+
unsigned long flags;
1373+
1374+
spin_lock_irqsave(&port->lock, flags);
1375+
pl011_stop_rx(port);
1376+
spin_unlock_irqrestore(&port->lock, flags);
1377+
}
1378+
13701379
static void pl011_enable_ms(struct uart_port *port)
13711380
{
13721381
struct uart_amba_port *uap =
@@ -1788,9 +1797,10 @@ static int pl011_allocate_irq(struct uart_amba_port *uap)
17881797
*/
17891798
static void pl011_enable_interrupts(struct uart_amba_port *uap)
17901799
{
1800+
unsigned long flags;
17911801
unsigned int i;
17921802

1793-
spin_lock_irq(&uap->port.lock);
1803+
spin_lock_irqsave(&uap->port.lock, flags);
17941804

17951805
/* Clear out any spuriously appearing RX interrupts */
17961806
pl011_write(UART011_RTIS | UART011_RXIS, uap, REG_ICR);
@@ -1812,7 +1822,14 @@ static void pl011_enable_interrupts(struct uart_amba_port *uap)
18121822
if (!pl011_dma_rx_running(uap))
18131823
uap->im |= UART011_RXIM;
18141824
pl011_write(uap->im, uap, REG_IMSC);
1815-
spin_unlock_irq(&uap->port.lock);
1825+
spin_unlock_irqrestore(&uap->port.lock, flags);
1826+
}
1827+
1828+
static void pl011_unthrottle_rx(struct uart_port *port)
1829+
{
1830+
struct uart_amba_port *uap = container_of(port, struct uart_amba_port, port);
1831+
1832+
pl011_enable_interrupts(uap);
18161833
}
18171834

18181835
static int pl011_startup(struct uart_port *port)
@@ -2225,6 +2242,8 @@ static const struct uart_ops amba_pl011_pops = {
22252242
.stop_tx = pl011_stop_tx,
22262243
.start_tx = pl011_start_tx,
22272244
.stop_rx = pl011_stop_rx,
2245+
.throttle = pl011_throttle_rx,
2246+
.unthrottle = pl011_unthrottle_rx,
22282247
.enable_ms = pl011_enable_ms,
22292248
.break_ctl = pl011_break_ctl,
22302249
.startup = pl011_startup,

0 commit comments

Comments
 (0)