History

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.

Ilpo Järvinen committed 4 years ago

Commit 211565b1 parent f7e35e41 file · +21 −2Browse files

Unified · Split

drivers/tty/serial/amba-pl011.c+21−2
@@ -1367,6 +1367,15 @@ static void pl011_stop_rx(struct uart_port *port) · 1366 unmodified lines
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) · 415 unmodified lines
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) · 15 unmodified lines
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 = { · 406 unmodified lines
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,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t