| .. | .. |
|---|
| 2191 | 2191 | { |
|---|
| 2192 | 2192 | struct uart_amba_port *uap = amba_ports[co->index]; |
|---|
| 2193 | 2193 | unsigned int old_cr = 0, new_cr; |
|---|
| 2194 | | - unsigned long flags; |
|---|
| 2194 | + unsigned long flags = 0; |
|---|
| 2195 | 2195 | int locked = 1; |
|---|
| 2196 | 2196 | |
|---|
| 2197 | 2197 | clk_enable(uap->clk); |
|---|
| 2198 | 2198 | |
|---|
| 2199 | | - local_irq_save(flags); |
|---|
| 2199 | + /* |
|---|
| 2200 | + * local_irq_save(flags); |
|---|
| 2201 | + * |
|---|
| 2202 | + * This local_irq_save() is nonsense. If we come in via sysrq |
|---|
| 2203 | + * handling then interrupts are already disabled. Aside of |
|---|
| 2204 | + * that the port.sysrq check is racy on SMP regardless. |
|---|
| 2205 | + */ |
|---|
| 2200 | 2206 | if (uap->port.sysrq) |
|---|
| 2201 | 2207 | locked = 0; |
|---|
| 2202 | 2208 | else if (oops_in_progress) |
|---|
| 2203 | | - locked = spin_trylock(&uap->port.lock); |
|---|
| 2209 | + locked = spin_trylock_irqsave(&uap->port.lock, flags); |
|---|
| 2204 | 2210 | else |
|---|
| 2205 | | - spin_lock(&uap->port.lock); |
|---|
| 2211 | + spin_lock_irqsave(&uap->port.lock, flags); |
|---|
| 2206 | 2212 | |
|---|
| 2207 | 2213 | /* |
|---|
| 2208 | 2214 | * First save the CR then disable the interrupts |
|---|
| .. | .. |
|---|
| 2228 | 2234 | pl011_write(old_cr, uap, REG_CR); |
|---|
| 2229 | 2235 | |
|---|
| 2230 | 2236 | if (locked) |
|---|
| 2231 | | - spin_unlock(&uap->port.lock); |
|---|
| 2232 | | - local_irq_restore(flags); |
|---|
| 2237 | + spin_unlock_irqrestore(&uap->port.lock, flags); |
|---|
| 2233 | 2238 | |
|---|
| 2234 | 2239 | clk_disable(uap->clk); |
|---|
| 2235 | 2240 | } |
|---|