.. | .. |
---|
1048 | 1048 | */ |
---|
1049 | 1049 | static inline void pl011_dma_rx_stop(struct uart_amba_port *uap) |
---|
1050 | 1050 | { |
---|
| 1051 | + if (!uap->using_rx_dma) |
---|
| 1052 | + return; |
---|
| 1053 | + |
---|
1051 | 1054 | /* FIXME. Just disable the DMA enable */ |
---|
1052 | 1055 | uap->dmacr &= ~UART011_RXDMAE; |
---|
1053 | 1056 | pl011_write(uap->dmacr, uap, REG_DMACR); |
---|
.. | .. |
---|
1757 | 1760 | static void pl011_unthrottle_rx(struct uart_port *port) |
---|
1758 | 1761 | { |
---|
1759 | 1762 | struct uart_amba_port *uap = container_of(port, struct uart_amba_port, port); |
---|
| 1763 | + unsigned long flags; |
---|
1760 | 1764 | |
---|
1761 | | - pl011_enable_interrupts(uap); |
---|
| 1765 | + spin_lock_irqsave(&uap->port.lock, flags); |
---|
| 1766 | + |
---|
| 1767 | + uap->im = UART011_RTIM; |
---|
| 1768 | + if (!pl011_dma_rx_running(uap)) |
---|
| 1769 | + uap->im |= UART011_RXIM; |
---|
| 1770 | + |
---|
| 1771 | + pl011_write(uap->im, uap, REG_IMSC); |
---|
| 1772 | + |
---|
| 1773 | + spin_unlock_irqrestore(&uap->port.lock, flags); |
---|
1762 | 1774 | } |
---|
1763 | 1775 | |
---|
1764 | 1776 | static int pl011_startup(struct uart_port *port) |
---|
.. | .. |
---|
2199 | 2211 | { |
---|
2200 | 2212 | struct uart_amba_port *uap = amba_ports[co->index]; |
---|
2201 | 2213 | unsigned int old_cr = 0, new_cr; |
---|
2202 | | - unsigned long flags = 0; |
---|
| 2214 | + unsigned long flags; |
---|
2203 | 2215 | int locked = 1; |
---|
2204 | 2216 | |
---|
2205 | 2217 | clk_enable(uap->clk); |
---|
2206 | 2218 | |
---|
2207 | | - /* |
---|
2208 | | - * local_irq_save(flags); |
---|
2209 | | - * |
---|
2210 | | - * This local_irq_save() is nonsense. If we come in via sysrq |
---|
2211 | | - * handling then interrupts are already disabled. Aside of |
---|
2212 | | - * that the port.sysrq check is racy on SMP regardless. |
---|
2213 | | - */ |
---|
| 2219 | + local_irq_save(flags); |
---|
2214 | 2220 | if (uap->port.sysrq) |
---|
2215 | 2221 | locked = 0; |
---|
2216 | 2222 | else if (oops_in_progress) |
---|
2217 | | - locked = spin_trylock_irqsave(&uap->port.lock, flags); |
---|
| 2223 | + locked = spin_trylock(&uap->port.lock); |
---|
2218 | 2224 | else |
---|
2219 | | - spin_lock_irqsave(&uap->port.lock, flags); |
---|
| 2225 | + spin_lock(&uap->port.lock); |
---|
2220 | 2226 | |
---|
2221 | 2227 | /* |
---|
2222 | 2228 | * First save the CR then disable the interrupts |
---|
.. | .. |
---|
2242 | 2248 | pl011_write(old_cr, uap, REG_CR); |
---|
2243 | 2249 | |
---|
2244 | 2250 | if (locked) |
---|
2245 | | - spin_unlock_irqrestore(&uap->port.lock, flags); |
---|
| 2251 | + spin_unlock(&uap->port.lock); |
---|
| 2252 | + local_irq_restore(flags); |
---|
2246 | 2253 | |
---|
2247 | 2254 | clk_disable(uap->clk); |
---|
2248 | 2255 | } |
---|