The driver must provide throttle and unthrottle in uart_ops when it sets UPSTAT_AUTORTS. Add them using existing stop_rx & enable_interrupts functions.
Unified · Split
| @@ -1367,6 +1367,15 @@ static void pl011_stop_rx(struct uart_port *port) · 1366 unmodified lines | ||
| 1367 | 1367 | pl011_dma_rx_stop(uap); |
| 1368 | 1368 | } |
| 1369 | 1369 | |
| 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 | + | |
| 1370 | 1379 | static void pl011_enable_ms(struct uart_port *port) |
| 1371 | 1380 | { |
| 1372 | 1381 | struct uart_amba_port *uap = |
| @@ -1788,9 +1797,10 @@ static int pl011_allocate_irq(struct uart_amba_port *uap) · 415 unmodified lines | ||
| 1788 | 1797 | */ |
| 1789 | 1798 | static void pl011_enable_interrupts(struct uart_amba_port *uap) |
| 1790 | 1799 | { |
| 1800 | + unsigned long flags; | |
| 1791 | 1801 | unsigned int i; |
| 1792 | 1802 | |
| 1793 | − spin_lock_irq(&uap->port.lock); | |
| 1803 | + spin_lock_irqsave(&uap->port.lock, flags); | |
| 1794 | 1804 | |
| 1795 | 1805 | /* Clear out any spuriously appearing RX interrupts */ |
| 1796 | 1806 | 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 | ||
| 1812 | 1822 | if (!pl011_dma_rx_running(uap)) |
| 1813 | 1823 | uap->im |= UART011_RXIM; |
| 1814 | 1824 | 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); | |
| 1816 | 1833 | } |
| 1817 | 1834 | |
| 1818 | 1835 | static int pl011_startup(struct uart_port *port) |
| @@ -2225,6 +2242,8 @@ static const struct uart_ops amba_pl011_pops = { · 406 unmodified lines | ||
| 2225 | 2242 | .stop_tx = pl011_stop_tx, |
| 2226 | 2243 | .start_tx = pl011_start_tx, |
| 2227 | 2244 | .stop_rx = pl011_stop_rx, |
| 2245 | + .throttle = pl011_throttle_rx, | |
| 2246 | + .unthrottle = pl011_unthrottle_rx, | |
| 2228 | 2247 | .enable_ms = pl011_enable_ms, |
| 2229 | 2248 | .break_ctl = pl011_break_ctl, |
| 2230 | 2249 | .startup = pl011_startup, |